Files
arenax-server/api/reward/v1/reward.go

280 lines
15 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package v1
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
type ListReq struct {
g.Meta `path:"/reward" method:"get" tags:"Reward" summary:"(系统、商户、门店后台)获取奖励列表"`
Name string `json:"name" dc:"名称"`
Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"每页数量"`
Status int `json:"status" dc:"状态"`
StoreId int64 `json:"storeId" dc:"门店ID"`
RewardTypeId int64 `json:"rewardTypeId" dc:"奖励类型ID"`
}
type ListRes struct {
List interface{} `json:"list" dc:"奖励列表"`
Total int `json:"total" dc:"总数"`
}
type CreateReq struct {
g.Meta `path:"/reward" method:"post" tags:"Reward" summary:"(系统、商户、门店后台)创建奖励"`
StoreId int64 `json:"storeId" dc:"门店ID"`
Name string `json:"name" v:"required#名称不能为空" dc:"名称"`
RewardTypeId int64 `json:"rewardTypeId" v:"required#奖励类型ID不能为空" dc:"奖励类型ID"`
GameId int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"`
RewardImg string `json:"rewardImg" dc:"奖励图片"`
QQGoodsId string `json:"qqGoodsId" v:"required#不能为空" dc:"QQ网吧物品ID"`
QQGoodsIdStr string `json:"qqGoodsIdStr" v:"required#不能为空" dc:"QQ网吧物品ID字符串"`
Status int `json:"status" dc:"状态" d:"1启用 2禁用"`
ExpireType int `json:"expireType" v:"required#过期类型只能为1或2" dc:"过期类型"`
ValidFrom *gtime.Time `json:"validFrom" dc:"有效开始时间expire_type=1 时使用)"`
ValidTo *gtime.Time `json:"validTo" dc:"有效结束时间expire_type=1 时使用)"`
ExpireDays int `json:"expireDays" dc:"领取后多少天过期"`
DailyTotalLimit int `json:"dailyTotalLimit" v:"required#每日领取总次数限制" dc:"每日领取总次数限制"`
TotalLimit int `json:"totalLimit" v:"required#奖励总限不能为空" dc:"领取总次数限制"`
UserDailyLimit int `json:"userDailyLimit" v:"required#用户每日领取总次数限制" dc:"用户每日领取总次数限制"`
UserTotalLimit int `json:"userTotalLimit" v:"required#用户领取总次数限制" dc:"用户领取总次数限制"`
GrantQuantify int `json:"grantQuantify" dc:"发放数量"`
Source int `json:"source" v:"required#来源不能为空" dc:"来源" d:"1"`
}
type CreateRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type UpdateReq struct {
g.Meta `path:"/reward" method:"put" tags:"Reward" summary:"(系统、商户、门店后台)更新奖励"`
Id int64 `json:"id" v:"required#id不能为空" dc:"ID"`
Name string `json:"name" dc:"名称"`
RewardType int `json:"rewardType" dc:"奖励类型"`
GameId int64 `json:"gameId" dc:"游戏id"`
Img string `json:"img" dc:"图片"`
QQGoodsId string `json:"qqGoodsId" dc:"qq商品id"`
QQGoodsIdStr string `json:"qqGoodsIdStr" dc:"qq商品id"`
Status int `json:"status" dc:"状态" d:"1"`
ExpireType int `json:"expireType" dc:"过期类型" d:"1"`
ValidFrom *gtime.Time `json:"validFrom" dc:"有效开始时间expire_type=1 时使用)"`
ValidTo *gtime.Time `json:"validTo" dc:"有效结束时间expire_type=1 时使用)"`
ExpireDays int `json:"expireDays" dc:"领取后多少天过期"`
DailyTotalLimit int `json:"dailyTotalLimit" dc:"每日领取总次数限制"`
TotalLimit int `json:"totalLimit" dc:"领取总次数限制"`
UserDailyLimit int `json:"userDailyLimit" dc:"用户每日领取总次数限制"`
UserTotalLimit int `json:"userTotalLimit" dc:"用户领取总次数限制"`
GrantQuantify int `json:"grantQuantify" dc:"发放数量"`
Source int `json:"source" v:"required#来源不能为空" dc:"来源" d:"1"`
}
type UpdateRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type DeleteReq struct {
g.Meta `path:"/reward/{id}" method:"delete" tags:"Reward" summary:"(系统、商户、门店后台)删除奖励"`
Id int64 `in:"path" json:"id" v:"required#ID不能为空" dc:"ID"`
Source int `json:"source" v:"required#来源不能为空" dc:"来源" d:"1"`
}
type DeleteRes struct {
Success bool `json:"success" dc:"是否成功"`
}
// GiftResponse Water 外部--
type GiftResponse struct {
GiftItem GiftItem `json:"rst_list"`
}
type GameRoleInfo struct {
// FIXME
}
type userAddress struct {
// FIXME
}
type WaterExtraInfo struct {
// FIXME
}
type GoodsType struct {
// FIXME
}
type GoodsDisplayType struct {
// FIXME
}
type MerchantInfo struct {
// FIXME
}
type GoodsExtraInfo struct {
// FIXME
}
type Water struct {
Uid string `json:"uid"` // 用户id
UidType uint32 `json:"uidtype"` // 用户id的类型(0是openid,1是uin)
WinningTime uint32 `json:"winningtime"` // 获奖时间
GoodsId uint32 `json:"goodsid"` // 物品id
GoodsCfg GoodsCfg `json:"goodscfg"` // 物品配置置信息
Gid uint32 `json:"gid"` // 活动id领取的游戏渠道
OverdueTime uint32 `json:"overduetime"` // 物品的过期时间
Status uint32 `json:"status"` // 领取状态: 0未发放1已发放2是已发放且失败(失败)4是未发放且未过期6物品已过期未发放
RecvUid string `json:"recvuid"` // 领奖的用户 id (qq号)
Role GameRoleInfo `json:"role"` // 游戏角色信息
CdKey string `json:"cdkey"` // cdkey实物的兑换码/游戏道具兑换码
WaterType uint32 `json:"watertype"` // 抽奖流水类型, 0是抽奖1是核销2是 tgp
SrcType uint32 `json:"srctype"` // 抽奖来源类型id
SrcName string `json:"srcname"` // 抽奖来源类型名称
ActId string `json:"actid"` // 活动id
LotteryId uint32 `json:"lotteryid"` // 抽奖区id
GiftId uint32 `json:"giftid"` // 礼包id
ShopId uint32 `json:"shopid"` // 门店id
Extra string `json:"extra"` // 线下O2O相关信息
RecvTime uint32 `json:"recvtime"` // 领取时间
Code string `json:"code"` // 核销码
TransEq string `json:"traneq"` // 交易流水号
Filter1 string `json:"filter1"` // 用于筛选流水记录的业务自定义条件1
Filter2 string `json:"filter2"` // 用于筛选流水记录的业务自定义条件2
UserAddrType uint32 `json:"useraddrtype"` // 用户地址类型 (1是默认地址, 2是用户确认后地址)——仅面向邮寄的物品使用
UserAddr userAddress `json:"useraddr"` // 用户地址信息——仅面向类型的物品使用
Cltip string `json:"cltip"` // 用户领奖ip
Bsave uint32 `json:"bsave"` // 是否保存到物品表
SaveType uint32 `json:"savetype"` // 0表示用户积分流水 1表示用户物品表2表示折扣券
Sid uint32 `json:"sid"` // 用户流水id和uid1共同确定一个物品
NeedPoints uint32 `json:"needpoints"` // 物品消耗的钱
ExtraInfo WaterExtraInfo `json:"extrainfo"` // 其余信息
AppFilter string `json:"appfilter"` // 业务拓展数据,王者人生为空
OrderId string `json:"orderid"` // 订单id唯一标记一条流水
MercId string `json:"mercid"` // 商家 id
TipOpenId string `json:"tipopenid"` // 游戏人生openid
GoodsIdStr string `json:"goods_id_str"` // 字符串类型Goods id
GiftIdStr string `json:"gift_id_str"` // 字符串类型Gift id
LottIdStr string `json:"lott_id_str"` // 字符串类型Lott id
}
type GoodsCfg struct {
GoodsId uint32 `json:"goodsid"` // 物品id
Gid uint32 `json:"gid"` // 游戏id
GoodsType GoodsType `json:"goodstype"` // 物品类型
Maid string `json:"maid"` // ma单号
Each uint32 `json:"each"` // 每次发奖的数量
GoodsName string `json:"goodsname"` // 物品名称
GoodsDetail string `json:"goodsdetail"` // 物品说明信息
OverdueTime uint32 `json:"overduetime"` // 物品的过期时间
Status uint32 `json:"status"` // 物品状态 0-下线 1-上线
GoodsIcon string `json:"goodsicon"` // 物品图片地址
Provider string `json:"provider"` // 物品提供方名称
RecvWay string `json:"recvway"` // 领取方式
RecvWayUrl string `json:"recvwayurl"` // 领取方式详情url
MailUrl string `json:"mailurl"` // 邮寄地址url
DisplayType GoodsDisplayType `json:"displaytype"` // 物品展示类型(枚举或自定义类型)
Merchant MerchantInfo `json:"merchant"` // 商家信息(需另外定义)
Extra GoodsExtraInfo `json:"extra"` // 其它信息(需另外定义)
GoodsIdStr string `json:"goods_id_str"` // 字符串类型的物品ID
AppId string `json:"app_id"` // 所属业务ID
ActId string `json:"act_id"` // 活动ID
}
type GiftItem struct {
Result int `json:"result"` // 1-奖励发放成功2-奖励兑换失败(礼包发放背包环节成功,需要重新引导领奖) 3-针对只需要发背包,然后引导用户到人生应用背包领奖的奖励类型,发奖成功了 4-water错误一般是orderid不做兑换操作
Water Water `json:"water"` // 礼包列表数据
}
type CallbackReq struct {
g.Meta `path:"/reward/callback" method:"post" tags:"Reward" summary:"(tencent)回调"`
Uid string `json:"uid" v:"required#用户id不能为空" dc:"用户id"`
OrderId string `json:"order_id" v:"required#流水订单id不能为空" dc:"用户领取流水订单"`
PrizeChannelId string `json:"prize_channel_id" v:"required#奖品渠道id不能为空" dc:"奖品渠道id"`
PrizeId string `json:"prize_id"`
PrizeType uint32 `json:"prize_type"`
PrizeSubType uint32 `json:"prize_sub_type"`
Num uint32 `json:"num"`
CustomInfo string `json:"custom_info"`
}
type CallbackData struct {
PrizeCode string `json:"prize_code"`
Comment string `json:"comment"`
}
type CallbackRes struct {
Errcode int32 `json:"errcode"`
Errmsg string `json:"errmsg"`
AppId string `json:"appid"`
OrderId string `json:"order_id"`
Datas []CallbackData `json:"data"`
}
type GetLiftReq struct {
g.Meta `path:"/reward/getLift" method:"post" tags:"Reward" summary:"(tencent)奖励领取"`
TaskId string `json:"taskId" v:"required#任务id不能为空" dc:"任务Id"`
AreaId int64 `json:"areaId" dc:"大区Id"`
GameId int64 `json:"gameId" v:"required#游戏id不能为空" dc:"游戏Id"`
RoleIdx string `json:"roleIdx" dc:"角色索引"`
RewradType []int64 `json:"rewardType" dc:"奖励类型"`
PopenId string `json:"popenid" dc:""`
}
type GetLiftRes struct {
List interface{} `json:"list" dc:"物品列表"`
Result int64 `json:"result" dc:"1-奖励发放成功2-奖励兑换失败礼包发放背包环节成功需要重新引导领奖3-针对只需要发背包然后引导用户到人生应用背包领奖的奖励类型发奖成功了4-water错误一般是orderid不做兑换操作"`
Water Water `json:"water" dc:"礼包列表"`
}
type GetGoodsListReq struct {
g.Meta `path:"/reward/goods" method:"get" tags:"Reward" summary:"(tencent)获取物品列表"`
Appfilter string `json:"appfilter" dc:"按照gid过滤游戏"`
BigTime int64 `json:"bigTime" v:"required#大时间不能为空" dc:"大时间:如果要控制时间范围,大的时间传这里"`
Pageidx string `json:"pageidx" dc:"分页索引"`
Num int64 `json:"num" v:"required#数量不能为空" dc:"数量"`
OrderType string `json:"orderType" dc:"winningtime:根据获取时间排序 overduetime:根据过期时间排序"`
OrderbyDesc int64 `json:"orderbDesc" dc:"1降序 2:升序"`
Goodsstatus int64 `json:"Goodsstatus" dc:"查询的物品状态0:查所有 2是已发放(成功和失败)4是未发放且未过期6是未发放且已过期"`
BindType int `json:"bindType" v:"required#绑定类型不能为空" dc:"绑定类型"`
}
type GetGoodsListRes struct {
List interface{} `json:"list" dc:"物品列表"`
Pageidx string `json:"pageidx" dc:"分页索引"`
Total int64 `json:"total" dc:"总数"`
}
type GetGoodsReq struct {
g.Meta `path:"/reward/getGoods" method:"post" tags:"Reward" summary:"物品兑换"`
Water Water `json:"water" v:"required#物品流水从背包列表获取的water透传回来water类型参考GetGift接口的water结构" dc:"礼包列表"`
AreaId int64 `json:"areaId" dc:"大区Id"`
GameId int64 `json:"gid" v:"required#游戏id不能为空" dc:"游戏Id"`
RoleIdx string `json:"roleIdx" dc:"角色索引"`
}
type GetGoodsRes struct {
Water Water `json:"water" dc:"用户领取物品流水记录"`
}
type GetGoodsDetailsReq struct {
g.Meta `path:"/reward/goodsDetails" method:"post" tags:"Reward" summary:"(PC)物品详情"`
Winningtime int64 `json:"winningtime" dc:"用户领取礼包时间"`
Orderid string `json:"orderid" v:"required#流水订单id不能为空" dc:"用户领取流水订单id"`
IsActinfo int64 `json:"IsActinfo" dc:"是否需要活动相关信息 0默认需要 1不需要"`
IsDocument int64 `json:"isDocument" dc:"是否需要文案信息,使用限制信息、代金券图片、使用方式 0默认需要 1:不需要"`
IsDetail int64 `json:"isDetail" dc:"是否需要物品详情 0默认需要 1不需要"`
PopenId string `json:"popenId" v:"required#popenId不能为空" dc:"popenId不能为空"`
Gid int `json:"gid" v:"required#游戏id不能为空" dc:"游戏Id"`
}
type GetGoodsDetailsRes struct {
Water interface{} `json:"water" dc:"流水信息"`
}
type OperateTaskRewardReq struct {
g.Meta `path:"/reward/taskReward" method:"post" tags:"Reward" summary:"添加任务奖励"`
Type int `json:"type" v:"required#操作类型只能为1或2,1是添加、2是删除" dc:"操作类型"`
TaskId int64 `json:"taskId" v:"required#任务id不能为空" dc:"任务Id"`
RewardId int64 `json:"rewardId" v:"required#奖励id不能为空" dc:"奖励Id"`
}
type OperateTaskRewardRes struct {
Success bool `json:"success" dc:"是否成功"`
}