Merge branch 'feat-cjy-report' into dev
This commit is contained in:
commit
451fe4b2e2
@ -55,7 +55,7 @@ func AnalysisRouter(r *gin.RouterGroup) {
|
||||
analysisAppRoute := r.Group("app/analysis")
|
||||
analysisAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||
{
|
||||
analysisAppRoute.POST("list", serviceCast.ListWorkAnalysis) // 作品列表
|
||||
analysisAppRoute.POST("list", serviceCast.ListWorkAnalysisForApp) // 作品列表
|
||||
analysisAppRoute.POST("detail", serviceCast.GetWorkAnalysis) // 作品分析详情
|
||||
analysisAppRoute.POST("update-status", serviceCast.UpdateWorkAnalysisStatus) // 用户确认
|
||||
analysisAppRoute.POST("check-balance", serviceCast.CheckBundleBalance) // 检查套餐余量
|
||||
@ -67,7 +67,7 @@ func AnalysisRouter(r *gin.RouterGroup) {
|
||||
competitiveReportAppRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||
{
|
||||
competitiveReportAppRoute.POST("detail", serviceCast.GetCompetitiveReportForApp) // 获取竞品报告详情(App端)
|
||||
competitiveReportAppRoute.POST("list", serviceCast.ListCompetitiveReportByArtistUuid) // 根据艺人UUID获取竞品报告列表(App端)
|
||||
competitiveReportAppRoute.POST("list", serviceCast.ListReportByArtistUuidForApp) // 根据艺人UUID获取竞品报告列表(App端)
|
||||
competitiveReportAppRoute.POST("update-status", serviceCast.UpdateCompetitiveReportStatus) // 更新竞品报告状态(App端)
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,6 +144,41 @@ func ListWorkAnalysis(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// ListWorkAnalysis 获取作品分析列表
|
||||
func ListWorkAnalysisForApp(ctx *gin.Context) {
|
||||
var req *cast.ListWorkAnalysisReq
|
||||
var err error
|
||||
if err = ctx.ShouldBind(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
newCtx := NewCtxWithUserInfo(ctx)
|
||||
loginInfo := login.GetUserInfoFromC(ctx)
|
||||
// 查询用户套餐有没有过期
|
||||
balanceInfoRes, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{
|
||||
UserId: int32(loginInfo.ID),
|
||||
})
|
||||
if err != nil {
|
||||
zap.L().Error("ListWorkAnalysisForApp GetBundleBalanceByUserId", zap.Any("err", err))
|
||||
service.Error(ctx, errors.New(common.GetUserBalanceFailed))
|
||||
return
|
||||
}
|
||||
// 套餐未过期的话,传入 subNum ,只获取该套餐的有效期内数据
|
||||
if balanceInfoRes.BundleStatus == common.BundleNotExpired {
|
||||
zap.L().Info("ListWorkAnalysisForApp BundleNotExpired", zap.Any("loginInfo", loginInfo))
|
||||
req.SubNum = loginInfo.SubNum
|
||||
}
|
||||
resp, err := service.CastProvider.ListWorkAnalysis(newCtx, req)
|
||||
if err != nil {
|
||||
zap.L().Error("ListWorkAnalysisForApp ListWorkAnalysis", zap.Any("err", err))
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
// RefreshWorkAnalysisApproval(ctx, resp.Data)
|
||||
service.Success(ctx, resp)
|
||||
return
|
||||
}
|
||||
|
||||
// RefreshWorkAnalysisApproval 刷新作品分析审批状态
|
||||
func RefreshWorkAnalysisApproval(ctx *gin.Context, data []*cast.WorkAnalysisInfo) {
|
||||
if len(data) > 0 {
|
||||
|
||||
@ -659,6 +659,46 @@ func ListCompetitiveReportByArtistUuid(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// ListReportByArtistUuidForApp 根据艺人UUID获取竞品报告列表(必须传ArtistUuid)
|
||||
func ListReportByArtistUuidForApp(ctx *gin.Context) {
|
||||
var req *cast.ListCompetitiveReportReq
|
||||
var err error
|
||||
if err = ctx.ShouldBind(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
// 验证ArtistUuid必须存在
|
||||
if req.ArtistUuid == "" {
|
||||
service.Error(ctx, errors.New("ArtistUuid不能为空"))
|
||||
return
|
||||
}
|
||||
|
||||
newCtx := NewCtxWithUserInfo(ctx)
|
||||
loginInfo := login.GetUserInfoFromC(ctx)
|
||||
// 查询用户套餐有没有过期
|
||||
balanceInfoRes, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{
|
||||
UserId: int32(loginInfo.ID),
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, errors.New(common.GetUserBalanceFailed))
|
||||
return
|
||||
}
|
||||
// 套餐未过期的话,传入 subNum ,只获取该套餐的有效期内数据
|
||||
if balanceInfoRes.BundleStatus == common.BundleNotExpired {
|
||||
zap.L().Info("ListReportByArtistUuidForApp BundleNotExpired", zap.Any("loginInfo", loginInfo))
|
||||
req.SubNum = loginInfo.SubNum
|
||||
}
|
||||
|
||||
resp, err := service.CastProvider.ListCompetitiveReport(newCtx, req)
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
// RefreshCompetitiveReportApproval(ctx, resp.Data)
|
||||
service.Success(ctx, resp)
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteCompetitiveReport 删除竞品报告
|
||||
func DeleteCompetitiveReport(ctx *gin.Context) {
|
||||
var req *cast.DeleteCompetitiveReportReq
|
||||
|
||||
Loading…
Reference in New Issue
Block a user