新增游戏绑定方式,修改任务排行
This commit is contained in:
@ -16,11 +16,12 @@ type ListRes struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CreateReq struct {
|
type CreateReq struct {
|
||||||
g.Meta `path:"/game" method:"post" tags:"Game" summary:"(系统)创建游戏"`
|
g.Meta `path:"/game" method:"post" tags:"Game" summary:"(系统)创建游戏"`
|
||||||
GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"`
|
GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"`
|
||||||
GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"`
|
GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"`
|
||||||
GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"`
|
GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"`
|
||||||
Avatar string `json:"avatar" dc:"游戏图标"`
|
Avatar string `json:"avatar" dc:"游戏图标"`
|
||||||
|
BoundType int64 `json:"boundType" v:"required#绑定类型不能为空" dc:"绑定类型"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRes struct {
|
type CreateRes struct {
|
||||||
@ -28,12 +29,13 @@ type CreateRes struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UpdateReq struct {
|
type UpdateReq struct {
|
||||||
g.Meta `path:"/game" method:"put" tags:"Game" summary:"(系统)更新游戏"`
|
g.Meta `path:"/game" method:"put" tags:"Game" summary:"(系统)更新游戏"`
|
||||||
GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"`
|
GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"`
|
||||||
GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"`
|
GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"`
|
||||||
GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"`
|
GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"`
|
||||||
Avatar string `json:"avatar" dc:"游戏图标"`
|
Avatar string `json:"avatar" dc:"游戏图标"`
|
||||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||||
|
BoundType int64 `json:"boundType" v:"required#绑定类型不能为空" dc:"绑定类型"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateRes struct {
|
type UpdateRes struct {
|
||||||
|
|||||||
@ -11,10 +11,11 @@ import (
|
|||||||
func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) {
|
func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) {
|
||||||
|
|
||||||
out, err := service.Game().CreateGame(ctx, &model.AddGameIn{
|
out, err := service.Game().CreateGame(ctx, &model.AddGameIn{
|
||||||
Avatar: req.Avatar,
|
Avatar: req.Avatar,
|
||||||
GameCode: req.GameCode,
|
GameCode: req.GameCode,
|
||||||
GameId: req.GameID,
|
GameId: req.GameID,
|
||||||
GameName: req.GameName,
|
GameName: req.GameName,
|
||||||
|
BoundType: req.BoundType,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -13,7 +13,14 @@ func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListR
|
|||||||
fromCtx := g.RequestFromCtx(ctx)
|
fromCtx := g.RequestFromCtx(ctx)
|
||||||
operatorId := fromCtx.GetCtxVar("id").Int64()
|
operatorId := fromCtx.GetCtxVar("id").Int64()
|
||||||
operatorRole := fromCtx.GetCtxVar("role").String()
|
operatorRole := fromCtx.GetCtxVar("role").String()
|
||||||
out, err := service.Reward().List(ctx, &model.RewardListIn{Page: req.Page, Size: req.Size, OperatorId: operatorId, OperatorRole: operatorRole, StoreId: req.StoreId})
|
out, err := service.Reward().List(ctx, &model.RewardListIn{Page: req.Page,
|
||||||
|
Size: req.Size,
|
||||||
|
OperatorId: operatorId,
|
||||||
|
OperatorRole: operatorRole,
|
||||||
|
StoreId: req.StoreId,
|
||||||
|
Name: req.Name,
|
||||||
|
Status: req.Status,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ type GamesColumns struct {
|
|||||||
CreatedAt string // 创建时间
|
CreatedAt string // 创建时间
|
||||||
UpdatedAt string // 更新时间
|
UpdatedAt string // 更新时间
|
||||||
DeletedAt string // 删除时间
|
DeletedAt string // 删除时间
|
||||||
|
BoundType string // 1:qq绑定 2:wx绑定 3:all
|
||||||
}
|
}
|
||||||
|
|
||||||
// gamesColumns holds the columns for the table games.
|
// gamesColumns holds the columns for the table games.
|
||||||
@ -41,6 +42,7 @@ var gamesColumns = GamesColumns{
|
|||||||
CreatedAt: "created_at",
|
CreatedAt: "created_at",
|
||||||
UpdatedAt: "updated_at",
|
UpdatedAt: "updated_at",
|
||||||
DeletedAt: "deleted_at",
|
DeletedAt: "deleted_at",
|
||||||
|
BoundType: "bound_type",
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGamesDao creates and returns a new DAO object for table data access.
|
// NewGamesDao creates and returns a new DAO object for table data access.
|
||||||
|
|||||||
@ -32,6 +32,8 @@ type RewardsColumns struct {
|
|||||||
CreatedAt string // 创建时间
|
CreatedAt string // 创建时间
|
||||||
UpdatedAt string // 更新时间
|
UpdatedAt string // 更新时间
|
||||||
DeletedAt string // 软删除时间戳
|
DeletedAt string // 软删除时间戳
|
||||||
|
TotalNum string // 奖励总数量,NULL表示不限量
|
||||||
|
UsedNum string // 已使用数量
|
||||||
}
|
}
|
||||||
|
|
||||||
// rewardsColumns holds the columns for the table rewards.
|
// rewardsColumns holds the columns for the table rewards.
|
||||||
@ -47,6 +49,8 @@ var rewardsColumns = RewardsColumns{
|
|||||||
CreatedAt: "created_at",
|
CreatedAt: "created_at",
|
||||||
UpdatedAt: "updated_at",
|
UpdatedAt: "updated_at",
|
||||||
DeletedAt: "deleted_at",
|
DeletedAt: "deleted_at",
|
||||||
|
TotalNum: "total_num",
|
||||||
|
UsedNum: "used_num",
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRewardsDao creates and returns a new DAO object for table data access.
|
// NewRewardsDao creates and returns a new DAO object for table data access.
|
||||||
|
|||||||
@ -25,8 +25,6 @@ type StoreTaskRewardsColumns struct {
|
|||||||
TaskId string // 门店任务ID
|
TaskId string // 门店任务ID
|
||||||
RewardId string // 奖励ID
|
RewardId string // 奖励ID
|
||||||
StoreId string // 门店ID
|
StoreId string // 门店ID
|
||||||
Quantity string // 奖励数量(如发放多少个奖励)
|
|
||||||
Status string // 状态:1=正常,0=禁用
|
|
||||||
CreatedAt string // 创建时间
|
CreatedAt string // 创建时间
|
||||||
UpdatedAt string // 更新时间
|
UpdatedAt string // 更新时间
|
||||||
DeletedAt string // 软删除时间戳
|
DeletedAt string // 软删除时间戳
|
||||||
@ -38,8 +36,6 @@ var storeTaskRewardsColumns = StoreTaskRewardsColumns{
|
|||||||
TaskId: "task_id",
|
TaskId: "task_id",
|
||||||
RewardId: "reward_id",
|
RewardId: "reward_id",
|
||||||
StoreId: "store_id",
|
StoreId: "store_id",
|
||||||
Quantity: "quantity",
|
|
||||||
Status: "status",
|
|
||||||
CreatedAt: "created_at",
|
CreatedAt: "created_at",
|
||||||
UpdatedAt: "updated_at",
|
UpdatedAt: "updated_at",
|
||||||
DeletedAt: "deleted_at",
|
DeletedAt: "deleted_at",
|
||||||
|
|||||||
@ -65,10 +65,11 @@ func (s *sGame) CreateGame(ctx context.Context, in *model.AddGameIn) (out *model
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = dao.Games.Ctx(ctx).Insert(do.Games{
|
_, err = dao.Games.Ctx(ctx).Insert(do.Games{
|
||||||
GameId: in.GameId,
|
GameId: in.GameId,
|
||||||
GameName: in.GameName,
|
GameName: in.GameName,
|
||||||
GameCode: in.GameCode,
|
GameCode: in.GameCode,
|
||||||
Avatar: in.Avatar,
|
Avatar: in.Avatar,
|
||||||
|
BoundType: in.BoundType,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -118,10 +119,11 @@ func (s *sGame) UpdateGame(ctx context.Context, in *model.UpdateGameIn) (out *mo
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = dao.Games.Ctx(ctx).Where(do.Games{Id: in.Id}).Update(do.Games{
|
_, err = dao.Games.Ctx(ctx).Where(do.Games{Id: in.Id}).Update(do.Games{
|
||||||
GameId: in.GameId,
|
GameId: in.GameId,
|
||||||
GameName: in.GameName,
|
GameName: in.GameName,
|
||||||
GameCode: in.GameCode,
|
GameCode: in.GameCode,
|
||||||
Avatar: in.Avatar,
|
Avatar: in.Avatar,
|
||||||
|
BoundType: in.BoundType,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ecode.Fail.Sub("修改游戏失败")
|
return nil, ecode.Fail.Sub("修改游戏失败")
|
||||||
|
|||||||
@ -80,7 +80,7 @@ func (s *sReward) Create(ctx context.Context, in *model.RewardCreateIn) (out *mo
|
|||||||
StoreId: in.StoreId,
|
StoreId: in.StoreId,
|
||||||
Value: in.Value,
|
Value: in.Value,
|
||||||
Status: in.Status,
|
Status: in.Status,
|
||||||
}).InsertAndGetId()
|
}).OmitEmptyData().InsertAndGetId()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -88,7 +88,6 @@ func (s *sReward) Create(ctx context.Context, in *model.RewardCreateIn) (out *mo
|
|||||||
return &model.RewardCreateOut{Id: id}, nil
|
return &model.RewardCreateOut{Id: id}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update 更新奖励
|
|
||||||
// Update 更新奖励
|
// Update 更新奖励
|
||||||
func (s *sReward) Update(ctx context.Context, in *model.RewardUpdateIn) (out *model.RewardUpdateOut, err error) {
|
func (s *sReward) Update(ctx context.Context, in *model.RewardUpdateIn) (out *model.RewardUpdateOut, err error) {
|
||||||
// 查询原始记录,确保存在,并获取 source 与 store_id 用于权限校验
|
// 查询原始记录,确保存在,并获取 source 与 store_id 用于权限校验
|
||||||
@ -306,7 +305,7 @@ func (s *sReward) List(ctx context.Context, in *model.RewardListIn) (out *model.
|
|||||||
dao.Rewards.Table(), dao.Rewards.Columns().RewardTypeId,
|
dao.Rewards.Table(), dao.Rewards.Columns().RewardTypeId,
|
||||||
dao.RewardTypes.Table(), dao.RewardTypes.Columns().Id,
|
dao.RewardTypes.Table(), dao.RewardTypes.Columns().Id,
|
||||||
),
|
),
|
||||||
).Fields(fmt.Sprintf("%s.*, %s.%s %s", dao.Rewards.Table(), dao.RewardTypes.Table(), dao.RewardTypes.Columns().Name, "reward_type_name")).Scan(&list)
|
).Fields(fmt.Sprintf("%s.*, %s.%s %s", dao.Rewards.Table(), dao.RewardTypes.Table(), dao.RewardTypes.Columns().Name, "reward_type_name")).OrderDesc(dao.Rewards.Columns().CreatedAt).Scan(&list)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,7 +86,7 @@ func (s *sTask) UserTaskRankingList(ctx context.Context, in *model.UserTaskRanki
|
|||||||
var total int
|
var total int
|
||||||
// SELECT `uid`,`nickname` FROM `user` ORDER BY `uid` asc
|
// SELECT `uid`,`nickname` FROM `user` ORDER BY `uid` asc
|
||||||
err = m.Page(in.Page, in.Size).LeftJoin(dao.Users.Table(), fmt.Sprintf("`%s`.`id` = `%s`.`user_id`", dao.Users.Table(), dao.UserTasks.Table())).
|
err = m.Page(in.Page, in.Size).LeftJoin(dao.Users.Table(), fmt.Sprintf("`%s`.`id` = `%s`.`user_id`", dao.Users.Table(), dao.UserTasks.Table())).
|
||||||
Fields("username,avatar,count(*) num").Where(dao.UserTasks.Columns().Status, 3).
|
Fields("username,avatar,count(*) num").Where(dao.UserTasks.Columns().Status, 2).
|
||||||
WhereBetween(dao.UserTasks.Columns().CompletedAt, start, end).OrderDesc("num").OrderDesc("username").Group("user_id").
|
WhereBetween(dao.UserTasks.Columns().CompletedAt, start, end).OrderDesc("num").OrderDesc("username").Group("user_id").
|
||||||
ScanAndCount(&list, &total, false)
|
ScanAndCount(&list, &total, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -98,16 +98,22 @@ func (s *sTask) UserTaskRankingList(ctx context.Context, in *model.UserTaskRanki
|
|||||||
var loginUserRanking []model.LoginUserRanking
|
var loginUserRanking []model.LoginUserRanking
|
||||||
var loginUserRankingNum model.LoginUserRankingNum
|
var loginUserRankingNum model.LoginUserRankingNum
|
||||||
if in.OperatorId != 0 {
|
if in.OperatorId != 0 {
|
||||||
err := dao.UserTasks.Ctx(ctx).Fields("count(*) num").Where(dao.UserTasks.Columns().UserId, in.OperatorId).Where(dao.UserTasks.Columns().Status, 3).
|
value, err := dao.UserTasks.Ctx(ctx).Fields("count(*) num").Where(dao.UserTasks.Columns().UserId, in.OperatorId).Where(dao.UserTasks.Columns().Status, 2).
|
||||||
WhereBetween(dao.UserTasks.Columns().CompletedAt, start, end).Group("user_id").
|
WhereBetween(dao.UserTasks.Columns().CompletedAt, start, end).Group("user_id").
|
||||||
Scan(&loginUserRankingNum)
|
Value()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ecode.Fail.Sub("查询当前登录用户完成数失败")
|
return nil, ecode.Fail.Sub("查询当前登录用户完成数失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if value.IsEmpty() {
|
||||||
|
loginUserRankingNum.Num = 0
|
||||||
|
} else {
|
||||||
|
loginUserRankingNum.Num = value.Int()
|
||||||
|
}
|
||||||
|
|
||||||
err = dao.UserTasks.Ctx(ctx).LeftJoin(dao.Users.Table(), fmt.Sprintf("`%s`.`id` = `%s`.`user_id`", dao.Users.Table(), dao.UserTasks.Table())).
|
err = dao.UserTasks.Ctx(ctx).LeftJoin(dao.Users.Table(), fmt.Sprintf("`%s`.`id` = `%s`.`user_id`", dao.Users.Table(), dao.UserTasks.Table())).
|
||||||
Fields("username,count(*) num").Where(dao.UserTasks.Columns().Status, 3).
|
Fields("username,count(*) num").Where(dao.UserTasks.Columns().Status, 2).
|
||||||
WhereBetween(dao.UserTasks.Columns().CompletedAt, start, end).OrderDesc("num").OrderDesc("username").Group("user_id").
|
WhereBetween(dao.UserTasks.Columns().CompletedAt, start, end).OrderDesc("num").OrderDesc("username").Group("user_id").
|
||||||
Scan(&loginUserRanking)
|
Scan(&loginUserRanking)
|
||||||
|
|
||||||
|
|||||||
@ -20,4 +20,5 @@ type Games struct {
|
|||||||
CreatedAt *gtime.Time // 创建时间
|
CreatedAt *gtime.Time // 创建时间
|
||||||
UpdatedAt *gtime.Time // 更新时间
|
UpdatedAt *gtime.Time // 更新时间
|
||||||
DeletedAt *gtime.Time // 删除时间
|
DeletedAt *gtime.Time // 删除时间
|
||||||
|
BoundType interface{} // 1:qq绑定 2:wx绑定 3:all
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,4 +23,6 @@ type Rewards struct {
|
|||||||
CreatedAt *gtime.Time // 创建时间
|
CreatedAt *gtime.Time // 创建时间
|
||||||
UpdatedAt *gtime.Time // 更新时间
|
UpdatedAt *gtime.Time // 更新时间
|
||||||
DeletedAt *gtime.Time // 软删除时间戳
|
DeletedAt *gtime.Time // 软删除时间戳
|
||||||
|
TotalNum interface{} // 奖励总数量,NULL表示不限量
|
||||||
|
UsedNum interface{} // 已使用数量
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,8 +16,6 @@ type StoreTaskRewards struct {
|
|||||||
TaskId interface{} // 门店任务ID
|
TaskId interface{} // 门店任务ID
|
||||||
RewardId interface{} // 奖励ID
|
RewardId interface{} // 奖励ID
|
||||||
StoreId interface{} // 门店ID
|
StoreId interface{} // 门店ID
|
||||||
Quantity interface{} // 奖励数量(如发放多少个奖励)
|
|
||||||
Status interface{} // 状态:1=正常,0=禁用
|
|
||||||
CreatedAt *gtime.Time // 创建时间
|
CreatedAt *gtime.Time // 创建时间
|
||||||
UpdatedAt *gtime.Time // 更新时间
|
UpdatedAt *gtime.Time // 更新时间
|
||||||
DeletedAt *gtime.Time // 软删除时间戳
|
DeletedAt *gtime.Time // 软删除时间戳
|
||||||
|
|||||||
@ -10,12 +10,13 @@ import (
|
|||||||
|
|
||||||
// Games is the golang structure for table games.
|
// Games is the golang structure for table games.
|
||||||
type Games struct {
|
type Games struct {
|
||||||
Id int64 `json:"id" orm:"id" description:""` //
|
Id int64 `json:"id" orm:"id" description:""` //
|
||||||
GameId int64 `json:"gameId" orm:"game_id" description:"腾讯游戏 id"` // 腾讯游戏 id
|
GameId int64 `json:"gameId" orm:"game_id" description:"腾讯游戏 id"` // 腾讯游戏 id
|
||||||
GameName string `json:"gameName" orm:"game_name" description:"游戏名称"` // 游戏名称
|
GameName string `json:"gameName" orm:"game_name" description:"游戏名称"` // 游戏名称
|
||||||
GameCode string `json:"gameCode" orm:"game_code" description:"游戏代号"` // 游戏代号
|
GameCode string `json:"gameCode" orm:"game_code" description:"游戏代号"` // 游戏代号
|
||||||
Avatar string `json:"avatar" orm:"avatar" description:"图标"` // 图标
|
Avatar string `json:"avatar" orm:"avatar" description:"图标"` // 图标
|
||||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"删除时间"` // 删除时间
|
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"删除时间"` // 删除时间
|
||||||
|
BoundType int `json:"boundType" orm:"bound_type" description:"1:qq绑定 2:wx绑定 3:all"` // 1:qq绑定 2:wx绑定 3:all
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,4 +21,6 @@ type Rewards struct {
|
|||||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
||||||
|
TotalNum uint64 `json:"totalNum" orm:"total_num" description:"奖励总数量,NULL表示不限量"` // 奖励总数量,NULL表示不限量
|
||||||
|
UsedNum uint64 `json:"usedNum" orm:"used_num" description:"已使用数量"` // 已使用数量
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,13 +10,11 @@ import (
|
|||||||
|
|
||||||
// StoreTaskRewards is the golang structure for table store_task_rewards.
|
// StoreTaskRewards is the golang structure for table store_task_rewards.
|
||||||
type StoreTaskRewards struct {
|
type StoreTaskRewards struct {
|
||||||
Id int64 `json:"id" orm:"id" description:"任务奖励关联ID"` // 任务奖励关联ID
|
Id int64 `json:"id" orm:"id" description:"任务奖励关联ID"` // 任务奖励关联ID
|
||||||
TaskId int64 `json:"taskId" orm:"task_id" description:"门店任务ID"` // 门店任务ID
|
TaskId int64 `json:"taskId" orm:"task_id" description:"门店任务ID"` // 门店任务ID
|
||||||
RewardId int64 `json:"rewardId" orm:"reward_id" description:"奖励ID"` // 奖励ID
|
RewardId int64 `json:"rewardId" orm:"reward_id" description:"奖励ID"` // 奖励ID
|
||||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店ID"` // 门店ID
|
StoreId int64 `json:"storeId" orm:"store_id" description:"门店ID"` // 门店ID
|
||||||
Quantity int `json:"quantity" orm:"quantity" description:"奖励数量(如发放多少个奖励)"` // 奖励数量(如发放多少个奖励)
|
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||||
Status int `json:"status" orm:"status" description:"状态:1=正常,0=禁用"` // 状态:1=正常,0=禁用
|
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
||||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
|
||||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
type Game struct {
|
type Game struct {
|
||||||
GameId int64 `json:"gameId" orm:"game_id"` // 腾讯游戏 id
|
GameId int64 `json:"gameId" orm:"game_id"` // 腾讯游戏 id
|
||||||
GameName string `json:"gameName" orm:"game_name"` // 游戏名称
|
GameName string `json:"gameName" orm:"game_name"` // 游戏名称
|
||||||
GameCode string `json:"gameCode" orm:"game_code"` // 游戏代号
|
GameCode string `json:"gameCode" orm:"game_code"` // 游戏代号
|
||||||
Avatar string `json:"avatar" orm:"avatar"` // 图标
|
Avatar string `json:"avatar" orm:"avatar"` // 图标
|
||||||
Id int64 `json:"id" orm:"id"`
|
Id int64 `json:"id" orm:"id"`
|
||||||
|
BoundType int64 `json:"boundType" orm:"bound_type"` // 绑定类型 1:qq 2:wx 3: all
|
||||||
}
|
}
|
||||||
|
|
||||||
// GameListIn 游戏列表入参
|
// GameListIn 游戏列表入参
|
||||||
@ -22,10 +23,11 @@ type GameListOut struct {
|
|||||||
|
|
||||||
// AddGameIn 新增游戏入参
|
// AddGameIn 新增游戏入参
|
||||||
type AddGameIn struct {
|
type AddGameIn struct {
|
||||||
GameName string `json:"gameName"`
|
GameName string `json:"gameName"`
|
||||||
GameCode string `json:"gameCode"`
|
GameCode string `json:"gameCode"`
|
||||||
Avatar string `json:"avatar"`
|
Avatar string `json:"avatar"`
|
||||||
GameId int64 `json:"gameId"`
|
GameId int64 `json:"gameId"`
|
||||||
|
BoundType int64 `json:"boundType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddGameOut 新增游戏出参
|
// AddGameOut 新增游戏出参
|
||||||
@ -35,11 +37,12 @@ type AddGameOut struct {
|
|||||||
|
|
||||||
// UpdateGameIn 更新游戏入参
|
// UpdateGameIn 更新游戏入参
|
||||||
type UpdateGameIn struct {
|
type UpdateGameIn struct {
|
||||||
GameName string `json:"gameName"`
|
GameName string `json:"gameName"`
|
||||||
GameCode string `json:"gameCode"`
|
GameCode string `json:"gameCode"`
|
||||||
Avatar string `json:"avatar"`
|
Avatar string `json:"avatar"`
|
||||||
GameId int64 `json:"gameId"`
|
GameId int64 `json:"gameId"`
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
|
BoundType int64 `json:"boundType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateGameOut 更新游戏出参
|
// UpdateGameOut 更新游戏出参
|
||||||
|
|||||||
Reference in New Issue
Block a user