Files
arenax-server/api/user/v1/user.go

61 lines
1.8 KiB
Go

package v1
import "github.com/gogf/gf/v2/frame/g"
type ListReq struct {
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"`
}
type InfoReq struct {
g.Meta `path:"/user/info" method:"get" tags:"User" summary:"获取用户信息"`
OpenId string `json:"openId" v:"required#OpenId不能为空" dc:"OpenId"`
}
type InfoRes struct {
Id int `json:"id"`
WxOpenId string `json:"wxOpenId"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Email string `json:"email"`
PhoneNumber string `json:"phoneNumber"`
WxPopenId string `json:"wxPopenId"`
QQPopenId string `json:"qqPopenId"`
RoleId int `json:"roleId"`
}
type UpdateReq struct {
g.Meta `path:"/user" method:"put" tags:"User" summary:"更新用户头像,昵称"`
Avatar string `json:"avatar" v:"required#头像不能为空" dc:"头像"`
Nickname string `json:"nickname" v:"required#昵称不能为空" dc:"昵称"`
}
type UpdateRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type BindPhoneReq struct {
g.Meta `path:"/user/bindPhone" method:"post" tags:"User" summary:"绑定手机号"`
Phone string `json:"phone" v:"required#手机号不能为空" dc:"手机号"`
Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"`
}
type BindPhoneRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type GetPhoneCodeReq struct {
g.Meta `path:"/user/getPhoneCode" method:"post" tags:"User" summary:"获取手机验证码"`
Phone string `json:"phone" v:"required#手机号不能为空" dc:"手机号"`
}
type GetPhoneCodeRes struct {
Success bool `json:"success" dc:"是否成功"`
}