初始化项目框架,完成部分接口开发
This commit is contained in:
18
api/category/category.go
Normal file
18
api/category/category.go
Normal file
@ -0,0 +1,18 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package category
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/category/v1"
|
||||
)
|
||||
|
||||
type ICategoryV1 interface {
|
||||
CategoryList(ctx context.Context, req *v1.CategoryListReq) (res *v1.CategoryListRes, err error)
|
||||
CategoryAdd(ctx context.Context, req *v1.CategoryAddReq) (res *v1.CategoryAddRes, err error)
|
||||
CategoryEdit(ctx context.Context, req *v1.CategoryEditReq) (res *v1.CategoryEditRes, err error)
|
||||
CategoryDel(ctx context.Context, req *v1.CategoryDelReq) (res *v1.CategoryDelRes, err error)
|
||||
}
|
||||
46
api/category/v1/category.go
Normal file
46
api/category/v1/category.go
Normal file
@ -0,0 +1,46 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"server/internal/model"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type CategoryListReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"get" summary:"获取分类列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Name string `json:"name" dc:"分类名称(模糊搜索)"`
|
||||
Type int `json:"type" dc:"类型,1男频,2女频"`
|
||||
}
|
||||
type CategoryListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.Category `json:"list" dc:"分类列表"`
|
||||
}
|
||||
|
||||
type CategoryAddReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"post" summary:"新增分类"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
Type int `json:"type" dc:"类型,1男频,2女频"`
|
||||
}
|
||||
type CategoryAddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type CategoryEditReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"put" summary:"编辑分类"`
|
||||
Id int `json:"id" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
Type int `json:"type" dc:"类型,1男频,2女频"`
|
||||
}
|
||||
type CategoryEditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type CategoryDelReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"delete" summary:"删除分类"`
|
||||
Id int `json:"id" dc:"分类ID"`
|
||||
}
|
||||
type CategoryDelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
Reference in New Issue
Block a user