by Robin at 20240731

This commit is contained in:
Leufolium 2024-07-31 17:10:28 +08:00
parent 96325994ea
commit 2eb44b548f
1 changed files with 18 additions and 16 deletions

View File

@ -2151,7 +2151,7 @@ func (s *Service) OpGetStreamerAuthApprovalDetailsHisList(ctx *gin.Context, req
func (s *Service) OpApproveStreamerAuthApprovalDetails(ctx *gin.Context, req *streamerauthapprovaldetailsproto.OpApproveReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeStreamerAuthApprovalDetailsSrvOk
//1.查询获取这些认证申请,确认所有mid都是且只能是准主播
//1.查询获取这些认证申请
list, err := _DefaultStreamerAuthApprovalDetails.GetStreamerAuthApprovalDetailsListByIds(ctx, req.Ids)
if err != nil {
logger.Error("GetStreamerAuthApprovalDetailsListByIds fail, req: %v, err: %v", util.ToJson(req), err)
@ -2175,23 +2175,25 @@ func (s *Service) OpApproveStreamerAuthApprovalDetails(ctx *gin.Context, req *st
ec = errcode.ErrCodeAccountSrvFail
return
}
// 预填写主播账户表数据
// 如果是人审通过,则预填写主播账户表数据并确认所有mid都是且只能是准主播
streamerAccts := make([]*dbstruct.EsStreamerAcct, 0)
for _, acct := range accounts {
if acct.GetRole() != consts.StreamerToBe {
logger.Error("mid: %v is not a streamer-to-be, req: %v", acct.GetMid(), util.ToJson(req))
ec = errcode.ErrCodeStreamerAuthApprovalDetailsNotAStreamerToBe
return
if util.DerefInt64(req.ApproveStatus) == consts.StreamerAuthApprovalDetailsApprove_Passed {
for _, acct := range accounts {
if acct.GetRole() != consts.StreamerToBe {
logger.Error("mid: %v is not a streamer-to-be, req: %v", acct.GetMid(), util.ToJson(req))
ec = errcode.ErrCodeStreamerAuthApprovalDetailsNotAStreamerToBe
return
}
streamerAccts = append(streamerAccts, &dbstruct.EsStreamerAcct{
Mid: acct.GetMid(),
Name: acct.GetName(),
UserIdString: acct.GetUserIdString(),
PinYin: strings.Join(pinyin.LazyConvert(acct.GetName(), nil), ""),
Ct: acct.GetCt(),
Ut: acct.GetUt(),
DelFlag: acct.GetDelFlag(),
})
}
streamerAccts = append(streamerAccts, &dbstruct.EsStreamerAcct{
Mid: acct.GetMid(),
Name: acct.GetName(),
UserIdString: acct.GetUserIdString(),
PinYin: strings.Join(pinyin.LazyConvert(acct.GetName(), nil), ""),
Ct: acct.GetCt(),
Ut: acct.GetUt(),
DelFlag: acct.GetDelFlag(),
})
}
//2.更新状态