This commit is contained in:
Leufolium 2024-07-25 17:49:13 +08:00
parent 3cdc52c75e
commit 2a7c04d4ea
3 changed files with 54 additions and 11 deletions

View File

@ -149,6 +149,27 @@ func (s *Service) CreateStreamerAuthApprovalDetailsTextAudit(ctx *gin.Context, n
return
}
func (s *Service) CreateZoneTextAudit(ctx *gin.Context, newZone *dbstruct.Zone) (tasks []*dbstruct.TextAuditTask) {
tasks = make([]*dbstruct.TextAuditTask, 0)
if newZone.Profile != nil {
tasks = append(tasks, &dbstruct.TextAuditTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),
AssociativeDatabase: goproto.String("zone"),
AssociativeTableName: goproto.String("zone"),
AssociativeTableId: newZone.Id,
AssociativeTableColumn: goproto.String("profile"),
AuditedText: newZone.Profile,
OldText: goproto.String(""),
})
}
addTextAuditTasks(ctx, tasks, true)
return
}
func addTextAuditTasks(ctx *gin.Context, tasks []*dbstruct.TextAuditTask, options ...any) error {
for _, task := range tasks {
err := addTextAuditTask(ctx, task, options...)

View File

@ -7,6 +7,7 @@ import (
momentproto "service/api/proto/moment/proto"
streamerproto "service/api/proto/streamer/proto"
streamerauthapprovaldetailsproto "service/api/proto/streamerauthapprovaldetails/proto"
zoneproto "service/api/proto/zone/proto"
zonemomentproto "service/api/proto/zonemoment/proto"
"service/bizcommon/util"
"service/dbstruct"
@ -44,6 +45,7 @@ func (handler *TextAuditTaskResultHandler) initTextAuditTaskUpdateFuncGeneratorM
handler.generateZoneMomentTextUpdateFunc()
handler.generateStreamerAuthApprovalDetailsBioUpdateFunc()
handler.generateStreamerAuthApprovalDetailsAutoResponseMessageUpdateFunc()
handler.generateZoneProfileUpdateFunc()
}
func (handler *TextAuditTaskResultHandler) getTextAuditTaskUpdateFunc(ctx *gin.Context, task *dbstruct.TextAuditTask, option int) func() error {
@ -223,6 +225,24 @@ func (handler *TextAuditTaskResultHandler) generateZoneMomentTextUpdateFunc() {
}
}
// 空间表->简介
func (handler *TextAuditTaskResultHandler) generateZoneProfileUpdateFunc() {
handler.textAuditTaskUpdateFuncGeneratorMap["zone|zone|profile"] = func(ctx *gin.Context, task *dbstruct.TextAuditTask, option int) func() error {
return func() error {
id := task.AssociativeTableId
auditcomp, reviewcomp, finalText := getTextUpdateInfo(task, option)
return _DefaultZone.OpUpdate(ctx, &zoneproto.OpUpdateReq{
Zone: &dbstruct.Zone{
Id: id,
Profile: finalText,
ProfileAudit: auditcomp,
ProfileReview: reviewcomp,
},
})
}
}
}
// 尝试完成审核
func tryToFinishTextAuditTaskOfMoment(ctx *gin.Context, task *dbstruct.TextAuditTask) error {
// 机审通过尝试触发moment_audit_task的人审

View File

@ -12,6 +12,8 @@ type Zone struct {
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
ProfileAudit *AuditComponent `json:"profile_audit" bson:"profile_audit"` // 空间简介审核
ProfileReview *AuditComponent `json:"profile_review" bson:"profile_review"` // 空间简介人审
}
func (p *Zone) GetId() int64 {