实现用户领取任务接口、用户任务记录接口
This commit is contained in:
@ -11,12 +11,13 @@ import (
|
||||
|
||||
// RewardTypes is the golang structure of table reward_types for DAO operations like Where/Data.
|
||||
type RewardTypes struct {
|
||||
g.Meta `orm:"table:reward_types, do:true"`
|
||||
Id interface{} // 奖励类型ID
|
||||
Name interface{} // 类型名称
|
||||
Code interface{} // 唯一编码
|
||||
IconUrl interface{} // 图标链接地址
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间
|
||||
g.Meta `orm:"table:reward_types, do:true"`
|
||||
Id interface{} // 奖励类型ID
|
||||
Name interface{} // 类型名称
|
||||
Code interface{} // 唯一编码
|
||||
IconUrl interface{} // 图标链接地址
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间
|
||||
TencentTypeId interface{} // 腾讯类型 id
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ type RewardWaters struct {
|
||||
g.Meta `orm:"table:reward_waters, do:true"`
|
||||
Id interface{} //
|
||||
OrderId interface{} // 订单号
|
||||
Uid interface{} // 用户账号
|
||||
Recvuid interface{} // 用户账号
|
||||
TaskId interface{} // 任务 id
|
||||
Water interface{} // 兑换流水
|
||||
Status interface{} // 兑换状态 1:奖励发放成功 2:奖励兑换失败(礼包发放背包环节成功,需重新引导领奖) 3:针对只需要发背包,然后引导用户到人生应用背包领奖的奖励类型,发奖成功了 4:water错误(一般是 orderid),不做兑换操作
|
||||
|
||||
@ -10,11 +10,12 @@ import (
|
||||
|
||||
// RewardTypes is the golang structure for table reward_types.
|
||||
type RewardTypes struct {
|
||||
Id int64 `json:"id" orm:"id" description:"奖励类型ID"` // 奖励类型ID
|
||||
Name string `json:"name" orm:"name" description:"类型名称"` // 类型名称
|
||||
Code string `json:"code" orm:"code" description:"唯一编码"` // 唯一编码
|
||||
IconUrl string `json:"iconUrl" orm:"icon_url" description:"图标链接地址"` // 图标链接地址
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间"` // 软删除时间
|
||||
Id int64 `json:"id" orm:"id" description:"奖励类型ID"` // 奖励类型ID
|
||||
Name string `json:"name" orm:"name" description:"类型名称"` // 类型名称
|
||||
Code string `json:"code" orm:"code" description:"唯一编码"` // 唯一编码
|
||||
IconUrl string `json:"iconUrl" orm:"icon_url" description:"图标链接地址"` // 图标链接地址
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间"` // 软删除时间
|
||||
TencentTypeId int `json:"tencentTypeId" orm:"tencent_type_id" description:"腾讯类型 id"` // 腾讯类型 id
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ import (
|
||||
type RewardWaters struct {
|
||||
Id int64 `json:"id" orm:"id" description:""` //
|
||||
OrderId string `json:"orderId" orm:"order_id" description:"订单号"` // 订单号
|
||||
Uid string `json:"uid" orm:"uid" description:"用户账号"` // 用户账号
|
||||
Recvuid string `json:"recvuid" orm:"recvuid" description:"用户账号"` // 用户账号
|
||||
TaskId string `json:"taskId" orm:"task_id" description:"任务 id"` // 任务 id
|
||||
Water string `json:"water" orm:"water" description:"兑换流水"` // 兑换流水
|
||||
Status int64 `json:"status" orm:"status" description:"兑换状态 1:奖励发放成功 2:奖励兑换失败(礼包发放背包环节成功,需重新引导领奖) 3:针对只需要发背包,然后引导用户到人生应用背包领奖的奖励类型,发奖成功了 4:water错误(一般是 orderid),不做兑换操作"` // 兑换状态 1:奖励发放成功 2:奖励兑换失败(礼包发放背包环节成功,需重新引导领奖) 3:针对只需要发背包,然后引导用户到人生应用背包领奖的奖励类型,发奖成功了 4:water错误(一般是 orderid),不做兑换操作
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// Reward 奖励表
|
||||
type Reward struct {
|
||||
g.Meta `orm:"table:rewards"`
|
||||
Id int64 `json:"id" orm:"id" description:"奖励ID"` // 奖励ID
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店ID,系统奖励为NULL"` // 门店ID,系统奖励为NULL
|
||||
Name string `json:"name" orm:"name" description:"奖励名称"` // 奖励名称
|
||||
|
||||
@ -10,7 +10,7 @@ type UserTask struct {
|
||||
Id int64 `json:"id" orm:"id" description:"用户任务唯一标识符"` // 用户任务唯一标识符
|
||||
UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID
|
||||
TaskId string `json:"taskId" orm:"task_id" description:"腾讯任务ID"` // 腾讯任务ID
|
||||
Status int `json:"status" orm:"status" description:"任务状态:1=进行中,2=已完成中,3=未完成"` // 任务状态:1=进行中,2=已完成中,3=未完成
|
||||
Status int `json:"status" orm:"status" description:"任务状态:1=进行中,2=已完成中,3=未完成"` // 任务状态:1=进行中(显示领取按钮),2=已完成
|
||||
SerialNumber string `json:"serialNumber" orm:"serial_number" description:"流水号,确保用户任务唯一性"` // 流水号,确保用户任务唯一性
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
@ -19,11 +19,34 @@ type UserTask struct {
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店 id"` // 门店 id
|
||||
TaskName string `json:"taskName" orm:"task_name" description:"任务名称"` // 任务名称
|
||||
GameId int64 `json:"gameId" orm:"game_id" description:"游戏 id"` // 游戏 id
|
||||
User User `json:"user" orm:"with:id=user_id"`
|
||||
Game Game `json:"game" orm:"with:game_id=game_id"`
|
||||
User User `json:"user,omitempty" orm:"with:id=user_id"`
|
||||
Game Game `json:"game,omitempty" orm:"with:game_id=game_id"`
|
||||
// Store Store `json:"store" orm:"with:id=store_id"`
|
||||
}
|
||||
|
||||
type TaskReward struct {
|
||||
g.Meta `orm:"table:task_rewards"`
|
||||
TaskId string `json:"-" orm:"task_id"`
|
||||
RewardId int64 `json:"-" orm:"reward_id"`
|
||||
Rewards Reward `json:"reward" orm:"with:id=reward_id"`
|
||||
}
|
||||
|
||||
type UserTask2 struct {
|
||||
Id int64 `json:"id" orm:"id" description:"用户任务唯一标识符"` // 用户任务唯一标识符
|
||||
UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID
|
||||
TaskId string `json:"taskId" orm:"task_id" description:"腾讯任务ID"` // 腾讯任务ID
|
||||
Status int `json:"status" orm:"status" description:"任务状态:1=进行中,2=已完成中,3=未完成"` // 任务状态:1=进行中(显示领取按钮),2=已完成
|
||||
SerialNumber string `json:"serialNumber" orm:"serial_number" description:"流水号,确保用户任务唯一性"` // 流水号,确保用户任务唯一性
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
CompletedAt *gtime.Time `json:"completedAt" orm:"completed_at" description:"任务完成时间"` // 任务完成时间
|
||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店 id"` // 门店 id
|
||||
TaskName string `json:"taskName" orm:"task_name" description:"任务名称"` // 任务名称
|
||||
GameId int64 `json:"gameId" orm:"game_id" description:"游戏 id"` // 游戏 id
|
||||
TaskRewards []TaskReward `json:"taskRewards" orm:"with:task_id=task_id"`
|
||||
}
|
||||
|
||||
// UserTaskRankingIn 任务排行榜入参
|
||||
type UserTaskRankingIn struct {
|
||||
Page int
|
||||
@ -80,6 +103,6 @@ type UserTaskRecordsListIn struct {
|
||||
}
|
||||
|
||||
type UserTaskRecordsListOut struct {
|
||||
List []UserTask
|
||||
List []UserTask2
|
||||
Total int
|
||||
}
|
||||
|
||||
24
internal/model/userTaskReward.go
Normal file
24
internal/model/userTaskReward.go
Normal file
@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import "github.com/gogf/gf/v2/os/gtime"
|
||||
|
||||
type GetUserClaimListIn struct {
|
||||
UserId int64
|
||||
TaskId string
|
||||
NetbarAccount string
|
||||
StoreId int64
|
||||
}
|
||||
type UserTaskReward struct {
|
||||
RewardName string `json:"rewardName" orm:"reward_name"` // 奖励名称冗余字段
|
||||
Source int `json:"source" orm:"source"` // 奖励来源,1是系统奖励统一调用, 2是门店奖励
|
||||
RewardType int `json:"rewardType" orm:"reward_type"` // 奖励类型, 实现不同的领取操作
|
||||
Status int `json:"status" orm:"status"` // 状态:1=待用户完成任务,2=待领取,3=已领取, 待兑换,4=已过期,5=发放失败, 6=结束、
|
||||
ExpireType int `json:"expireType" orm:"expire_type"` // 过期方式:1=时间段过期,2=领取后过期
|
||||
ValidFrom *gtime.Time `json:"validFrom" orm:"valid_from" ` // 有效期开始时间(expire_type=1时)
|
||||
ValidTo *gtime.Time `json:"validTo" orm:"valid_to"` // 有效期结束时间(expire_type=1时)
|
||||
ExpireDays int `json:"expireDays" orm:"expire_days"` // 领取后多少天过期(expire_type=2时)
|
||||
}
|
||||
type GetUserClaimListOut struct {
|
||||
List []Reward
|
||||
Total int
|
||||
}
|
||||
Reference in New Issue
Block a user