任务三
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package common
|
||||
|
||||
// PageResult 分页响应
|
||||
type PageResult struct {
|
||||
List interface{} `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
}
|
||||
|
||||
// IdsRequest 批量ID请求
|
||||
type IdsRequest struct {
|
||||
Ids []uint `json:"ids"`
|
||||
}
|
||||
|
||||
// IdRequest 单个ID请求
|
||||
type IdRequest struct {
|
||||
ID uint `json:"id"`
|
||||
}
|
||||
|
||||
// Empty 空响应
|
||||
type Empty struct{}
|
||||
@@ -0,0 +1,98 @@
|
||||
package system
|
||||
|
||||
// ApiInfo API信息
|
||||
type ApiInfo struct {
|
||||
ID uint `json:"ID"`
|
||||
Path string `json:"path"`
|
||||
Description string `json:"description"`
|
||||
ApiGroup string `json:"apiGroup"`
|
||||
Method string `json:"method"`
|
||||
}
|
||||
|
||||
// CreateApiRequest 创建API请求
|
||||
type CreateApiRequest struct {
|
||||
Path string `json:"path" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
ApiGroup string `json:"apiGroup"`
|
||||
Method string `json:"method" binding:"required"`
|
||||
}
|
||||
|
||||
// UpdateApiRequest 更新API请求
|
||||
type UpdateApiRequest struct {
|
||||
ID uint `json:"ID" binding:"required"`
|
||||
Path string `json:"path"`
|
||||
Description string `json:"description"`
|
||||
ApiGroup string `json:"apiGroup"`
|
||||
Method string `json:"method"`
|
||||
}
|
||||
|
||||
// DeleteApiRequest 删除API请求
|
||||
type DeleteApiRequest struct {
|
||||
ID uint `json:"ID" binding:"required"`
|
||||
}
|
||||
|
||||
// DeleteApisByIdsRequest 批量删除API请求
|
||||
type DeleteApisByIdsRequest struct {
|
||||
Ids []uint `json:"ids" binding:"required"`
|
||||
}
|
||||
|
||||
// GetApiByIdRequest 根据ID获取API请求
|
||||
type GetApiByIdRequest struct {
|
||||
ID uint `json:"ID" binding:"required"`
|
||||
}
|
||||
|
||||
// GetApiByIdReply 根据ID获取API响应
|
||||
type GetApiByIdReply struct {
|
||||
Api ApiInfo `json:"api"`
|
||||
}
|
||||
|
||||
// GetApiListRequest 获取API列表请求
|
||||
type GetApiListRequest struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Path string `json:"path"`
|
||||
Description string `json:"description"`
|
||||
Method string `json:"method"`
|
||||
ApiGroup string `json:"apiGroup"`
|
||||
OrderKey string `json:"orderKey"`
|
||||
Desc bool `json:"desc"`
|
||||
}
|
||||
|
||||
// GetApiListReply 获取API列表响应
|
||||
type GetApiListReply struct {
|
||||
List []ApiInfo `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
}
|
||||
|
||||
// GetAllApisReply 获取所有API响应
|
||||
type GetAllApisReply struct {
|
||||
Apis []ApiInfo `json:"apis"`
|
||||
}
|
||||
|
||||
// GetApiGroupsReply 获取API分组响应
|
||||
type GetApiGroupsReply struct {
|
||||
Groups []string `json:"groups"`
|
||||
ApiGroupMap map[string]string `json:"apiGroupMap"`
|
||||
}
|
||||
|
||||
// SyncApiReply 同步API响应
|
||||
type SyncApiReply struct {
|
||||
NewApis []ApiInfo `json:"newApis"`
|
||||
DeleteApis []ApiInfo `json:"deleteApis"`
|
||||
IgnoreApis []ApiInfo `json:"ignoreApis"`
|
||||
}
|
||||
|
||||
// IgnoreApiRequest 忽略API请求
|
||||
type IgnoreApiRequest struct {
|
||||
Path string `json:"path" binding:"required"`
|
||||
Method string `json:"method" binding:"required"`
|
||||
Flag bool `json:"flag"`
|
||||
}
|
||||
|
||||
// EnterSyncApiRequest 确认同步API请求
|
||||
type EnterSyncApiRequest struct {
|
||||
NewApis []ApiInfo `json:"newApis"`
|
||||
DeleteApis []ApiInfo `json:"deleteApis"`
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package system
|
||||
|
||||
// UserInfo 用户信息
|
||||
type UserInfo struct {
|
||||
ID uint `json:"id"`
|
||||
UUID string `json:"uuid"`
|
||||
Username string `json:"userName"`
|
||||
NickName string `json:"nickName"`
|
||||
SideMode string `json:"sideMode"`
|
||||
HeaderImg string `json:"headerImg"`
|
||||
BaseColor string `json:"baseColor"`
|
||||
AuthorityId uint `json:"authorityId"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
Enable int `json:"enable"`
|
||||
OriginSetting string `json:"originSetting,omitempty"`
|
||||
Authority *AuthorityInfo `json:"authority,omitempty"`
|
||||
Authorities []AuthorityInfo `json:"authorities,omitempty"`
|
||||
}
|
||||
|
||||
// AuthorityInfo 角色信息
|
||||
type AuthorityInfo struct {
|
||||
AuthorityId uint `json:"authorityId"`
|
||||
AuthorityName string `json:"authorityName"`
|
||||
ParentId *uint `json:"parentId,omitempty"`
|
||||
DefaultRouter string `json:"defaultRouter"`
|
||||
}
|
||||
|
||||
// LoginRequest 登录请求
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
Captcha string `json:"captcha"`
|
||||
CaptchaId string `json:"captchaId"`
|
||||
}
|
||||
|
||||
// LoginReply 登录响应
|
||||
type LoginReply struct {
|
||||
User UserInfo `json:"user"`
|
||||
Token string `json:"token"`
|
||||
ExpiresAt int64 `json:"expiresAt"`
|
||||
}
|
||||
|
||||
// RegisterRequest 注册请求
|
||||
type RegisterRequest struct {
|
||||
Username string `json:"userName" binding:"required"`
|
||||
Password string `json:"passWord" binding:"required"`
|
||||
NickName string `json:"nickName"`
|
||||
HeaderImg string `json:"headerImg"`
|
||||
AuthorityId uint `json:"authorityId"`
|
||||
AuthorityIds []uint `json:"authorityIds"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
Enable int `json:"enable"`
|
||||
}
|
||||
|
||||
// UserInfoReply 用户信息响应
|
||||
type UserInfoReply struct {
|
||||
User UserInfo `json:"user"`
|
||||
}
|
||||
|
||||
// ChangePasswordRequest 修改密码请求
|
||||
type ChangePasswordRequest struct {
|
||||
Password string `json:"password" binding:"required"`
|
||||
NewPassword string `json:"newPassword" binding:"required"`
|
||||
}
|
||||
|
||||
// ResetPasswordRequest 重置密码请求
|
||||
type ResetPasswordRequest struct {
|
||||
ID uint `json:"ID" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
// GetUserInfoReply 获取用户信息响应
|
||||
type GetUserInfoReply struct {
|
||||
UserInfo UserInfo `json:"userInfo"`
|
||||
}
|
||||
|
||||
// GetUserListRequest 获取用户列表请求
|
||||
type GetUserListRequest struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Username string `json:"username"`
|
||||
NickName string `json:"nickName"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
// GetUserListReply 获取用户列表响应
|
||||
type GetUserListReply struct {
|
||||
List []UserInfo `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
}
|
||||
|
||||
// SetUserInfoRequest 设置用户信息请求
|
||||
type SetUserInfoRequest struct {
|
||||
ID uint `json:"ID" binding:"required"`
|
||||
NickName string `json:"nickName"`
|
||||
HeaderImg string `json:"headerImg"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
Enable int `json:"enable"`
|
||||
AuthorityIds []uint `json:"authorityIds"`
|
||||
}
|
||||
|
||||
// SetSelfInfoRequest 设置自己信息请求
|
||||
type SetSelfInfoRequest struct {
|
||||
NickName string `json:"nickName"`
|
||||
HeaderImg string `json:"headerImg"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
SideMode string `json:"sideMode"`
|
||||
BaseColor string `json:"baseColor"`
|
||||
}
|
||||
|
||||
// SetSelfSettingRequest 设置自己配置请求
|
||||
type SetSelfSettingRequest struct {
|
||||
Setting string `json:"setting"`
|
||||
}
|
||||
|
||||
// DeleteUserRequest 删除用户请求
|
||||
type DeleteUserRequest struct {
|
||||
ID uint `json:"ID" binding:"required"`
|
||||
}
|
||||
|
||||
// SetUserAuthorityRequest 设置用户角色请求
|
||||
type SetUserAuthorityRequest struct {
|
||||
AuthorityId uint `json:"authorityId" binding:"required"`
|
||||
}
|
||||
|
||||
// SetUserAuthorityReply 设置用户角色响应
|
||||
type SetUserAuthorityReply struct {
|
||||
Token string `json:"token"`
|
||||
ExpiresAt int64 `json:"expiresAt"`
|
||||
}
|
||||
|
||||
// SetUserAuthoritiesRequest 设置用户多角色请求
|
||||
type SetUserAuthoritiesRequest struct {
|
||||
ID uint `json:"ID" binding:"required"`
|
||||
AuthorityIds []uint `json:"authorityIds" binding:"required"`
|
||||
}
|
||||
Reference in New Issue
Block a user