diff --git a/api/consts/consts.go b/api/consts/consts.go index 04fe0472..666e4274 100644 --- a/api/consts/consts.go +++ b/api/consts/consts.go @@ -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 diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 5df27ac9..669fe6df 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -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 } diff --git a/dbstruct/zone.go b/dbstruct/zone.go index 44a89946..f73accfa 100644 --- a/dbstruct/zone.go +++ b/dbstruct/zone.go @@ -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 "" +}