This commit is contained in:
Leufolium 2024-07-17 08:44:26 +08:00
parent 3af5833d73
commit 88074a9b19
2 changed files with 44 additions and 23 deletions

View File

@ -1067,30 +1067,32 @@ func (s *Service) ApiUpdateStreamer(ctx *gin.Context, req *streamerproto.ApiUpda
// 创建审核任务
s.CreateUpdateStreamerImageAudit(ctx, oldStreamer, req.Streamer)
s.CreateUpdateStreamerTextAudit(ctx, oldStreamer, req.Streamer)
s.CreateUpdateStreamerVideoModeration(ctx, oldStreamer, req.Streamer)
//执行更新
if err := _DefaultStreamer.OpUpdate(ctx, &streamerproto.OpUpdateReq{
Streamer: &dbstruct.Streamer{
Mid: req.Streamer.Mid,
Gender: req.Streamer.Gender,
Bio: req.Streamer.Bio,
Cover: req.Streamer.Cover,
Shorts: req.Streamer.Shorts,
Album: req.Streamer.Album,
Age: req.Streamer.Age,
Height: req.Streamer.Height,
Weight: req.Streamer.Weight,
Constellation: req.Streamer.Constellation,
City: req.Streamer.City,
Tag: req.Streamer.Tag,
Fans: req.Streamer.Fans,
AutoResponseMessage: req.Streamer.AutoResponseMessage,
},
}); err != nil {
logger.Error("OpUpdate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeStreamerSrvFail
return
}
// 逻辑变更为先审后发,此处不再做更新
// 执行更新
// if err := _DefaultStreamer.OpUpdate(ctx, &streamerproto.OpUpdateReq{
// Streamer: &dbstruct.Streamer{
// Mid: req.Streamer.Mid,
// Gender: req.Streamer.Gender,
// Bio: req.Streamer.Bio,
// Cover: req.Streamer.Cover,
// Shorts: req.Streamer.Shorts,
// Album: req.Streamer.Album,
// Age: req.Streamer.Age,
// Height: req.Streamer.Height,
// Weight: req.Streamer.Weight,
// Constellation: req.Streamer.Constellation,
// City: req.Streamer.City,
// Tag: req.Streamer.Tag,
// Fans: req.Streamer.Fans,
// AutoResponseMessage: req.Streamer.AutoResponseMessage,
// },
// }); err != nil {
// logger.Error("OpUpdate fail, req: %v, err: %v", util.ToJson(req), err)
// ec = errcode.ErrCodeStreamerSrvFail
// return
// }
// 更新user_vas
err = _DefaultVas.UpdateWechat(ctx, &vasproto.UpdateWechatReq{
BaseRequest: base.BaseRequest{

View File

@ -13,6 +13,25 @@ import (
goproto "google.golang.org/protobuf/proto"
)
func (s *Service) CreateUpdateStreamerVideoModeration(ctx *gin.Context, oldStreamer *dbstruct.Streamer, newStreamer *dbstruct.Streamer) (tasks []*dbstruct.VideoModerationTask) {
if newStreamer.Shorts != nil && !util.IsInt64SliceEqualAsSet(oldStreamer.Shorts.GetVideoIds(), newStreamer.Shorts.GetVideoIds()) {
tasks = append(tasks, &dbstruct.VideoModerationTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),
AssociativeDatabase: goproto.String("streamer"),
AssociativeTableName: goproto.String("streamer"),
AssociativeTableId: oldStreamer.Mid,
AssociativeTableColumn: goproto.String("shorts"),
AuditedMedia: newStreamer.Shorts,
OldMedia: oldStreamer.Shorts,
})
}
addVideoModerationTasks(ctx, tasks)
return
}
func (s *Service) CreateMomentVideoModeration(ctx *gin.Context, newMoment *dbstruct.Moment) (tasks []*dbstruct.VideoModerationTask) {
if newMoment.MediaComp != nil && len(newMoment.MediaComp.GetVideoIds()) > 0 {