添加了后台管理接口,包括用户、角色、材质管理,管理员可进行删除、查找、设定状态操作,详情在README
This commit is contained in:
@@ -206,3 +206,84 @@ type SystemConfigResponse struct {
|
||||
MaxTexturesPerUser int `json:"max_textures_per_user" example:"100"`
|
||||
MaxProfilesPerUser int `json:"max_profiles_per_user" example:"5"`
|
||||
}
|
||||
|
||||
// AdminUserSearchRequest 管理员用户搜索请求
|
||||
// @Description 管理员搜索用户请求参数
|
||||
type AdminUserSearchRequest struct {
|
||||
PaginationRequest
|
||||
Keyword string `json:"keyword" form:"keyword" example:"testuser"`
|
||||
Role string `json:"role" form:"role" binding:"omitempty,oneof=user admin"`
|
||||
Status *int16 `json:"status" form:"status" binding:"omitempty,oneof=1 0 -1"`
|
||||
SortBy string `json:"sort_by" form:"sort_by" binding:"omitempty,oneof=id username email points created_at"`
|
||||
SortDesc bool `json:"sort_desc" form:"sort_desc"`
|
||||
}
|
||||
|
||||
// AdminUserCreateRequest 管理员创建用户请求
|
||||
// @Description 管理员创建用户请求参数
|
||||
type AdminUserCreateRequest struct {
|
||||
Username string `json:"username" binding:"required,min=3,max=50" example:"newuser"`
|
||||
Email string `json:"email" binding:"required,email" example:"user@example.com"`
|
||||
Password string `json:"password" binding:"required,min=6,max=128" example:"password123"`
|
||||
Role string `json:"role" binding:"required,oneof=user admin" example:"user"`
|
||||
Points int `json:"points" binding:"omitempty,min=0" example:"0"`
|
||||
}
|
||||
|
||||
// AdminUserUpdateRequest 管理员更新用户请求
|
||||
// @Description 管理员更新用户请求参数
|
||||
type AdminUserUpdateRequest struct {
|
||||
Username *string `json:"username" binding:"omitempty,min=3,max=50" example:"newusername"`
|
||||
Email *string `json:"email" binding:"omitempty,email" example:"newemail@example.com"`
|
||||
Password *string `json:"password" binding:"omitempty,min=6,max=128" example:"newpassword"`
|
||||
Role *string `json:"role" binding:"omitempty,oneof=user admin" example:"admin"`
|
||||
Points *int `json:"points" binding:"omitempty,min=0" example:"100"`
|
||||
Status *int16 `json:"status" binding:"omitempty,oneof=1 0 -1"`
|
||||
}
|
||||
|
||||
// AdminTextureSearchRequest 管理员材质搜索请求
|
||||
// @Description 管理员搜索材质请求参数
|
||||
type AdminTextureSearchRequest struct {
|
||||
PaginationRequest
|
||||
Keyword string `json:"keyword" form:"keyword" example:"skin"`
|
||||
Type TextureType `json:"type" form:"type" binding:"omitempty,oneof=SKIN CAPE"`
|
||||
Status *int16 `json:"status" form:"status" binding:"omitempty,oneof=1 0 -1"`
|
||||
UploaderID *int64 `json:"uploader_id" form:"uploader_id" example:"1"`
|
||||
SortBy string `json:"sort_by" form:"sort_by" binding:"omitempty,oneof=id name download_count favorite_count created_at"`
|
||||
SortDesc bool `json:"sort_desc" form:"sort_desc"`
|
||||
}
|
||||
|
||||
// AdminTextureUpdateRequest 管理员更新材质请求
|
||||
// @Description 管理员更新材质请求参数
|
||||
type AdminTextureUpdateRequest struct {
|
||||
Name *string `json:"name" binding:"omitempty,min=1,max=100" example:"New Skin Name"`
|
||||
Description *string `json:"description" binding:"omitempty,max=500" example:"New description"`
|
||||
IsPublic *bool `json:"is_public" example:"true"`
|
||||
Status *int16 `json:"status" binding:"omitempty,oneof=1 0 -1"`
|
||||
}
|
||||
|
||||
// AdminRoleListResponse 角色列表响应
|
||||
// @Description 角色列表响应数据
|
||||
type AdminRoleListResponse struct {
|
||||
Roles []RoleInfo `json:"roles"`
|
||||
}
|
||||
|
||||
// RoleInfo 角色信息
|
||||
// @Description 角色详细信息
|
||||
type RoleInfo struct {
|
||||
Name string `json:"name" example:"admin"`
|
||||
DisplayName string `json:"display_name" example:"管理员"`
|
||||
Description string `json:"description" example:"拥有所有管理权限"`
|
||||
}
|
||||
|
||||
// AdminStatsResponse 管理员统计信息响应
|
||||
// @Description 管理员统计信息
|
||||
type AdminStatsResponse struct {
|
||||
TotalUsers int64 `json:"total_users" example:"100"`
|
||||
ActiveUsers int64 `json:"active_users" example:"80"`
|
||||
BannedUsers int64 `json:"banned_users" example:"5"`
|
||||
AdminUsers int64 `json:"admin_users" example:"3"`
|
||||
TotalTextures int64 `json:"total_textures" example:"500"`
|
||||
PublicTextures int64 `json:"public_textures" example:"300"`
|
||||
PendingTextures int64 `json:"pending_textures" example:"10"`
|
||||
TotalDownloads int64 `json:"total_downloads" example:"1000"`
|
||||
TotalFavorites int64 `json:"total_favorites" example:"500"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user