by Robin at 20240729

This commit is contained in:
Leufolium 2024-07-29 15:48:39 +08:00
parent 2a7c04d4ea
commit 8fcef422bb
3 changed files with 26 additions and 0 deletions

View File

@ -57,6 +57,7 @@ const (
ZoneVIPConfigKey = "zone_vip_config"
StreamerScoreFormulaKey = "streamer_score_formula"
HvyogoSingleDistributeChargePercentageKey = "hvyogo_single_distribute_charge_percentage"
DefaultZoneTextKey = "default_zone_text"
)
// del_flag

View File

@ -2530,11 +2530,23 @@ func (s *Service) ApiCreateZone(ctx *gin.Context, req *zoneproto.ApiCreateReq) (
return
}
//读取默认动态文字配置
defaultZoneText, err := apollo.GetStringValue(consts.DefaultZoneTextKey, apollo.ApolloOpts().SetNamespace("application"))
if err != nil {
logger.Error("Apollo read failed : %v", err)
ec = errcode.ErrCodeApolloReadFail
return
}
// 暂存空间简介
profile := req.Zone.GetProfile()
req.Zone.Mid = goproto.Int64(req.GetBaseRequest().Mid)
req.Zone.ZoneMomentCount = goproto.Int64(0)
req.Zone.ImageCount = goproto.Int64(0)
req.Zone.VideoCount = goproto.Int64(0)
req.Zone.IsZoneThirdPartnerHided = goproto.Int64(consts.IsHided_No)
req.Zone.Profile = goproto.String(defaultZoneText)
err, zid := _DefaultZone.OpCreate(ctx, &zoneproto.OpCreateReq{
Zone: req.Zone,
})
@ -2564,6 +2576,10 @@ func (s *Service) ApiCreateZone(ctx *gin.Context, req *zoneproto.ApiCreateReq) (
return
}
// 创建文字审核任务
req.Zone.Profile = goproto.String(profile)
s.CreateZoneTextAudit(ctx, req.Zone)
// 创建默认动态
cfg := apollostruct.ReferentialZoneMoment{}
err = apollo.GetJson(consts.ReferentialZoneMomentKey, &cfg, apollo.ApolloOpts().SetNamespace("zone"))
@ -2628,6 +2644,8 @@ func (s *Service) ApiUpdateZone(ctx *gin.Context, req *zoneproto.ApiUpdateReq) (
return
}
s.CreateZoneTextAudit(ctx, req.Zone)
return
}

View File

@ -43,3 +43,10 @@ func (p *Zone) GetIsZoneThirdPartnerHided() int64 {
}
return 0
}
func (p *Zone) GetProfile() string {
if p != nil && p.Profile != nil {
return *p.Profile
}
return ""
}