生成 user 的接口代码
This commit is contained in:
@ -11,6 +11,5 @@ import (
|
||||
)
|
||||
|
||||
type IUserV1 interface {
|
||||
Info(ctx context.Context, req *v1.InfoReq) (res *v1.InfoRes, err error)
|
||||
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
|
||||
}
|
||||
|
||||
@ -1,17 +1,13 @@
|
||||
package user
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type InfoReq struct {
|
||||
g.Meta `path:"/user/info" method:"get" tags:"User" summary:"获取用户信息"`
|
||||
}
|
||||
|
||||
type InfoRes struct {
|
||||
}
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/user" method:"get" tags:"User" summary:"获取用户列表"`
|
||||
Page int `json:"page" v:"required" dc:"页数"`
|
||||
Size int `json:"size" v:"required" dc:"每页数量"`
|
||||
Nickname string `json:"nickname" dc:"昵称"`
|
||||
g.Meta `path:"/user/list" method:"get" tags:"User" summary:"获取用户列表"`
|
||||
Page int `json:"page" dc:"页数"`
|
||||
Size int `json:"size" dc:"页数"`
|
||||
}
|
||||
type ListRes struct {
|
||||
List interface{} `json:"list"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user