From f03f172a8d85dd95c019cbc0c9e82e9d04cce1a8 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 11 Jul 2024 14:53:43 +0800 Subject: [PATCH] by Robin at 20240711 --- app/mix/dao/mongo.go | 4 ++-- app/mix/service/apiservice_business_validation.go | 2 ++ app/mix/service/logic/streamerauthapproval_basic.go | 1 + app/mix/service/logic/streamerauthapproval_details.go | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/mix/dao/mongo.go b/app/mix/dao/mongo.go index 89a1b828..5fdaa491 100644 --- a/app/mix/dao/mongo.go +++ b/app/mix/dao/mongo.go @@ -2471,7 +2471,7 @@ func (m *Mongo) GetStreamerAuthApprovalBasicHisList(ctx *gin.Context, req *strea list := make([]*dbstruct.StreamerAuthApprovalBasic, 0) col := m.getColStreamerAuthApprovalBasicHis() query := qmgo.M{ - "del_flag": 0, + "del_flag": consts.Deleted, } if req.ApproveStatus != nil { query["approve_status"] = util.DerefInt64(req.ApproveStatus) @@ -2488,7 +2488,7 @@ func (m *Mongo) GetStreamerAuthApprovalBasicHisListByMid(ctx *gin.Context, req * list := make([]*dbstruct.StreamerAuthApprovalBasic, 0) col := m.getColStreamerAuthApprovalBasicHis() query := qmgo.M{ - "del_flag": 0, + "del_flag": consts.Deleted, } if req.ApproveStatus != nil { query["approve_status"] = util.DerefInt64(req.ApproveStatus) diff --git a/app/mix/service/apiservice_business_validation.go b/app/mix/service/apiservice_business_validation.go index c5785a08..689ab4f3 100644 --- a/app/mix/service/apiservice_business_validation.go +++ b/app/mix/service/apiservice_business_validation.go @@ -484,6 +484,8 @@ func (s *Service) ApiCreateStreamerAuthApprovalBasicBusinessValidate(ctx *gin.Co ec = errcode.ErrCodeStreamerAuthApprovalSrvOk result := businessvalidator.NewAuthBusinessValidator(ctx, req). + QueryAccount(_DefaultAccount.OpListByMid). + EnsureIsThisRole(consts.Streamer). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalBasic.Avatar). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalBasic.AccountShot). Validate(). diff --git a/app/mix/service/logic/streamerauthapproval_basic.go b/app/mix/service/logic/streamerauthapproval_basic.go index 91c83a8d..6147bf50 100644 --- a/app/mix/service/logic/streamerauthapproval_basic.go +++ b/app/mix/service/logic/streamerauthapproval_basic.go @@ -102,6 +102,7 @@ func (p *StreamerAuthApprovalBasic) OpDeleteBatch(ctx *gin.Context, ids []int64) //2.原有审核申请标记删除后转存到历史表 for _, streamerauthapprovalbasic := range list { streamerauthapprovalbasic.DelFlag = goproto.Int64(consts.Deleted) + streamerauthapprovalbasic.ApproveStatus = goproto.Int64(consts.StreamerAuthApprovalBasicApprove_Rejected) } err = p.store.CreateBatchStreamerAuthApprovalBasicHis(ctx, list) if err != nil { diff --git a/app/mix/service/logic/streamerauthapproval_details.go b/app/mix/service/logic/streamerauthapproval_details.go index 46052edb..c83dc72c 100644 --- a/app/mix/service/logic/streamerauthapproval_details.go +++ b/app/mix/service/logic/streamerauthapproval_details.go @@ -134,6 +134,8 @@ func (p *StreamerAuthApprovalDetails) OpDeleteBatchByMids(ctx *gin.Context, mids //2.原有审核申请标记删除后转存到历史表 for _, streamerauthapprovaldetails := range list { streamerauthapprovaldetails.DelFlag = goproto.Int64(consts.Deleted) + streamerauthapprovaldetails.ApproveStatus = goproto.Int64(consts.StreamerAuthApprovalDetailsApprove_Rejected) + streamerauthapprovaldetails.Status = goproto.Int64(consts.StreamerAuthApprovalDetails_Rejected) } err = p.store.CreateBatchStreamerAuthApprovalDetailsHis(ctx, list) if err != nil {