实现奖励类型的增删改查
This commit is contained in:
18
api/rewardType/rewardType.go
Normal file
18
api/rewardType/rewardType.go
Normal file
@ -0,0 +1,18 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package rewardType
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/rewardType/v1"
|
||||
)
|
||||
|
||||
type IRewardTypeV1 interface {
|
||||
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
|
||||
Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error)
|
||||
Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error)
|
||||
Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.DeleteRes, err error)
|
||||
}
|
||||
47
api/rewardType/v1/rewardType.go
Normal file
47
api/rewardType/v1/rewardType.go
Normal file
@ -0,0 +1,47 @@
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/rewardType" method:"get" tags:"RewardType" summary:"(系统、商户、门店后台)获取奖励类型列表"`
|
||||
Name string `json:"name" dc:"名称"`
|
||||
Page int `json:"page" dc:"页数"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
StoreId int64 `json:"storeId" dc:"门店ID"`
|
||||
}
|
||||
type ListRes struct {
|
||||
List interface{} `json:"list" dc:"奖励类型列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type CreateReq struct {
|
||||
g.Meta `path:"/rewardType" method:"post" tags:"RewardType" summary:"(系统、商户、门店后台)创建奖励类型"`
|
||||
Name string `json:"name" v:"required#名称不能为空" dc:"名称"`
|
||||
Description string `json:"description" v:"required#描述不能为空" dc:"描述"`
|
||||
Status int `json:"status" v:"" dc:"状态" d:"1"`
|
||||
StoreId int64 `json:"storeId" dc:"门店ID"`
|
||||
Source int `json:"source" v:"in:1,2#来源只能为1或2" dc:"来源"`
|
||||
}
|
||||
type CreateRes struct {
|
||||
Id int64 `json:"id" dc:"奖励类型ID"`
|
||||
}
|
||||
|
||||
type UpdateReq struct {
|
||||
g.Meta `path:"/rewardType" method:"put" tags:"RewardType" summary:"(系统、商户、门店后台)更新奖励类型"`
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"Id"`
|
||||
Name string `json:"name" v:"required#名称不能为空" dc:"名称"`
|
||||
Description string `json:"description" v:"required#描述不能为空" dc:"描述"`
|
||||
Status int `json:"status" v:"" dc:"状态" d:"1"`
|
||||
StoreId int64 `json:"storeId" dc:"门店ID"`
|
||||
}
|
||||
type UpdateRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
type DeleteReq struct {
|
||||
g.Meta `path:"/rewardType/{id}" method:"delete" tags:"RewardType" summary:"(系统、商户、门店后台)删除奖励类型"`
|
||||
Id int64 `in:"path" json:"id" v:"required#ID不能为空" dc:"Id"`
|
||||
}
|
||||
type DeleteRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
Reference in New Issue
Block a user