feat: 广告激励(效果图加次/体验会员,服务端限频防刷)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
commonHttp "slogan-agent/common"
|
||||
"slogan-agent/styleagent/model/dto"
|
||||
"slogan-agent/styleagent/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type ad struct{}
|
||||
|
||||
var Ad = new(ad)
|
||||
|
||||
// RewardClaim 领取广告激励(限频:effect_extra 每日 2 次 / vip_trial 每日 1 次)
|
||||
func (c *ad) RewardClaim(ctx context.Context, req *dto.AdRewardClaimReq) (res *dto.AdRewardClaimRes, err error) {
|
||||
result, err := service.AdService.Claim(ctx, commonHttp.GetUserId(g.RequestFromCtx(ctx)), req.AdType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dto.AdRewardClaimRes{Reward: &dto.AdRewardInfo{
|
||||
AdType: result.AdType, RemainingToday: result.RemainingToday,
|
||||
}}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user