157 lines
7.9 KiB
Go
157 lines
7.9 KiB
Go
package model
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/frame/g"
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
)
|
||
|
||
type UserTask struct {
|
||
g.Meta `orm:"table:task"`
|
||
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
|
||
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"`
|
||
UserTimes int64 `json:"userTimes" orm:"user_times" description:"用户完成次数"` // 用户完成次数
|
||
}
|
||
|
||
type TaskReward struct {
|
||
g.Meta `orm:"table:task_rewards"`
|
||
TaskId string `json:"-" orm:"task_id"`
|
||
RewardId int64 `json:"-" orm:"reward_id"`
|
||
Rewards SimpleReward `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
|
||
RewardName string `json:"rewardName" orm:"reward_name" description:"奖励名称冗余字段"`
|
||
//TaskRewards []TaskReward `json:"taskRewards" orm:"with:task_id=task_id"`
|
||
}
|
||
|
||
type UserTaskRecord struct {
|
||
g.Meta `orm:"table:user_tasks"`
|
||
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=已完成
|
||
//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 UserInfo `json:"user,omitempty" orm:"with:id=user_id"`
|
||
Game GameInfo `json:"game,omitempty" orm:"with:game_id=game_id"`
|
||
CompletedAt *gtime.Time `json:"completedAt" orm:"completed_at" description:"任务完成时间"` // 任务完成时间
|
||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||
// Store Store `json:"store" orm:"with:id=store_id"`
|
||
UserTimes int64 `json:"userTimes" orm:"user_times" description:"用户完成次数"` // 用户完成次数
|
||
}
|
||
|
||
type UserInfo struct {
|
||
g.Meta `orm:"table:users"`
|
||
Id int64 `json:"id" orm:"id,primary"` // 用户ID
|
||
Username string `json:"username" orm:"username,not null"` // 用户名
|
||
Nickname string `json:"nickname" orm:"nickname"` // 昵称
|
||
}
|
||
|
||
type GameInfo struct {
|
||
g.Meta `orm:"table:games"`
|
||
GameId int64 `json:"gameId" orm:"game_id"` // 腾讯游戏 id
|
||
GameName string `json:"gameName" orm:"game_name"` // 游戏名称
|
||
GameCode string `json:"gameCode" orm:"game_code"` // 游戏代号
|
||
Id int64 `json:"id" orm:"id"`
|
||
}
|
||
|
||
// UserTaskRankingIn 任务排行榜入参
|
||
type UserTaskRankingIn struct {
|
||
Page int
|
||
Size int
|
||
StoreId int
|
||
NetBarAccount string
|
||
Type int // 排行榜类型 1:日 2:周 3:月
|
||
OperatorId int
|
||
}
|
||
|
||
// UserTaskRankingOut 用户排行榜出参
|
||
type UserTaskRankingOut struct {
|
||
List []UserTaskRankingArgs
|
||
Total int
|
||
CompletedNum int
|
||
RankingNum int
|
||
}
|
||
|
||
type UserTaskRankingArgs struct {
|
||
UserName string `orm:"username" json:"username"`
|
||
Avatar string `orm:"avatar" json:"avatar"`
|
||
Total int `orm:"num" json:"num"`
|
||
NickName string `orm:"nickname" json:"nickname"`
|
||
}
|
||
|
||
type LoginUserRanking struct {
|
||
UserName string `orm:"username" json:"username"`
|
||
Num int `orm:"num" json:"num"`
|
||
}
|
||
|
||
type LoginUserRankingNum struct {
|
||
Num int `orm:"num" json:"num"`
|
||
}
|
||
|
||
// GetTaskIn 添加任务记录入参
|
||
type GetTaskIn struct {
|
||
TaskId string `json:"taskId"`
|
||
StoreId int `json:"storeId"`
|
||
NetBarAccount string `json:"netBarAccount"`
|
||
UserId int `json:"userId"`
|
||
TaskName string `json:"taskName"`
|
||
GameId int `json:"gid"`
|
||
TaskType int `json:"taskType"`
|
||
UserTimes int `json:"userTimes"`
|
||
BindType int `json:"bindType"`
|
||
}
|
||
|
||
type GetTaskOut struct {
|
||
Success bool `json:"success"`
|
||
}
|
||
|
||
type UserTaskRecordsListIn struct {
|
||
UserId int
|
||
Page int
|
||
Size int
|
||
StoreId int
|
||
NetBarAccount string
|
||
RewardTypeId int
|
||
TimeType int
|
||
GameId int
|
||
BindType int
|
||
}
|
||
|
||
type UserTaskRecordsListOut struct {
|
||
List []UserTask2
|
||
Total int
|
||
}
|
||
|
||
type SyncTaskIn struct {
|
||
}
|
||
type SyncTaskOut struct {
|
||
Success bool `json:"success"`
|
||
}
|