134 lines
8.3 KiB
Go
134 lines
8.3 KiB
Go
package v1
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/frame/g"
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
)
|
||
|
||
// CreateSystemRewardReq 创建系统奖励请求
|
||
type CreateSystemRewardReq struct {
|
||
g.Meta `path:"/reward/system" method:"post" tags:"Reward" summary:"(系统)创建系统奖励"`
|
||
RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"`
|
||
Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"`
|
||
Description string `v:"length:0,255#奖励描述长度为0-255" json:"description" dc:"奖励描述,可选"`
|
||
Status int `v:"in:1,2#状态必须为1或2" json:"status" dc:"状态:1=启用,2=禁用,默认1" d:"1"`
|
||
Stock int `v:"min:0#库存不能为负" json:"stock" dc:"奖励库存,0表示无限制" d:"0"`
|
||
StartAt *gtime.Time `v:"date#开始时间格式无效" json:"startAt" dc:"奖励有效开始时间,可选"`
|
||
ExpireAt *gtime.Time `v:"date|after-equal:start_at#结束时间格式无效|结束时间必须晚于开始时间" json:"expireAt" dc:"奖励有效结束时间,可选"`
|
||
}
|
||
|
||
// CreateSystemRewardRes 创建系统奖励响应
|
||
type CreateSystemRewardRes struct {
|
||
Id int64 `json:"id" dc:"创建的奖励ID"`
|
||
}
|
||
|
||
// CreateStoreRewardReq 创建门店奖励请求
|
||
type CreateStoreRewardReq struct {
|
||
g.Meta `path:"/reward/store" method:"post" tags:"Reward" summary:"(商户门店后台)创建门店奖励"`
|
||
StoreIds []int64 `v:"required|distinct|min-length:1#门店ID列表不能为空|门店ID不能重复|门店ID列表不能为空" json:"storeIds" dc:"门店ID列表"`
|
||
RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"`
|
||
Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"`
|
||
Description string `v:"length:0,255#奖励描述长度为0-255" json:"description" dc:"奖励描述,可选"`
|
||
Status int `v:"in:1,2#状态必须为1或2" json:"status" dc:"状态:1=启用,2=禁用,默认1" d:"1"`
|
||
Stock int `v:"min:0#库存不能为负" json:"stock" dc:"奖励库存,0表示无限制" d:"0"`
|
||
StartAt *gtime.Time `v:"date#开始时间格式无效" json:"startAt" dc:"奖励有效开始时间,可选"`
|
||
ExpireAt *gtime.Time `v:"date|after-equal:start_at#结束时间格式无效|结束时间必须晚于开始时间" json:"expireAt" dc:"奖励有效结束时间,可选"`
|
||
}
|
||
|
||
// CreateStoreRewardRes 创建门店奖励响应
|
||
type CreateStoreRewardRes struct {
|
||
Id int64 `json:"id" dc:"创建的奖励ID"`
|
||
}
|
||
|
||
// ListSystemRewardReq 查询系统奖励列表请求
|
||
type ListSystemRewardReq struct {
|
||
g.Meta `path:"/reward/system" method:"get" tags:"Reward" summary:"(系统)获取系统奖励列表"`
|
||
Page int `v:"min:1#页码必须大于0" json:"page" d:"1" dc:"页码"`
|
||
PageSize int `v:"min:1|max:100#每页数量必须为1-100" json:"pageSize" d:"10" dc:"每页数量"`
|
||
Name string `json:"name" dc:"奖励名称,模糊查询,可选"`
|
||
Status int `v:"in:0,1,2#状态无效" json:"status" d:"0" dc:"状态:0=全部,1=启用,2=禁用,可选"`
|
||
RewardTypeId int64 `v:"min:0#奖励类型ID无效" json:"rewardTypeId" d:"0" dc:"奖励类型ID,0=全部,可选"`
|
||
}
|
||
|
||
// ListSystemRewardRes 查询系统奖励列表响应
|
||
type ListSystemRewardRes struct {
|
||
List interface{} `json:"list" dc:"奖励列表"`
|
||
Total int `json:"total" dc:"总记录数"`
|
||
}
|
||
|
||
// ListStoreRewardReq 查询门店奖励列表请求
|
||
type ListStoreRewardReq struct {
|
||
g.Meta `path:"/reward/store" method:"get" tags:"Reward" summary:"(系统、商户门店后台)获取门店奖励列表"`
|
||
Page int `v:"min:1#页码必须大于0" json:"page" d:"1" dc:"页码"`
|
||
PageSize int `v:"min:1|max:100#每页数量必须为1-100" json:"pageSize" d:"10" dc:"每页数量"`
|
||
StoreId int64 `v:"min:0#门店ID无效" json:"storeId" d:"0" dc:"门店ID,0=全部(管理员使用),其他值过滤该门店可见的奖励,可选"`
|
||
Name string `json:"name" dc:"奖励名称,模糊查询,可选"`
|
||
Status int `v:"in:0,1,2#状态无效" json:"status" d:"0" dc:"状态:0=全部,1=启用,2=禁用,可选"`
|
||
RewardTypeId int64 `v:"min:0#奖励类型ID无效" json:"rewardTypeId" d:"0" dc:"奖励类型ID,0=全部,可选"`
|
||
}
|
||
|
||
// ListStoreRewardRes 查询门店奖励列表响应
|
||
type ListStoreRewardRes struct {
|
||
List interface{} `json:"list" dc:"奖励列表"`
|
||
Total int `json:"total" dc:"总记录数"`
|
||
}
|
||
|
||
// UpdateSystemRewardReq 更新系统奖励请求
|
||
type UpdateSystemRewardReq struct {
|
||
g.Meta `path:"/reward/system" method:"put" tags:"Reward" summary:"(系统)更新系统奖励"`
|
||
Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"`
|
||
RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"`
|
||
Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"`
|
||
Description string `v:"length:0,255#奖励描述长度为0-255" json:"description" dc:"奖励描述,可选"`
|
||
Status int `v:"in:1,2#状态必须为1或2" json:"status" dc:"状态:1=启用,2=禁用"`
|
||
Stock int `v:"min:0#库存不能为负" json:"stock" dc:"奖励库存,0表示无限制"`
|
||
StartAt *gtime.Time `v:"date#开始时间格式无效" json:"startAt" dc:"奖励有效开始时间,可选"`
|
||
ExpireAt *gtime.Time `v:"date|after-equal:start_at#结束时间格式无效|结束时间必须晚于开始时间" json:"expireAt" dc:"奖励有效结束时间,可选"`
|
||
}
|
||
|
||
// UpdateSystemRewardRes 更新系统奖励响应
|
||
type UpdateSystemRewardRes struct {
|
||
Success bool `json:"success" dc:"更新成功"`
|
||
}
|
||
|
||
// UpdateStoreRewardReq 更新门店奖励请求
|
||
type UpdateStoreRewardReq struct {
|
||
g.Meta `path:"/reward/store/{id}" method:"put" tags:"Reward" summary:"(系统、商户门店后台)更新门店奖励"`
|
||
Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"`
|
||
StoreIds []int64 `v:"required|distinct|min-length:1#门店ID列表不能为空|门店ID不能重复|至少指定一个门店ID" json:"storeIds" dc:"关联门店ID列表"`
|
||
RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"`
|
||
Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"`
|
||
Description string `v:"length:0,255#奖励描述长度为0-255" json:"description" dc:"奖励描述,可选"`
|
||
Status int `v:"in:1,2#状态必须为1或2" json:"status" dc:"状态:1=启用,2=禁用"`
|
||
Stock int `v:"min:0#库存不能为负" json:"stock" dc:"奖励库存,0表示无限制"`
|
||
StartAt *gtime.Time `v:"date#开始时间格式无效" json:"startAt" dc:"奖励有效开始时间,可选"`
|
||
ExpireAt *gtime.Time `v:"date|after-equal:start_at#结束时间格式无效|结束时间必须晚于开始时间" json:"expireAt" dc:"奖励有效结束时间,可选"`
|
||
}
|
||
|
||
// UpdateStoreRewardRes 更新门店奖励响应
|
||
type UpdateStoreRewardRes struct {
|
||
Success bool `json:"success" dc:"更新成功"`
|
||
}
|
||
|
||
// DeleteSystemRewardReq 删除系统奖励请求
|
||
type DeleteSystemRewardReq struct {
|
||
g.Meta `path:"/reward/system/{id}" method:"delete" tags:"Reward" summary:"(系统)删除系统奖励"`
|
||
Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"`
|
||
}
|
||
|
||
// DeleteSystemRewardRes 删除系统奖励响应
|
||
type DeleteSystemRewardRes struct {
|
||
Success bool `json:"success" dc:"删除成功"`
|
||
}
|
||
|
||
// DeleteStoreRewardReq 删除门店奖励请求
|
||
type DeleteStoreRewardReq struct {
|
||
g.Meta `path:"/reward/store/{id}" method:"delete" tags:"Reward" summary:"(系统、商户门店后台)删除门店奖励"`
|
||
Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"`
|
||
}
|
||
|
||
// DeleteStoreRewardRes 删除门店奖励响应
|
||
type DeleteStoreRewardRes struct {
|
||
Success bool `json:"success" dc:"删除成功"`
|
||
}
|