Merge branch 'feature-streamer_nick_audit-wxy-20241209' into test

This commit is contained in:
wangxinyu 2024-12-11 17:34:05 +08:00
commit 3dc691906a
2 changed files with 14 additions and 5 deletions

View File

@ -387,12 +387,14 @@ func (s *Service) ApiUpdateAccount(ctx *gin.Context, req *accountproto.ApiUpdate
}
// 主播昵称需要先过审核
if oldAccount.GetRole() == consts.Streamer && oldAccount.Name != req.Account.Name {
opUpdateReq.NewName = req.Account.Name
auditStatus := s.SetAuditStatusBitMap(opUpdateReq.GetAuditStatus(), consts.StreamNikeAudit, consts.StreamerNikeNameAuditReject)
if oldAccount.GetRole() == consts.Streamer && oldAccount.GetName() != req.Account.GetName() {
opUpdateReq.NewName = goproto.String(req.Account.GetName())
auditStatus := s.SetAuditStatusBitMap(opUpdateReq.GetAuditStatus(), consts.StreamNikeAudit, consts.StreamerNikeNameAuditing)
opUpdateReq.AuditStatus = goproto.Int64(auditStatus)
// TODO:wxy, 测试日志
logger.Info("ApiUpdateAccount test log, NewName: %v, auditStatus: %v", opUpdateReq.NewName, opUpdateReq.GetAuditStatus())
} else {
opUpdateReq.Name = req.Account.Name
opUpdateReq.Name = goproto.String(req.Account.GetName())
}
// 用户只允许修改昵称和头像
@ -441,7 +443,7 @@ func (s *Service) ApiGetAccountListByMid(ctx *gin.Context, req *accountproto.Api
nameFlag := s.GetAuditStatusBitMap(account.GetAuditStatus(), consts.StreamNikeAudit)
if account.GetRole() == consts.Streamer && nameFlag == consts.StreamerNikeNameAuditing {
account.Name = account.NewName
account.Name = goproto.String(account.GetName())
}
vo = &accountproto.ApiListVO{}

View File

@ -48,6 +48,13 @@ func (p *Account) GetName() string {
return *p.Name
}
func (p *Account) GetNewName() string {
if p == nil || p.NewName == nil {
return ""
}
return *p.NewName
}
func (p *Account) GetUserId() int64 {
if p == nil || p.UserId == nil {
return 0