service/app/mix/controller/config_op.go

84 lines
2.0 KiB
Go
Raw Normal View History

2023-12-21 22:17:40 +08:00
package controller
import (
"service/api/base"
"service/api/errcode"
configproto "service/api/proto/config/proto"
"service/app/mix/service"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func OpGetStreamerTagList(ctx *gin.Context) {
config, ec := service.DefaultConfigService.OpGetStreamerTagList(ctx)
if ec != errcode.ErrCodeOk {
logger.Error("OpGetStreamerTagList fail, ec: %v", ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, config)
}
func OpGetPlatformList(ctx *gin.Context) {
config, ec := service.DefaultConfigService.OpGetPlatformList(ctx)
if ec != errcode.ErrCodeOk {
logger.Error("OpGetPlatformList fail, ec: %v", ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, config)
}
func OpGetSupportWxIdList(ctx *gin.Context) {
config, ec := service.DefaultConfigService.OpGetSupportWxIdList(ctx)
if ec != errcode.ErrCodeOk {
logger.Error("OpGetSupportWxIdList fail, ec: %v", ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, config)
}
func OpIsThereANewVersionAvailable(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*base.BaseRequest)
result, version, ec := service.DefaultConfigService.OpIsThereANewVersionAvailable(ctx, req)
if ec != errcode.ErrCodeOk {
logger.Error("OpIsThereANewVersionAvailable fail, ec: %v", ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &configproto.VersionData{
Result: result,
Version: version,
}
ReplyOk(ctx, data)
}
2023-12-28 18:37:39 +08:00
func OpGetUploadMediaFailConfigList(ctx *gin.Context) {
config, ec := service.DefaultConfigService.OpGetUploadMediaFailConfigList(ctx)
if ec != errcode.ErrCodeOk {
logger.Error("OpGetUploadMediaFailConfigList fail, ec: %v", ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, config)
}
2024-04-30 09:51:23 +08:00
func OpGetIsMomentImageEncryptEnabled(ctx *gin.Context) {
isEnabled, ec := service.DefaultConfigService.OpGetIsMomentImageEncryptEnabled(ctx)
if ec != errcode.ErrCodeOk {
logger.Error("OpGetIsMomentImageEncryptEnabled fail, ec: %v", ec)
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, isEnabled)
}