Merge pull request 'by Robin at 20240501' (#399) from feat-IRONFANS-104-Robin into main
Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/399
This commit is contained in:
commit
e7ade6e7cf
|
@ -53,6 +53,7 @@ const (
|
|||
ReferentialZoneMomentKey = "referential_zone_moment"
|
||||
IsMomentImageEncryptEnabledKey = "is_moment_image_encrypt_enabled"
|
||||
RestrictedVisitorMomentKey = "restricted_visitor_moment"
|
||||
AppConfigReflectKey = "app_config_reflect"
|
||||
)
|
||||
|
||||
// del_flag
|
||||
|
|
|
@ -40,6 +40,7 @@ import (
|
|||
"service/library/contentaudit/textaudit"
|
||||
videomoderation "service/library/contentaudit/video_moderation"
|
||||
"service/library/logger"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
|
@ -2110,7 +2111,23 @@ func (s *Service) ApiGetThumbsUpList(ctx *gin.Context, req *thumbsupproto.ApiLis
|
|||
func (s *Service) ApiGetAppConfigListByKey(ctx *gin.Context, req *appconfigproto.ApiListByKeyReq) (appconfig *dbstruct.AppConfig, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeAppConfigSrvOk
|
||||
|
||||
appconfig, err := _DefaultAppConfig.OpListByKey(ctx, &appconfigproto.OpListByKeyReq{
|
||||
//读取版本下是否有字段需要进行版本映射
|
||||
appConfigReflect, err := apollo.GetStringValue(consts.AppConfigReflectKey+"_"+req.BaseRequest.Version, apollo.ApolloOpts().SetNamespace("version"))
|
||||
if err != nil {
|
||||
logger.Error("Apollo read failed : %v", err)
|
||||
ec = errcode.ErrCodeApolloReadFail
|
||||
return
|
||||
}
|
||||
if appConfigReflect != "" {
|
||||
appConfigReflectColumns := strings.Split(appConfigReflect, ";")
|
||||
for _, column := range appConfigReflectColumns {
|
||||
if req.ConfigKey == column {
|
||||
req.ConfigKey = req.ConfigKey + "_" + req.BaseRequest.Version
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
appconfig, err = _DefaultAppConfig.OpListByKey(ctx, &appconfigproto.OpListByKeyReq{
|
||||
ConfigKey: req.ConfigKey,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -57,6 +57,7 @@ import (
|
|||
"service/library/payclients/alipaycli"
|
||||
"service/library/payclients/wxpaycli"
|
||||
"service/library/redis"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
accountpunishmentproto "service/api/proto/accountpunishment/proto"
|
||||
|
@ -2968,7 +2969,23 @@ func (s *Service) OpGetAppConfigListByKey(ctx *gin.Context, req *appconfigproto.
|
|||
return
|
||||
}
|
||||
|
||||
appconfig, err := _DefaultAppConfig.OpListByKey(ctx, req)
|
||||
//读取版本下是否有字段需要进行版本映射
|
||||
appConfigReflect, err := apollo.GetStringValue(consts.AppConfigReflectKey+"_"+req.BaseRequest.Version, apollo.ApolloOpts().SetNamespace("version"))
|
||||
if err != nil {
|
||||
logger.Error("Apollo read failed : %v", err)
|
||||
ec = errcode.ErrCodeApolloReadFail
|
||||
return
|
||||
}
|
||||
if appConfigReflect != "" {
|
||||
appConfigReflectColumns := strings.Split(appConfigReflect, ";")
|
||||
for _, column := range appConfigReflectColumns {
|
||||
if req.ConfigKey == column {
|
||||
req.ConfigKey = req.ConfigKey + "_" + req.BaseRequest.Version
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
appconfig, err = _DefaultAppConfig.OpListByKey(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("OpGetAppConfigListByKey fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeAppConfigSrvFail
|
||||
|
|
Loading…
Reference in New Issue