25 lines
878 B
Go
25 lines
878 B
Go
package dto
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
// RegisterReq 手机号注册(公开接口,无需登录)
|
|
type RegisterReq struct {
|
|
g.Meta `path:"/auth/register" method:"post" summary:"注册" tags:"账号"`
|
|
Phone string `json:"phone" v:"required|regex:^1[3-9]\\d{9}$" dc:"手机号"`
|
|
Password string `json:"password" v:"required|length:6,64" dc:"密码"`
|
|
}
|
|
|
|
type RegisterRes struct{}
|
|
|
|
// LoginReq 手机号登录(公开接口,无需登录)
|
|
type LoginReq struct {
|
|
g.Meta `path:"/auth/login" method:"post" summary:"登录" tags:"账号"`
|
|
Phone string `json:"phone" v:"required|regex:^1[3-9]\\d{9}$" dc:"手机号"`
|
|
Password string `json:"password" v:"required|length:6,64" dc:"密码"`
|
|
}
|
|
|
|
// LoginRes 登录成功签发 token,后续登录态接口携带 Authorization: Bearer <token>
|
|
type LoginRes struct {
|
|
Token string `json:"token"`
|
|
}
|