Merge pull request 'feat-IRONFANS-148-Robin' (#614) from feat-IRONFANS-148-Robin into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/614
This commit is contained in:
chenhao 2024-07-11 15:38:45 +08:00
commit 13b1a9972f
4 changed files with 11 additions and 9 deletions

View File

@ -487,7 +487,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().
@ -504,6 +504,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).

View File

@ -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 {

View File

@ -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,8 +134,9 @@ 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)
streamerauthapprovaldetails.Status = goproto.Int64(status)
streamerauthapprovaldetails.ApproveStatus = goproto.Int64(approveStatus)
streamerauthapprovaldetails.Remarks = goproto.String(remarks)
}
err = p.store.CreateBatchStreamerAuthApprovalDetailsHis(ctx, list)
if err != nil {

View File

@ -1964,12 +1964,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-通过
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
}
@ -2015,7 +2015,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