初始化项目框架,完成部分接口开发

This commit is contained in:
2025-07-10 21:04:29 +08:00
commit b2871ec0d2
168 changed files with 6399 additions and 0 deletions

47
api/auth/v1/auth.go Normal file
View File

@ -0,0 +1,47 @@
package v1
import "github.com/gogf/gf/v2/frame/g"
type AdminLoginReq struct {
g.Meta `path:"/admin/login" tags:"Admin" method:"post" summary:"管理员登录"`
Username string `json:"username" v:"required" dc:"用户名"`
Password string `json:"password" v:"required" dc:"密码"`
}
type AdminLoginRes struct {
Token string `json:"token" dc:"token"`
}
type UserLoginReq struct {
g.Meta `path:"/user/login" tags:"APP/User" method:"post" summary:"用户登录"`
Email string `json:"email" v:"required" dc:"邮箱"`
Password string `json:"password" v:"required" dc:"密码"`
}
type UserLoginRes struct {
Token string `json:"token" dc:"token"`
}
type UserRegisterReq struct {
g.Meta `path:"/user/register" tags:"APP/User" method:"post" summary:"用户注册"`
Email string `json:"email" v:"required" dc:"邮箱"`
Password string `json:"password" v:"required" dc:"密码"`
Password2 string `json:"password2" v:"required|same:password" dc:"确认密码"`
}
type UserRegisterRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type UserEditPassReq struct {
g.Meta `path:"/user/editPass" tags:"APP/User" method:"post" summary:"修改密码"`
Email string `json:"email" v:"required" dc:"邮箱"`
Password string `json:"password" v:"required" dc:"密码"`
Password2 string `json:"password2" v:"required|same:password" dc:"确认密码"`
Sign string `json:"sign" v:"required" dc:"验证码"`
}
type UserEditPassRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type UserCodeReq struct {
g.Meta `path:"/user/code" tags:"APP/User" method:"post" summary:"获取验证码"`
Email string `json:"email" v:"required" dc:"邮箱"`
}
type UserCodeRes struct {
Success bool `json:"success" dc:"是否成功"`
}