69 lines
2.0 KiB
Go
69 lines
2.0 KiB
Go
package dto
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
// ---------- 后台管理 ----------
|
|
|
|
type AdminPrizeItem struct {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Icon string `json:"icon"`
|
|
PType int `json:"p_type"`
|
|
PointsCost int `json:"points_cost"`
|
|
Stock int `json:"stock"`
|
|
Status int `json:"status"`
|
|
SortOrder int `json:"sort_order"`
|
|
}
|
|
|
|
type AdminPrizeListReq struct {
|
|
g.Meta `path:"/prize/list" method:"get" summary:"奖品列表"`
|
|
}
|
|
|
|
type AdminPrizeListRes struct {
|
|
List []*AdminPrizeItem `json:"list"`
|
|
}
|
|
|
|
type AdminPrizeCreateReq struct {
|
|
g.Meta `path:"/prize/create" method:"post" summary:"新增奖品"`
|
|
Name string `v:"required|length:1,64" json:"name"`
|
|
Description string `json:"description"`
|
|
Icon string `json:"icon"`
|
|
PType int `v:"required|in:1,2" json:"p_type"` // 1=虚拟,2=实物
|
|
PointsCost int `v:"required|min:1" json:"points_cost"`
|
|
Stock int `v:"min:-1" json:"stock"` // -1=不限量
|
|
SortOrder int `json:"sort_order"`
|
|
}
|
|
|
|
type AdminPrizeCreateRes struct {
|
|
Id int64 `json:"id"`
|
|
}
|
|
|
|
type AdminPrizeUpdateReq struct {
|
|
g.Meta `path:"/prize/update" method:"post" summary:"编辑奖品"`
|
|
Id int64 `v:"required|min:1" json:"id"`
|
|
Name string `v:"required|length:1,64" json:"name"`
|
|
Description string `json:"description"`
|
|
Icon string `json:"icon"`
|
|
PType int `v:"required|in:1,2" json:"p_type"`
|
|
PointsCost int `v:"required|min:1" json:"points_cost"`
|
|
Stock int `v:"min:-1" json:"stock"`
|
|
SortOrder int `json:"sort_order"`
|
|
}
|
|
|
|
type AdminPrizeUpdateRes struct{}
|
|
|
|
type AdminPrizeDisableReq struct {
|
|
g.Meta `path:"/prize/disable" method:"post" summary:"下架奖品"`
|
|
Id int64 `v:"required|min:1" json:"id"`
|
|
}
|
|
|
|
type AdminPrizeDisableRes struct{}
|
|
|
|
type AdminPrizeEnableReq struct {
|
|
g.Meta `path:"/prize/enable" method:"post" summary:"上架奖品"`
|
|
Id int64 `v:"required|min:1" json:"id"`
|
|
}
|
|
|
|
type AdminPrizeEnableRes struct{}
|