Files
novel_server/api/category/v1/category.go

47 lines
1.5 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package v1
import (
"server/internal/model"
"github.com/gogf/gf/v2/frame/g"
)
type ListReq struct {
g.Meta `path:"/category" tags:"Backend-APP/Category" method:"get" summary:"获取分类列表"`
Page int `json:"page" dc:"页码"`
Size int `json:"size" dc:"每页数量"`
Name string `json:"name" dc:"分类名称(模糊搜索)"`
Channel int `json:"channel" dc:"频道类型1=男频2=女频"`
}
type ListRes struct {
Total int `json:"total" dc:"总数"`
List []model.Category `json:"list" dc:"分类列表"`
}
type AddReq struct {
g.Meta `path:"/category" tags:"Backend/Category" method:"post" summary:"新增分类"`
Name string `json:"name" dc:"分类名称" v:"required"`
Channel int `json:"channel" dc:"频道类型1=男频2=女频" v:"required"`
}
type AddRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type EditReq struct {
g.Meta `path:"/category" tags:"Backend/Category" method:"put" summary:"编辑分类"`
Id int64 `json:"id" dc:"分类ID" v:"required"`
Name string `json:"name" dc:"分类名称" v:"required"`
Channel int `json:"channel" dc:"频道类型1=男频2=女频" v:"required"`
}
type EditRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type DelReq struct {
g.Meta `path:"/category" tags:"Backend/Category" method:"delete" summary:"删除分类"`
Id int64 `json:"id" dc:"分类ID" v:"required"`
}
type DelRes struct {
Success bool `json:"success" dc:"是否成功"`
}