fix: h5艺人确认增加校验
This commit is contained in:
parent
89bf59d878
commit
ffdc047d15
@ -399,7 +399,29 @@ func UpdateCompetitiveReportStatus(ctx *gin.Context) {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
userInfo := login.GetUserInfoFromC(ctx)
|
||||
newCtx := NewCtxWithUserInfo(ctx)
|
||||
resp, err := service.CastProvider.GetCompetitiveReport(context.Background(), &cast.GetCompetitiveReportDetailReq{
|
||||
Uuid: req.Uuid,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
artistID, _ := strconv.ParseUint(resp.ArtistID, 10, 64)
|
||||
if artistID != uint64(userInfo.ID) {
|
||||
service.Error(ctx, errors.New("非本人竞品报告,无法操作"))
|
||||
return
|
||||
}
|
||||
// 判断 work_action 是否为 1 或 2
|
||||
if req.WorkAction != 1 && req.WorkAction != 6 {
|
||||
service.Error(ctx, errors.New("非法操作"))
|
||||
return
|
||||
}
|
||||
if req.ConfirmStatus != 1 && req.ConfirmStatus != 2 {
|
||||
service.Error(ctx, errors.New("非法操作"))
|
||||
return
|
||||
}
|
||||
_, err = service.CastProvider.UpdateCompetitiveReportStatus(newCtx, req)
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user