查询当前登录用户排名,
This commit is contained in:
@ -12,9 +12,10 @@ import (
|
||||
// Games is the golang structure of table games for DAO operations like Where/Data.
|
||||
type Games struct {
|
||||
g.Meta `orm:"table:games, do:true"`
|
||||
Id interface{} //
|
||||
GameId interface{} // 腾讯游戏 id
|
||||
GameName interface{} // 游戏名称
|
||||
GameaCode interface{} // 游戏代号
|
||||
GameCode interface{} // 游戏代号
|
||||
Avatar interface{} // 图标
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
|
||||
@ -21,4 +21,5 @@ type UserTasks struct {
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
CompletedAt *gtime.Time // 任务完成时间
|
||||
DeletedAt *gtime.Time // 软删除时间戳
|
||||
StoreId interface{} // 门店 id
|
||||
}
|
||||
|
||||
@ -10,9 +10,10 @@ import (
|
||||
|
||||
// Games is the golang structure for table games.
|
||||
type Games struct {
|
||||
Id int64 `json:"id" orm:"id" description:""` //
|
||||
GameId int64 `json:"gameId" orm:"game_id" description:"腾讯游戏 id"` // 腾讯游戏 id
|
||||
GameName string `json:"gameName" orm:"game_name" description:"游戏名称"` // 游戏名称
|
||||
GameaCode string `json:"gameaCode" orm:"gamea_code" description:"游戏代号"` // 游戏代号
|
||||
GameCode string `json:"gameCode" orm:"game_code" description:"游戏代号"` // 游戏代号
|
||||
Avatar string `json:"avatar" orm:"avatar" description:"图标"` // 图标
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
|
||||
@ -19,4 +19,5 @@ type UserTasks struct {
|
||||
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
|
||||
}
|
||||
|
||||
57
internal/model/game.go
Normal file
57
internal/model/game.go
Normal file
@ -0,0 +1,57 @@
|
||||
package model
|
||||
|
||||
type Game struct {
|
||||
GameId int64 `json:"gameId" orm:"game_id"` // 腾讯游戏 id
|
||||
GameName string `json:"gameName" orm:"game_name"` // 游戏名称
|
||||
GameCode string `json:"gameCode" orm:"game_code"` // 游戏代号
|
||||
Avatar string `json:"avatar" orm:"avatar"` // 图标
|
||||
}
|
||||
|
||||
// GameListIn 游戏列表入参
|
||||
type GameListIn struct {
|
||||
Page int `json:"page"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
// GameListOut 游戏列表出参
|
||||
type GameListOut struct {
|
||||
List interface{} `json:"list" dc:"游戏列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// AddGameIn 新增游戏入参
|
||||
type AddGameIn struct {
|
||||
GameName string `json:"gameName"`
|
||||
GameCode string `json:"gameCode"`
|
||||
Avatar string `json:"avatar"`
|
||||
GameId int64 `json:"gameId"`
|
||||
}
|
||||
|
||||
// AddGameOut 新增游戏出参
|
||||
type AddGameOut struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// UpdateGameIn 更新游戏入参
|
||||
type UpdateGameIn struct {
|
||||
GameName string `json:"gameName"`
|
||||
GameCode string `json:"gameCode"`
|
||||
Avatar string `json:"avatar"`
|
||||
GameId int64 `json:"gameId"`
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
|
||||
// UpdateGameOut 更新游戏出参
|
||||
type UpdateGameOut struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// DeleteGameIn 删除游戏入参
|
||||
type DeleteGameIn struct {
|
||||
Id int64 `json:"Id"`
|
||||
}
|
||||
|
||||
// DeleteGameOut 删除游戏出参
|
||||
type DeleteGameOut struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
48
internal/model/userTask.go
Normal file
48
internal/model/userTask.go
Normal file
@ -0,0 +1,48 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type UserTaskRanking struct {
|
||||
g.Meta `orm:"table:task"`
|
||||
Id int `orm:"column:id" json:"id"` //
|
||||
UserId int `orm:"column:user_id" json:"userId"` // 用户 id
|
||||
TaskId int `orm:"column:task_id" json:"taskId"` // 任务 id
|
||||
Status int `orm:"column:status" json:"status"` // 状态 1:待完成 2:完成
|
||||
SerialNumber string `orm:"column:serial_number" json:"serialNumber"` // 流水号
|
||||
StoreId int `orm:"column:store_id" json:"storeId"` // 门店 id
|
||||
CreatedAt *gtime.Time `orm:"column:created_at" json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `orm:"column:updated_at" json:"updatedAt"`
|
||||
CompletedAT *gtime.Time `orm:"column:completed_at" json:"completedAt"`
|
||||
DeletedAt *gtime.Time `orm:"column:deleted_at" json:"deletedAt"`
|
||||
}
|
||||
|
||||
// UserTaskRankingIn 任务排行榜入参
|
||||
type UserTaskRankingIn struct {
|
||||
Page int
|
||||
Size int
|
||||
StoreId int
|
||||
Type int // 排行榜类型 1:日 2:周 3:月
|
||||
OperatorId int
|
||||
}
|
||||
|
||||
// UserTaskRankingOut 用户排行榜出参
|
||||
type UserTaskRankingOut struct {
|
||||
List []UserTaskRankingArgs
|
||||
Total int
|
||||
CompletedDay int
|
||||
RankingDay int
|
||||
}
|
||||
|
||||
type UserTaskRankingArgs struct {
|
||||
UserName string `orm:"username" json:"username"`
|
||||
Avatar string `orm:"avatar" json:"avatar"`
|
||||
Total int `orm:"num" json:"num"`
|
||||
}
|
||||
|
||||
type LoginUserRanking struct {
|
||||
UserId int `orm:"user_id" json:"user_id"`
|
||||
Num int `orm:"num" json:"num"`
|
||||
}
|
||||
Reference in New Issue
Block a user