by Robin at 20241218

This commit is contained in:
Robin 2024-12-18 15:55:11 +08:00
parent 394f7226a0
commit a194bc0229
6 changed files with 64 additions and 4 deletions

View File

@ -39,9 +39,9 @@ const (
AudNotifTemp_StreamerDetailsApplied = 1732523345 // 提交完善资料材料
AudNotifTemp_StreamerDetailsPassed = 1732523346 // 运营后台审核通过完善资料
AudNotifTemp_StreamerDetailsRejected = 1732523347 // 运营后台审核写上备注并未通过完善资料
AudNotifTemp_WithdrawalInfoApplied = 1732523348 // 主播提交了申请提现相关的资料(todo)
AudNotifTemp_WithdrawalInfoPassed = 1732523349 // 运营后台操作了相关资料审核:通过
AudNotifTemp_WithdrawalInfoRejected = 1732523350 // 运营后台操作了相关资料审核:拒绝
AudNotifTemp_RealNameAuthenticationApplied = 1732523348 // 主播提交了申请提现相关的资料(todo)
AudNotifTemp_RealNameAuthenticationPassed = 1732523349 // 运营后台操作了相关资料审核:通过
AudNotifTemp_RealNameAuthenticationRejected = 1732523350 // 运营后台操作了相关资料审核:拒绝
AudNotifTemp_StreamerDirectlyUpdated = 1732523351 // 主播在编辑主页时,仅修改选项内容后提交
AudNotifTemp_BioChangeApplied = 1732523352 // 主播在编辑主页时,修改个性签名后提交
AudNotifTemp_BioPassed = 1732523353 // 运营审核通过【个性签名】

View File

@ -2043,6 +2043,9 @@ func (s *Service) ApiCreateRealNameAuthentication(ctx *gin.Context, req *realnam
ec = errcode.ErrCodeRealNameAuthenticationSrvFail
return
}
DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_RealNameAuthenticationApplied)(req.RealNameAuthentication)
return
}

View File

@ -146,3 +146,12 @@ func (p *RealNameAuthentication) OpListByMid(ctx *gin.Context, req *realname_aut
}
return realname_authentication, nil
}
func (p *RealNameAuthentication) GetByIds(ctx *gin.Context, ids []int64) ([]*dbstruct.RealNameAuthentication, error) {
list, err := p.store.GetRealNameAuthenticationListByIds(ctx, ids)
if err != nil {
logger.Error("GetRealNameAuthenticationListByIds fail, ids: %v, err: %v", ids, err)
return make([]*dbstruct.RealNameAuthentication, 0), err
}
return list, nil
}

View File

@ -68,6 +68,9 @@ func (handler *NotifBuilderHandler) init() {
handler.handleAudStreamerDetailsApplied()
handler.handleAudStreamerDetailsPassed()
handler.handleAudStreamerDetailsRejected()
handler.handleAudRealNameAuthenticationApplied()
handler.handleAudRealNameAuthenticationPassed()
handler.handleAudRealNameAuthenticationRejected()
handler.handleAudBioChangeApplied()
handler.handleAudBioPassed()
handler.handleAudBioRejected()
@ -349,6 +352,29 @@ func (handler *NotifBuilderHandler) handleAudStreamerDetailsRejected() {
}
}
func (handler *NotifBuilderHandler) handleAudRealNameAuthenticationApplied() {
handler.handlerMap[consts.AudNotifTemp_RealNameAuthenticationApplied] = func(ctx *gin.Context, args ...any) {
realNameAuthentication := args[0].(*dbstruct.RealNameAuthentication)
if realNameAuthentication != nil {
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_RealNameAuthenticationApplied, realNameAuthentication.GetMid())
}
}
}
func (handler *NotifBuilderHandler) handleAudRealNameAuthenticationPassed() {
handler.handlerMap[consts.AudNotifTemp_RealNameAuthenticationPassed] = func(ctx *gin.Context, args ...any) {
mid := args[0].(int64)
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_RealNameAuthenticationPassed, mid)
}
}
func (handler *NotifBuilderHandler) handleAudRealNameAuthenticationRejected() {
handler.handlerMap[consts.AudNotifTemp_RealNameAuthenticationRejected] = func(ctx *gin.Context, args ...any) {
mid := args[0].(int64)
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_RealNameAuthenticationRejected, mid)
}
}
func (handler *NotifBuilderHandler) handleAudBioChangeApplied() {
handler.handlerMap[consts.AudNotifTemp_BioChangeApplied] = func(ctx *gin.Context, args ...any) {
streamer := args[0].(*dbstruct.Streamer)

View File

@ -3135,6 +3135,13 @@ func (s *Service) OpApproveRealNameAuthentication(ctx *gin.Context, req *realnam
return
}
list, err := _DefaultRealNameAuthentication.GetByIds(ctx, req.Ids)
if err != nil {
logger.Error("GetByIds fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeRealNameAuthenticationSrvFail
return
}
//2.若是审批失败,则更新之后直接删除,审批失败的信息将流转到历史表里保存
if util.DerefInt64(req.ApproveStatus) == consts.RealNameAuthentication_Rejected {
err := _DefaultRealNameAuthentication.OpDeleteBatch(ctx, req.Ids)
@ -3143,9 +3150,18 @@ func (s *Service) OpApproveRealNameAuthentication(ctx *gin.Context, req *realnam
ec = errcode.ErrCodeRealNameAuthenticationSrvFail
return
}
for _, realnameauth := range list {
DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_RealNameAuthenticationRejected)(realnameauth.GetMid())
}
return
}
for _, realnameauth := range list {
DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_RealNameAuthenticationRejected)(realnameauth.GetMid())
}
return
}

View File

@ -12,5 +12,11 @@ type RealNameAuthentication struct {
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
}
func (p *RealNameAuthentication) GetMid() int64 {
if p != nil && p.Mid != nil {
return *p.Mid
}
return 0
}