🎉 初始化项目
This commit is contained in:
22
server/model/system/request/jwt.go
Normal file
22
server/model/system/request/jwt.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// BaseClaims 基础 Claims
|
||||
type BaseClaims struct {
|
||||
UUID uuid.UUID
|
||||
ID uint
|
||||
Username string
|
||||
NickName string
|
||||
AuthorityId uint
|
||||
}
|
||||
|
||||
// CustomClaims 自定义 Claims
|
||||
type CustomClaims struct {
|
||||
BaseClaims
|
||||
BufferTime int64
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
27
server/model/system/request/sys_api.go
Normal file
27
server/model/system/request/sys_api.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package request
|
||||
|
||||
// CreateApiRequest 创建API请求
|
||||
type CreateApiRequest struct {
|
||||
Path string `json:"path" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
ApiGroup string `json:"apiGroup" binding:"required"`
|
||||
Method string `json:"method" binding:"required,oneof=GET POST PUT DELETE PATCH"`
|
||||
}
|
||||
|
||||
// UpdateApiRequest 更新API请求
|
||||
type UpdateApiRequest struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
Path string `json:"path" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
ApiGroup string `json:"apiGroup" binding:"required"`
|
||||
Method string `json:"method" binding:"required,oneof=GET POST PUT DELETE PATCH"`
|
||||
}
|
||||
|
||||
// GetApiListRequest 获取API列表请求
|
||||
type GetApiListRequest struct {
|
||||
Page int `json:"page" form:"page"`
|
||||
PageSize int `json:"pageSize" form:"pageSize"`
|
||||
Path string `json:"path" form:"path"`
|
||||
ApiGroup string `json:"apiGroup" form:"apiGroup"`
|
||||
Method string `json:"method" form:"method"`
|
||||
}
|
||||
22
server/model/system/request/sys_user.go
Normal file
22
server/model/system/request/sys_user.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package request
|
||||
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
type RegisterRequest struct {
|
||||
Username string `json:"username" binding:"required,min=3,max=50"`
|
||||
Password string `json:"password" binding:"required,min=6"`
|
||||
Email string `json:"email" binding:"email"`
|
||||
}
|
||||
|
||||
type UpdateUserRequest struct {
|
||||
ID uint `json:"id"`
|
||||
Nickname string `json:"nickname"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
Avatar string `json:"avatar"`
|
||||
Role string `json:"role"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
Reference in New Issue
Block a user