You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.2 KiB

package user
import (
"gf_demo_02/internal/model/entity"
"github.com/gogf/gf/v2/frame/g"
)
type LoginReq struct {
g.Meta `path:"/login" method:"post"`
Username string
Password string
}
type LoginRes struct {
Token string `json:"token"` //token加签后的字符串
}
type GetUserListReq struct {
g.Meta `path:"/getUsers" method:"get"`
}
type GetUserListRes struct {
Users []entity.User `json:"users"`
}
type EditUserReq struct {
g.Meta `path:"/admin/user/editUser" method:"post"`
Id uint `json:"id"`
Name string `json:"name" v:"required"`
Property uint `json:"property" v:"between:1,5 #权限必须为1-5"`
Pass string `json:"pass"`
}
type EditUserRes struct {
}
type DeleteUserReq struct {
g.Meta `path:"/admin/user/delete" method:"delete"`
Id uint `json:"id" v:"required#缺少用户id"`
}
type DeleteUserRes struct{}
type GetSelfReq struct {
g.Meta `path:"/admin/user/getSelf" method:"get"`
}
type GetSelfRes struct {
User entity.User `json:"user"`
}
type SearchUserReq struct {
g.Meta `path:"/admin/user/search" method:"get"`
Keyword string `json:"keyword" p:"keyword"`
}
type SearchUserRes struct {
Users []entity.User `json:"users"`
}