feat:减少前端需要传的字段

This commit is contained in:
cjy 2026-01-13 16:40:25 +08:00
parent 145935ba04
commit fbf24995b8

View File

@ -34,6 +34,32 @@ func CreateCompetitiveReport(ctx *gin.Context) {
} }
newCtx := NewCtxWithUserInfo(ctx) newCtx := NewCtxWithUserInfo(ctx)
artistID, _ := strconv.ParseUint(req.ArtistID, 10, 64) artistID, _ := strconv.ParseUint(req.ArtistID, 10, 64)
// 通过接口查询艺人信息,自动填充艺人名字、手机号等信息
var infoResp *accountFiee.UserInfoResponse
if config.AppConfig.System.AppMode != "dev" {
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistID,
Domain: "app",
})
zap.L().Info("CreateCompetitiveReport", zap.Any("infoResp", infoResp))
if err != nil {
service.Error(ctx, err)
return
}
} else {
infoResp = &accountFiee.UserInfoResponse{
Name: "小波",
TelNum: "18288888888",
SubNum: "FE00000",
}
}
// 填充艺人信息到请求中
req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum
req.SubNum = infoResp.SubNum
if _, err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeCompetitiveValue); err != nil { if _, err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeCompetitiveValue); err != nil {
if err != nil && err.Error() == e.ErrorBalanceInsufficient { if err != nil && err.Error() == e.ErrorBalanceInsufficient {
service.Error(ctx, errors.New("该艺人竞品报告可用次数为0")) service.Error(ctx, errors.New("该艺人竞品报告可用次数为0"))