by Robin at 20240702

This commit is contained in:
Leufolium 2024-07-02 08:37:56 +08:00
parent dc184f040e
commit f25164c742
1 changed files with 11 additions and 13 deletions

View File

@ -2082,13 +2082,11 @@ func (s *Service) OpApproveStreamerAuthApprovalDetails(ctx *gin.Context, req *st
//4.若是审批通过将审批表的信息合并进主播表并更新account表里的角色信息主播
if util.DerefInt64(req.ApproveStatus) == consts.StreamerAuthApprovalDetailsApprove_Passed {
// 构建streamer信息
streamerList := make([]*dbstruct.Streamer, len(list))
midList := make([]int64, len(list))
for i, streamerAuthApprovalDetails := range list {
mid := streamerAuthApprovalDetails.GetMid()
midList[i] = mid
streamerList[i] = &dbstruct.Streamer{
streamer := &dbstruct.Streamer{
Mid: streamerAuthApprovalDetails.Mid,
Cover: streamerAuthApprovalDetails.Cover,
Shorts: streamerAuthApprovalDetails.Shorts,
@ -2116,17 +2114,17 @@ func (s *Service) OpApproveStreamerAuthApprovalDetails(ctx *gin.Context, req *st
logger.Error("UpdateWechat fail, mid: %v, err: %v", err)
return
}
}
// 更新主播表
err = _DefaultStreamer.OpUpdateBatch(ctx, &streamerproto.OpCreateBatchReq{
BaseRequest: req.BaseRequest,
Streamers: streamerList,
})
if err != nil {
logger.Error("OpUpdateBatch fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeStreamerAuthApprovalDetailsSrvFail
return
// 更新主播表
err = _DefaultStreamer.OpUpdate(ctx, &streamerproto.OpUpdateReq{
BaseRequest: req.BaseRequest,
Streamer: streamer,
})
if err != nil {
logger.Error("OpUpdate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeStreamerAuthApprovalDetailsSrvFail
return
}
}
// 更新account表里的角色信息为主播