初始化项目框架,完成部分接口开发
This commit is contained in:
19
api/auth/auth.go
Normal file
19
api/auth/auth.go
Normal file
@ -0,0 +1,19 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/auth/v1"
|
||||
)
|
||||
|
||||
type IAuthV1 interface {
|
||||
AdminLogin(ctx context.Context, req *v1.AdminLoginReq) (res *v1.AdminLoginRes, err error)
|
||||
UserLogin(ctx context.Context, req *v1.UserLoginReq) (res *v1.UserLoginRes, err error)
|
||||
UserRegister(ctx context.Context, req *v1.UserRegisterReq) (res *v1.UserRegisterRes, err error)
|
||||
UserEditPass(ctx context.Context, req *v1.UserEditPassReq) (res *v1.UserEditPassRes, err error)
|
||||
UserCode(ctx context.Context, req *v1.UserCodeReq) (res *v1.UserCodeRes, err error)
|
||||
}
|
||||
47
api/auth/v1/auth.go
Normal file
47
api/auth/v1/auth.go
Normal 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:"是否成功"`
|
||||
}
|
||||
Reference in New Issue
Block a user