39 lines
1015 B
Go
39 lines
1015 B
Go
|
package controller
|
||
|
|
||
|
import (
|
||
|
"service/api/errcode"
|
||
|
appconfigproto "service/api/proto/app_config/proto"
|
||
|
"service/app/mix/service"
|
||
|
"service/bizcommon/util"
|
||
|
"service/library/logger"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func OpUpdateAppConfig(ctx *gin.Context) {
|
||
|
req := ctx.MustGet("client_req").(*appconfigproto.OpUpdateReq)
|
||
|
ec := service.DefaultService.OpUpdateAppConfig(ctx, req)
|
||
|
if ec != errcode.ErrCodeAppConfigSrvOk {
|
||
|
logger.Error("OpUpdateAppConfig fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||
|
ReplyErrCodeMsg(ctx, ec)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
ReplyOk(ctx, nil)
|
||
|
}
|
||
|
|
||
|
func OpGetAppConfigListByKey(ctx *gin.Context) {
|
||
|
req := ctx.MustGet("client_req").(*appconfigproto.OpListByKeyReq)
|
||
|
appconfig, ec := service.DefaultService.OpGetAppConfigListByKey(ctx, req)
|
||
|
if ec != errcode.ErrCodeAppConfigSrvOk {
|
||
|
logger.Error("OpGetAppConfigListByKey fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||
|
ReplyErrCodeMsg(ctx, ec)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
data := &appconfigproto.OpListByKeyData{
|
||
|
AppConfig: appconfig,
|
||
|
}
|
||
|
ReplyOk(ctx, data)
|
||
|
}
|