Merge branch 'dev-lwl/fix' into test

This commit is contained in:
lwl0608 2024-05-03 02:56:55 +08:00
commit 7e197f34a6
4 changed files with 42 additions and 2 deletions

View File

@ -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

View File

@ -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 {

View File

@ -1001,6 +1001,11 @@ func (v *Vas) GetCHList(ctx *gin.Context, mid int64, typ int32, offset, limit in
// 更新微信
func (v *Vas) UpdateWechat(ctx *gin.Context, req *vasproto.UpdateWechatReq) (err error) {
if req.WechatCoinPrice <= 0 {
logger.Warn("invalid req.WechatCoinPrice, req: %v", util.ToJson(req))
return nil
}
err = v.store.UpdateUserVasInfo(ctx, req)
return
}

View File

@ -57,6 +57,7 @@ import (
"service/library/payclients/alipaycli"
"service/library/payclients/wxpaycli"
"service/library/redis"
"strings"
"time"
accountpunishmentproto "service/api/proto/accountpunishment/proto"
@ -3004,7 +3005,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