From b2b2f9df38f2a4d4d71868e3cfe4936300305cf0 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 11 Jul 2024 15:01:02 +0800 Subject: [PATCH 1/3] 1 --- app/mix/service/logic/streamerauthapproval_basic.go | 1 - app/mix/service/logic/streamerauthapproval_details.go | 2 -- app/mix/service/service.go | 6 +++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/mix/service/logic/streamerauthapproval_basic.go b/app/mix/service/logic/streamerauthapproval_basic.go index 6147bf50..91c83a8d 100644 --- a/app/mix/service/logic/streamerauthapproval_basic.go +++ b/app/mix/service/logic/streamerauthapproval_basic.go @@ -102,7 +102,6 @@ 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 c83dc72c..46052edb 100644 --- a/app/mix/service/logic/streamerauthapproval_details.go +++ b/app/mix/service/logic/streamerauthapproval_details.go @@ -134,8 +134,6 @@ 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 { diff --git a/app/mix/service/service.go b/app/mix/service/service.go index c5d95e2e..7252140c 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -1957,12 +1957,12 @@ func (s *Service) OpGetStreamerAuthApprovalBasicHisList(ctx *gin.Context, req *s func (s *Service) OpApproveStreamerAuthApprovalBasic(ctx *gin.Context, req *streamerauthapprovalbasicproto.OpApproveReq) (ec errcode.ErrCode) { ec = errcode.ErrCodeStreamerAuthApprovalBasicSrvOk - //状态流转:0-等待复审 → 3-跟进中,3-跟进中 → 1-通过/2-拒绝 + //状态流转:0-等待复审 → 3-跟进中/2-拒绝,3-跟进中 → 1-通过/2-拒绝 destApproveStatus := util.DerefInt64(req.ApproveStatus) currentApproveStatus := int64(-1) - if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Approving { + if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Approving || destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Rejected { currentApproveStatus = consts.StreamerAuthApprovalBasicApprove_Waiting - } else if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Passed || destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Rejected { + } else if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Passed { currentApproveStatus = consts.StreamerAuthApprovalBasicApprove_Approving } From 2af8e89b0d0a810fc22b443c9880dc70d8be1af1 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 11 Jul 2024 15:07:10 +0800 Subject: [PATCH 2/3] 1 --- app/mix/service/logic/streamerauthapproval_details.go | 5 ++++- app/mix/service/service.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/mix/service/logic/streamerauthapproval_details.go b/app/mix/service/logic/streamerauthapproval_details.go index 46052edb..024bd906 100644 --- a/app/mix/service/logic/streamerauthapproval_details.go +++ b/app/mix/service/logic/streamerauthapproval_details.go @@ -119,7 +119,7 @@ func (p *StreamerAuthApprovalDetails) OpDeleteBatch(ctx *gin.Context, ids []int6 return nil } -func (p *StreamerAuthApprovalDetails) OpDeleteBatchByMids(ctx *gin.Context, mids []int64) error { +func (p *StreamerAuthApprovalDetails) OpDeleteBatchByMids(ctx *gin.Context, mids []int64, status int64, approveStatus int64, remarks string) error { //1.查出原有审核申请 list, err := p.store.GetStreamerAuthApprovalDetailsListByMids(ctx, mids) @@ -134,6 +134,9 @@ func (p *StreamerAuthApprovalDetails) OpDeleteBatchByMids(ctx *gin.Context, mids //2.原有审核申请标记删除后转存到历史表 for _, streamerauthapprovaldetails := range list { streamerauthapprovaldetails.DelFlag = goproto.Int64(consts.Deleted) + streamerauthapprovaldetails.Status = goproto.Int64(status) + streamerauthapprovaldetails.ApproveStatus = goproto.Int64(approveStatus) + streamerauthapprovaldetails.Remarks = goproto.String(remarks) } err = p.store.CreateBatchStreamerAuthApprovalDetailsHis(ctx, list) if err != nil { diff --git a/app/mix/service/service.go b/app/mix/service/service.go index 7252140c..1aa65dea 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -1957,7 +1957,7 @@ func (s *Service) OpGetStreamerAuthApprovalBasicHisList(ctx *gin.Context, req *s func (s *Service) OpApproveStreamerAuthApprovalBasic(ctx *gin.Context, req *streamerauthapprovalbasicproto.OpApproveReq) (ec errcode.ErrCode) { ec = errcode.ErrCodeStreamerAuthApprovalBasicSrvOk - //状态流转:0-等待复审 → 3-跟进中/2-拒绝,3-跟进中 → 1-通过/2-拒绝 + //状态流转:0-等待复审 → 3-跟进中/2-拒绝,3-跟进中 → 1-通过 destApproveStatus := util.DerefInt64(req.ApproveStatus) currentApproveStatus := int64(-1) if destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Approving || destApproveStatus == consts.StreamerAuthApprovalBasicApprove_Rejected { @@ -2008,7 +2008,7 @@ func (s *Service) OpApproveStreamerAuthApprovalBasic(ctx *gin.Context, req *stre for _, basic := range list { mids = append(mids, basic.GetMid()) } - err = _DefaultStreamerAuthApprovalDetails.OpDeleteBatchByMids(ctx, mids) + err = _DefaultStreamerAuthApprovalDetails.OpDeleteBatchByMids(ctx, mids, consts.StreamerAuthApprovalDetails_Rejected, consts.StreamerAuthApprovalDetailsApprove_Rejected, util.DerefString(req.Remarks)) if err != nil { logger.Error("_DefaultStreamerAuthApprovalDetails OpDeleteBatchByMids fail, req: %v, err: %v", util.ToJson(req), err) ec = errcode.ErrCodeStreamerAuthApprovalDetailsSrvFail From f9924cb7cbdb93f99ecf31ff0645a8e5765893cb Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 11 Jul 2024 15:37:39 +0800 Subject: [PATCH 3/3] 1 --- app/mix/service/apiservice_business_validation.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/mix/service/apiservice_business_validation.go b/app/mix/service/apiservice_business_validation.go index 689ab4f3..8d70a41b 100644 --- a/app/mix/service/apiservice_business_validation.go +++ b/app/mix/service/apiservice_business_validation.go @@ -485,7 +485,7 @@ func (s *Service) ApiCreateStreamerAuthApprovalBasicBusinessValidate(ctx *gin.Co result := businessvalidator.NewAuthBusinessValidator(ctx, req). QueryAccount(_DefaultAccount.OpListByMid). - EnsureIsThisRole(consts.Streamer). + EnsureIsNotThisRole(consts.Streamer). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalBasic.Avatar). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalBasic.AccountShot). Validate(). @@ -502,6 +502,8 @@ func (s *Service) ApiCreateStreamerAuthApprovalDetailsBusinessValidate(ctx *gin. ec = errcode.ErrCodeStreamerAuthApprovalSrvOk result := businessvalidator.NewAuthBusinessValidator(ctx, req). + QueryAccount(_DefaultAccount.OpListByMid). + EnsureIsNotThisRole(consts.Streamer). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalDetails.Cover). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalDetails.Shorts). EnsureMediaIsSuccessfullyUploaded(req.StreamerAuthApprovalDetails.Album).