实现游戏人生获取物品列表、兑换、领取奖品

This commit is contained in:
2025-06-19 21:00:13 +08:00
parent d920cff499
commit 31d2d056b4
4 changed files with 300 additions and 92 deletions

View File

@ -69,10 +69,160 @@ type UserRole struct {
type UserRoleListResponse struct {
RoleList []UserRole `json:"role_list"`
}
type QQNetbarActivityIn struct {
ServiceName string // 服务名称
TaskParam TaskParam // 参数体
UserRoleParam UserRoleParam
PopenId string
BindType int
type GiftParam struct {
TaskId string `json:"task_id"` // 任务ID必填
AreaId int `json:"area_id,omitempty"` // 区域ID
Gid int `json:"gid"` // 游戏ID必填
RoleIdx string `json:"roleIdx,omitempty"` // 角色ID
}
type GoodsParam struct {
Gid int `json:"gid"` // 游戏ID必填
AppFilter string `json:"appfilter"` // 按照gid过滤游戏
BigTime int64 `json:"big_time"` // 大时间:如果要控制时间范围,大的时间传这里,必填
Pageidx string `json:"pageidx"` // 页码, 首页为空
Num int `json:"num"` // 数量
OrderType string `json:"order_type"` // winningtime:根据获取时间排序 overduetime:根据过期时间排序
OrderByDesc bool `json:"orderby_desc"` // 降序
GoodsStatus int `json:"goodsstatus"` // 查询的物品状态0:查所有 2是已发放(成功和失败)4是未发放且未过期6是未发放且已过期
}
type GoodsResponse struct {
Waters []water `json:"waters"` // 兑换流水
PageIdx string `json:"pageidx"` // 下一页的页码
Total int64 `json:"total"` // 总数
}
type ExchangeGoodsParam struct {
Water water // 兑换流水
Gid int `json:"gid"` // 游戏ID必填
AreaId int `json:"area_id"` // 区服 id
ReloIdx string `json:"reloidx"` //FIXME
}
type ExchangeGoodsResponse struct {
Water water // 兑换流水
}
type QueryUserGoodsDetailParam struct {
Gid int `json:"gid"`
WinningTime int64 `json:"winningtime"` // 用户领取礼包时间
OrderId string `json:"orderid"` // 户领取流水订单id
IsActInfo int64 `json:"is_actinfo"` // 是否需要活动相关信息 0默认需要 1不需要
IsDocument int64 `json:"is_document"` // 是否需要文案信息,使用限制信息、代金券图片、使用方式 0默认需要 1:不需要
IsDetail int64 `json:"is_detail"` // 是否需要物品详情 0默认需要 1不需要
}
type QueryUserGoodsDetailResponse struct {
Water water // 兑换流水
}
type QQNetbarActivityIn struct {
ServiceName string // 服务名称
TaskParam TaskParam // 任务参数
UserRoleParam UserRoleParam // 查询用户角色
GiftParam GiftParam // 领取物品接口使用
GoodsParam GoodsParam // 查询物品列表接口使用
ExchangeGoodsParam ExchangeGoodsParam // 兑换物品接口使用
QueryUserGoodsDetailParam QueryUserGoodsDetailParam // 查询用户物品详情接口使用
PopenId string
BindType int
NickName string
}
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"` // 礼包列表数据
}

View File

@ -166,7 +166,9 @@ type UserUnBoundUrlOut struct {
}
type UserBoundInfoIn struct {
PopenId string
PopenId string
BindType int
AppName string
}
type UserBoundInfoOut struct {
IsBound bool