新增分享码功能
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/joho/godotenv"
|
||||
_ "github.com/luxsin/app-api/docs"
|
||||
"github.com/luxsin/app-api/internal/cache"
|
||||
"github.com/luxsin/app-api/internal/config"
|
||||
"github.com/luxsin/app-api/internal/database"
|
||||
@@ -26,6 +27,14 @@ import (
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// @title App Audio API
|
||||
// @version 1.0
|
||||
// @description 耳机音频参数 EQ 后端服务
|
||||
//
|
||||
// @BasePath /
|
||||
//
|
||||
// @contact.name Luxsin
|
||||
|
||||
func main() {
|
||||
_ = godotenv.Load()
|
||||
|
||||
@@ -78,6 +87,11 @@ func main() {
|
||||
deviceRepo := repository.NewDeviceRepository(db)
|
||||
devicePersistTask := task.NewDevicePersistTask(rdb, deviceRepo, log)
|
||||
devicePersistTask.Start(5 * time.Minute)
|
||||
|
||||
shareCodeCache := cache.NewShareCodeCache(rdb)
|
||||
shareCodeRepo := repository.NewShareCodeRepository(db)
|
||||
shareCodePersistTask := task.NewShareCodePersistTask(shareCodeCache, shareCodeRepo, log)
|
||||
shareCodePersistTask.Start(5 * time.Minute)
|
||||
} else {
|
||||
log.Info("device persist task disabled")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user