Documentation
¶
Index ¶
- type APIResponse
- type AdminConfigRequest
- type AdminConfigResponse
- type AdminDatabaseStatsResponse
- type AdminFileDetail
- type AdminFileInfo
- type AdminFilesRequest
- type AdminFilesResponse
- type AdminLoginRequest
- type AdminLoginResponse
- type AdminPerformanceMetricsResponse
- type AdminStatsResponse
- type AdminStorageStatusResponse
- type AdminSystemInfoResponse
- type AdminUserCreateRequest
- type AdminUserDetail
- type AdminUserFilesResponse
- type AdminUserInfo
- type AdminUserStatsResponse
- type AdminUserStatusRequest
- type AdminUserUpdateRequest
- type AdminUsersListResponse
- type AdminUsersRequest
- type AdminUsersResponse
- type AuthLoginRequest
- type AuthLoginResponse
- type AuthRegisterRequest
- type AuthRegisterResponse
- type BackupPathResponse
- type ChunkUploadCompleteRequest
- type ChunkUploadCompleteResponse
- type ChunkUploadInitRequest
- type ChunkUploadInitResponse
- type ChunkUploadResponse
- type ChunkUploadStatusResponse
- type ChunkValidationResponse
- type CleanedCountResponse
- type ControlDataRequest
- type CountResponse
- type ErrorResponse
- type FileInfo
- type FileInfoResponse
- type HealthResponse
- type IDResponse
- type LogPathResponse
- type LogsResponse
- type MCPStatusResponse
- type MCPTestResponse
- type PaginatedResponse
- type PaginationInfo
- type PaginationResponse
- type ShareCodeRequest
- type ShareFileRequest
- type ShareResponse
- type ShareStatsResponse
- type ShareTextRequest
- type StorageConnectionResponse
- type StorageInfoResponse
- type StorageSwitchRequest
- type StorageSwitchResponse
- type StorageTestRequest
- type StorageTestResponse
- type SuccessResponse
- type SystemInfoResponse
- type TasksResponse
- type TestDataRequest
- type TokenResponse
- type UploadInfoResponse
- type UserDataRequest
- type UserFilesRequest
- type UserFilesResponse
- type UserInfo
- type UserPasswordChangeRequest
- type UserPasswordResetRequest
- type UserProfileResponse
- type UserProfileUpdateRequest
- type UserStatsResponse
- type UserSystemInfoResponse
- type WebStorageDetail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse struct {
Code int `json:"code"`
Message string `json:"message,omitempty"`
Data interface{} `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
APIResponse 通用API响应
type AdminConfigRequest ¶
type AdminConfigRequest struct {
// 配置模块,直接使用各配置结构体避免字段重复
Base *config.BaseConfig `json:"base,omitempty"`
Database *config.DatabaseConfig `json:"database,omitempty"`
Transfer *config.TransferConfig `json:"transfer,omitempty"`
Storage *config.StorageConfig `json:"storage,omitempty"`
User *config.UserSystemConfig `json:"user,omitempty"`
MCP *config.MCPConfig `json:"mcp,omitempty"`
UI *config.UIConfig `json:"ui,omitempty"`
// 系统运行时特有字段(不属于配置模块的字段)
SysStart *string `json:"sys_start,omitempty"`
// 顶层通知字段保留与历史配置结构兼容
NotifyTitle *string `json:"notify_title,omitempty"`
NotifyContent *string `json:"notify_content,omitempty"`
}
AdminConfigRequest 管理员配置更新请求
type AdminConfigResponse ¶
type AdminConfigResponse struct {
AdminConfigRequest
}
AdminConfigResponse 管理员配置响应
type AdminDatabaseStatsResponse ¶
type AdminDatabaseStatsResponse struct {
DatabaseSize int64 `json:"database_size"`
TableCount int `json:"table_count"`
RecordCount int64 `json:"record_count"`
DatabaseType string `json:"database_type"`
DatabaseVersion string `json:"database_version"`
LastBackupTime string `json:"last_backup_time"`
FragmentationPercent float64 `json:"fragmentation_percent"`
}
AdminDatabaseStatsResponse 数据库统计响应
type AdminFileDetail ¶
type AdminFileDetail struct {
ID uint `json:"id"`
Code string `json:"code"`
Prefix string `json:"prefix"`
Suffix string `json:"suffix"`
Size int64 `json:"size"`
Type string `json:"type"`
ExpiredAt string `json:"expired_at"`
ExpiredCount int `json:"expired_count"`
UsedCount int `json:"used_count"`
CreatedAt string `json:"created_at"`
RequireAuth bool `json:"require_auth"`
UploadType string `json:"upload_type"`
}
AdminFileDetail 管理员文件详细信息
type AdminFileInfo ¶
type AdminFileInfo struct {
FileInfo
UserID *uint `json:"user_id"`
Username string `json:"username,omitempty"`
OwnerIP string `json:"owner_ip"`
}
AdminFileInfo 管理员文件信息
type AdminFilesRequest ¶
type AdminFilesRequest struct {
Page int `json:"page" form:"page"`
PageSize int `json:"page_size" form:"page_size"`
Search string `json:"search" form:"search"`
}
AdminFilesRequest 管理员文件列表请求
type AdminFilesResponse ¶
type AdminFilesResponse struct {
Files []AdminFileInfo `json:"files"`
Pagination PaginationInfo `json:"pagination"`
}
AdminFilesResponse 管理员文件列表响应
type AdminLoginRequest ¶
type AdminLoginRequest struct {
Username string `json:"username,omitempty"`
Password string `json:"password" binding:"required"`
}
AdminLoginRequest 管理员登录请求
type AdminLoginResponse ¶
type AdminLoginResponse struct {
Token string `json:"token"`
TokenType string `json:"token_type"`
ExpiresIn int64 `json:"expires_in"`
}
AdminLoginResponse 管理员登录响应
type AdminPerformanceMetricsResponse ¶
type AdminPerformanceMetricsResponse struct {
CPUUsage float64 `json:"cpu_usage"`
MemoryUsage int64 `json:"memory_usage"`
DiskUsage int64 `json:"disk_usage"`
NetworkIn int64 `json:"network_in"`
NetworkOut int64 `json:"network_out"`
RequestsPerSecond int64 `json:"requests_per_second"`
ActiveConnections int `json:"active_connections"`
ResponseTime float64 `json:"response_time"`
}
AdminPerformanceMetricsResponse 性能指标响应
type AdminStatsResponse ¶
type AdminStatsResponse struct {
TotalUsers int64 `json:"total_users"`
ActiveUsers int64 `json:"active_users"`
TodayRegistrations int64 `json:"today_registrations"`
TodayUploads int64 `json:"today_uploads"`
TotalFiles int64 `json:"total_files"`
ActiveFiles int64 `json:"active_files"`
TotalSize int64 `json:"total_size"`
SysStart string `json:"sys_start"`
}
AdminStatsResponse 管理员统计响应
type AdminStorageStatusResponse ¶
type AdminStorageStatusResponse struct {
StorageType string `json:"storage_type"`
TotalSpace int64 `json:"total_space"`
UsedSpace int64 `json:"used_space"`
AvailableSpace int64 `json:"available_space"`
UsagePercent float64 `json:"usage_percent"`
Status string `json:"status"`
IsHealthy bool `json:"is_healthy"`
}
AdminStorageStatusResponse 存储状态响应
type AdminSystemInfoResponse ¶
type AdminSystemInfoResponse struct {
GoVersion string `json:"go_version"`
BuildTime string `json:"build_time"`
GitCommit string `json:"git_commit"`
OSInfo string `json:"os_info"`
CPUCores int `json:"cpu_cores"`
MemoryUsage int64 `json:"memory_usage"`
DiskUsage int64 `json:"disk_usage"`
Uptime string `json:"uptime"`
FileCodeBoxVersion string `json:"filecodebox_version"`
}
AdminSystemInfoResponse 系统信息响应
type AdminUserCreateRequest ¶
type AdminUserCreateRequest struct {
Username string `json:"username" binding:"required"`
Email string `json:"email" binding:"required"`
Password string `json:"password" binding:"required"`
Nickname string `json:"nickname"`
Role string `json:"role"`
}
AdminUserCreateRequest 管理员创建用户请求
type AdminUserDetail ¶
type AdminUserDetail struct {
ID uint `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Nickname string `json:"nickname"`
Role string `json:"role"`
IsAdmin bool `json:"is_admin"`
IsActive bool `json:"is_active"`
Status string `json:"status"`
EmailVerified bool `json:"email_verified"`
CreatedAt string `json:"created_at"`
LastLoginAt string `json:"last_login_at"`
LastLoginIP string `json:"last_login_ip"`
TotalUploads int `json:"total_uploads"`
TotalDownloads int `json:"total_downloads"`
TotalStorage int64 `json:"total_storage"`
}
AdminUserDetail 管理员用户详细信息
type AdminUserFilesResponse ¶
type AdminUserFilesResponse struct {
Files []AdminFileDetail `json:"files"`
Username string `json:"username"`
Total int64 `json:"total"`
}
AdminUserFilesResponse 管理员用户文件响应
type AdminUserInfo ¶
type AdminUserInfo struct {
UserInfo
TotalUploads int `json:"total_uploads"`
TotalDownloads int `json:"total_downloads"`
TotalStorage int64 `json:"total_storage"`
LastLoginAt string `json:"last_login_at,omitempty"`
LastLoginIP string `json:"last_login_ip"`
}
AdminUserInfo 管理员用户信息
type AdminUserStatsResponse ¶
type AdminUserStatsResponse struct {
TotalUsers int64 `json:"total_users"`
ActiveUsers int64 `json:"active_users"`
TodayRegistrations int64 `json:"today_registrations"`
TodayUploads int64 `json:"today_uploads"`
}
AdminUserStatsResponse 管理员用户统计响应
type AdminUserStatusRequest ¶
type AdminUserStatusRequest struct {
Status string `json:"status" binding:"required"`
}
AdminUserStatusRequest 管理员用户状态请求
type AdminUserUpdateRequest ¶
type AdminUserUpdateRequest struct {
Username string `json:"username"`
Email string `json:"email"`
Nickname string `json:"nickname"`
Role string `json:"role"`
Status string `json:"status"`
}
AdminUserUpdateRequest 管理员更新用户请求
type AdminUsersListResponse ¶
type AdminUsersListResponse struct {
Users []AdminUserDetail `json:"users"`
Stats AdminUserStatsResponse `json:"stats"`
Pagination PaginationResponse `json:"pagination"`
}
AdminUsersListResponse 管理员用户列表响应
type AdminUsersRequest ¶
type AdminUsersRequest struct {
Page int `json:"page" form:"page"`
PageSize int `json:"page_size" form:"page_size"`
Search string `json:"search" form:"search"`
Status string `json:"status" form:"status"`
}
AdminUsersRequest 管理员用户列表请求
type AdminUsersResponse ¶
type AdminUsersResponse struct {
Users []AdminUserInfo `json:"users"`
Pagination PaginationInfo `json:"pagination"`
}
AdminUsersResponse 管理员用户列表响应
type AuthLoginRequest ¶
type AuthLoginRequest struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
}
AuthLoginRequest 登录请求
type AuthLoginResponse ¶
type AuthLoginResponse struct {
Token string `json:"token"`
TokenType string `json:"token_type"`
ExpiresIn int64 `json:"expires_in"`
User *UserInfo `json:"user"`
}
AuthLoginResponse 登录响应
type AuthRegisterRequest ¶
type AuthRegisterRequest struct {
Username string `json:"username" binding:"required"`
Email string `json:"email" binding:"required"`
Password string `json:"password" binding:"required"`
Nickname string `json:"nickname"`
}
AuthRegisterRequest 注册请求
type AuthRegisterResponse ¶
type AuthRegisterResponse struct {
ID uint `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Nickname string `json:"nickname"`
Role string `json:"role"`
}
AuthRegisterResponse 注册响应
type BackupPathResponse ¶
type BackupPathResponse struct {
BackupPath string `json:"backup_path"`
}
BackupPathResponse 备份路径响应
type ChunkUploadCompleteRequest ¶
type ChunkUploadCompleteRequest struct {
ExpireValue int `json:"expire_value" binding:"required"`
ExpireStyle string `json:"expire_style" binding:"required"`
RequireAuth bool `json:"require_auth"`
}
ChunkUploadCompleteRequest 分片上传完成请求
type ChunkUploadCompleteResponse ¶
type ChunkUploadCompleteResponse struct {
Code string `json:"code"`
FileName string `json:"file_name"`
}
ChunkUploadCompleteResponse 分片上传完成响应
type ChunkUploadInitRequest ¶
type ChunkUploadInitRequest struct {
FileName string `json:"file_name" binding:"required"`
FileSize int64 `json:"file_size" binding:"required"`
ChunkSize int `json:"chunk_size" binding:"required"`
FileHash string `json:"file_hash" binding:"required"`
}
ChunkUploadInitRequest 分片上传初始化请求
type ChunkUploadInitResponse ¶
type ChunkUploadInitResponse struct {
UploadID string `json:"upload_id"`
TotalChunks int `json:"total_chunks"`
ChunkSize int `json:"chunk_size"`
UploadedCount int `json:"uploaded_count"`
Progress float64 `json:"progress"`
}
ChunkUploadInitResponse 分片上传初始化响应
type ChunkUploadResponse ¶
type ChunkUploadResponse struct {
ChunkHash string `json:"chunk_hash"`
ChunkIndex int `json:"chunk_index"`
Progress float64 `json:"progress"`
}
ChunkUploadResponse 分片上传响应
type ChunkUploadStatusResponse ¶
type ChunkUploadStatusResponse struct {
UploadID string `json:"upload_id"`
Status string `json:"status"`
Progress float64 `json:"progress"`
TotalChunks int `json:"total_chunks"`
UploadedCount int `json:"uploaded_count"`
FileName string `json:"file_name"`
FileSize int64 `json:"file_size"`
}
ChunkUploadStatusResponse 分片上传状态响应
type ChunkValidationResponse ¶
type ChunkValidationResponse struct {
Valid bool `json:"valid"`
}
ChunkValidationResponse 分片验证响应
type CleanedCountResponse ¶
type CleanedCountResponse struct {
CleanedCount int `json:"cleaned_count"`
}
CleanedCountResponse 清理计数响应
type ControlDataRequest ¶ added in v1.7.1
type ControlDataRequest struct {
Action string `json:"action" binding:"required"` // "start" 或 "stop"
}
type ErrorResponse ¶
type ErrorResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Error string `json:"error,omitempty"`
}
ErrorResponse 错误响应
type FileInfo ¶
type FileInfo struct {
Code string `json:"code"`
FileName string `json:"file_name"`
Size int64 `json:"size"`
UploadType string `json:"upload_type"`
RequireAuth bool `json:"require_auth"`
UsedCount int `json:"used_count"`
ExpiredCount int `json:"expired_count"`
ExpiredAt *time.Time `json:"expired_at"`
CreatedAt time.Time `json:"created_at"`
IsExpired bool `json:"is_expired"`
}
FileInfo 文件信息
func ConvertFileCodeSliceToFileInfoSlice ¶
ConvertFileCodeSliceToFileInfoSlice 将 []models.FileCode 转换为 []FileInfo
func ConvertFileCodeToFileInfo ¶
ConvertFileCodeToFileInfo 将 models.FileCode 转换为 web.FileInfo
type FileInfoResponse ¶
type FileInfoResponse struct {
Code string `json:"code"`
Name string `json:"name"`
Size int64 `json:"size"`
Text string `json:"text,omitempty"` // 文本内容或下载链接
UploadType string `json:"upload_type"`
RequireAuth bool `json:"require_auth"`
}
FileInfoResponse 文件信息响应
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
Timestamp string `json:"timestamp"`
Version string `json:"version"`
}
HealthResponse 健康检查响应
type LogPathResponse ¶
type LogPathResponse struct {
LogPath string `json:"log_path"`
}
LogPathResponse 日志路径响应
type LogsResponse ¶ added in v1.7.1
LogsResponse 日志响应
type MCPStatusResponse ¶ added in v1.7.1
type MCPStatusResponse struct {
Status string `json:"status"`
Config *config.MCPConfig `json:"config"`
}
MCPStatusResponse MCP状态响应
type MCPTestResponse ¶ added in v1.7.1
type MCPTestResponse struct {
MCPStatusResponse
}
MCPTestResponse MCP连接测试响应
type PaginatedResponse ¶
type PaginatedResponse struct {
List interface{} `json:"list"`
Pagination PaginationInfo `json:"pagination"`
}
PaginatedResponse 分页响应
type PaginationInfo ¶
type PaginationInfo struct {
Page int `json:"page"`
PageSize int `json:"page_size"`
Total int64 `json:"total"`
TotalPages int `json:"total_pages"`
HasNext bool `json:"has_next"`
HasPrev bool `json:"has_prev"`
}
PaginationInfo 分页信息
type PaginationResponse ¶
type PaginationResponse struct {
Page int `json:"page"`
PageSize int `json:"page_size"`
Total int64 `json:"total"`
Pages int64 `json:"pages"`
}
PaginationResponse 分页响应
type ShareStatsResponse ¶
type ShareStatsResponse struct {
}
ShareStatsResponse 分享统计响应
func ConvertShareStatsToWeb ¶
func ConvertShareStatsToWeb(data *service.ShareStatsData) *ShareStatsResponse
ConvertShareStatsToWeb 将服务层分享统计数据转换为Web响应
type StorageConnectionResponse ¶
StorageConnectionResponse 存储连接响应
type StorageInfoResponse ¶
type StorageInfoResponse struct {
Current string `json:"current"`
Available []string `json:"available"`
StorageDetails map[string]WebStorageDetail `json:"storage_details"`
StorageConfig *config.StorageConfig `json:"storage_config"`
}
StorageInfoResponse 存储信息响应
type StorageSwitchRequest ¶
type StorageSwitchRequest struct {
Type string `json:"type" binding:"required"`
Config *config.StorageConfig `json:"config,omitempty"`
}
StorageSwitchRequest 存储切换请求
type StorageSwitchResponse ¶
type StorageSwitchResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
CurrentType string `json:"current_type"`
}
StorageSwitchResponse 存储切换响应
type StorageTestRequest ¶
type StorageTestRequest struct {
Type string `json:"type" binding:"required"`
Config *config.StorageConfig `json:"config" binding:"required"`
}
StorageTestRequest 存储测试请求
type StorageTestResponse ¶
type StorageTestResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Details string `json:"details,omitempty"`
}
StorageTestResponse 存储测试响应
type SuccessResponse ¶
type SuccessResponse struct {
Code int `json:"code"`
Message string `json:"message,omitempty"`
Data interface{} `json:"data,omitempty"`
}
SuccessResponse 成功响应结构
type SystemInfoResponse ¶
type SystemInfoResponse struct {
OS string `json:"os"`
Arch string `json:"arch"`
Version string `json:"version"`
Go string `json:"go"`
Uptime string `json:"uptime"`
Memory string `json:"memory"`
Database string `json:"database"`
}
SystemInfoResponse 系统信息响应
type TasksResponse ¶ added in v1.7.1
type TasksResponse struct {
Tasks interface{} `json:"tasks"` // 使用 interface{} 以兼容现有类型
Total int `json:"total"`
}
TasksResponse 任务响应
type TestDataRequest ¶ added in v1.7.1
type TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
UserInfo interface{} `json:"user_info,omitempty"`
}
TokenResponse 令牌响应
type UploadInfoResponse ¶
type UploadInfoResponse struct {
DownloadLink string `json:"download_link"`
}
UploadInfoResponse 上传信息响应
type UserDataRequest ¶ added in v1.7.1
type UserFilesRequest ¶
type UserFilesRequest struct {
Page int `json:"page" form:"page"`
PageSize int `json:"page_size" form:"page_size"`
Search string `json:"search" form:"search"`
}
UserFilesRequest 用户文件列表请求
type UserFilesResponse ¶
type UserFilesResponse struct {
Files []FileInfo `json:"files"`
Pagination PaginationInfo `json:"pagination"`
}
UserFilesResponse 用户文件列表响应
type UserInfo ¶
type UserInfo struct {
ID uint `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Role string `json:"role"`
Status string `json:"status"`
EmailVerified bool `json:"email_verified"`
CreatedAt string `json:"created_at,omitempty"`
LastLoginAt string `json:"last_login_at,omitempty"`
}
UserInfo 用户信息
type UserPasswordChangeRequest ¶
type UserPasswordChangeRequest struct {
OldPassword string `json:"old_password" binding:"required"`
NewPassword string `json:"new_password" binding:"required"`
}
UserPasswordChangeRequest 密码修改请求
type UserPasswordResetRequest ¶
type UserPasswordResetRequest struct {
Email string `json:"email" binding:"required"`
}
UserPasswordResetRequest 密码重置请求
type UserProfileResponse ¶
type UserProfileResponse struct {
ID uint `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Role string `json:"role"`
Status string `json:"status"`
EmailVerified bool `json:"email_verified"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
UserProfileResponse 用户资料响应
type UserProfileUpdateRequest ¶
type UserProfileUpdateRequest struct {
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
}
UserProfileUpdateRequest 用户资料更新请求
type UserStatsResponse ¶
type UserStatsResponse struct {
TotalUploads int `json:"total_uploads"`
TotalDownloads int `json:"total_downloads"`
TotalStorage int64 `json:"total_storage"`
MaxUploadSize int64 `json:"max_upload_size"`
MaxStorageQuota int64 `json:"max_storage_quota"`
CurrentFiles int `json:"current_files"`
FileCount int `json:"file_count"`
LastLoginAt string `json:"last_login_at,omitempty"`
LastLoginIP string `json:"last_login_ip"`
EmailVerified bool `json:"email_verified"`
Status string `json:"status"`
Role string `json:"role"`
LastUploadAt string `json:"last_upload_at,omitempty"`
LastDownloadAt string `json:"last_download_at,omitempty"`
}
UserStatsResponse 用户统计响应
func ConvertUserStatsToWeb ¶
func ConvertUserStatsToWeb(data *service.UserStatsData) *UserStatsResponse
ConvertUserStatsToWeb 将服务层用户统计数据转换为Web响应
type UserSystemInfoResponse ¶
type UserSystemInfoResponse struct {
// 使用整型 0/1 表示开关,以与配置层和前端保持一致
UserSystemEnabled int `json:"user_system_enabled"`
AllowUserRegistration int `json:"allow_user_registration"`
RequireEmailVerification int `json:"require_email_verification"`
}
UserSystemInfoResponse 用户系统信息响应
type WebStorageDetail ¶ added in v1.7.1
type WebStorageDetail struct {
Type string `json:"type"`
Available bool `json:"available"`
Error string `json:"error,omitempty"`
// StoragePath 本存储的路径或标识(例如本地目录、S3 bucket)
StoragePath string `json:"storage_path,omitempty"`
// UsagePercent 使用率(0-100),如果无法获取则为 nil
UsagePercent *int `json:"usage_percent,omitempty"`
}
WebStorageDetail Web API 存储详情