web

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 AdminOperationLogItem added in v1.9.5

type AdminOperationLogItem struct {
	ID        uint   `json:"id"`
	Action    string `json:"action"`
	Target    string `json:"target"`
	Success   bool   `json:"success"`
	Message   string `json:"message"`
	ActorID   *uint  `json:"actor_id,omitempty"`
	ActorName string `json:"actor_name"`
	IP        string `json:"ip"`
	LatencyMs int64  `json:"latency_ms"`
	CreatedAt string `json:"created_at"`
}

AdminOperationLogItem 管理员操作审计记录项

type AdminOperationLogListResponse added in v1.9.5

type AdminOperationLogListResponse struct {
	Logs       []AdminOperationLogItem `json:"logs"`
	Pagination PaginationResponse      `json:"pagination"`
}

AdminOperationLogListResponse 管理员操作审计列表响应

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"`
	ShareURL string `json:"share_url"`
	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 CountResponse

type CountResponse struct {
	Count int `json:"count"`
}

CountResponse 通用计数响应

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

func ConvertFileCodeSliceToFileInfoSlice(fileCodes []models.FileCode) []FileInfo

ConvertFileCodeSliceToFileInfoSlice 将 []models.FileCode 转换为 []FileInfo

func ConvertFileCodeToFileInfo

func ConvertFileCodeToFileInfo(fileCode *models.FileCode) *FileInfo

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 IDResponse

type IDResponse struct {
	ID uint `json:"id"`
}

IDResponse 通用ID响应

type LogPathResponse

type LogPathResponse struct {
	LogPath string `json:"log_path"`
}

LogPathResponse 日志路径响应

type LogsResponse added in v1.7.1

type LogsResponse struct {
	Logs  []string `json:"logs"`
	Total int      `json:"total"`
}

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 ShareCodeRequest

type ShareCodeRequest struct {
	Code string `json:"code" form:"code" binding:"required"`
}

ShareCodeRequest 分享代码请求

type ShareFileRequest

type ShareFileRequest struct {
	ExpireValue int    `json:"expire_value" form:"expire_value"`
	ExpireStyle string `json:"expire_style" form:"expire_style"`
	RequireAuth bool   `json:"require_auth" form:"require_auth"`
}

ShareFileRequest 分享文件请求

type ShareResponse

type ShareResponse struct {
	Code      string     `json:"code"`
	ShareURL  string     `json:"share_url"`
	FileName  string     `json:"file_name,omitempty"`
	ExpiredAt *time.Time `json:"expired_at"`
}

ShareResponse 分享响应

type ShareStatsResponse

type ShareStatsResponse struct {
	Code         string     `json:"code"`
	FileName     string     `json:"file_name"`
	FileSize     int64      `json:"file_size"`
	UsedCount    int        `json:"used_count"`
	ExpiredCount int        `json:"expired_count"`
	ExpiredAt    *time.Time `json:"expired_at"`
	UploadType   string     `json:"upload_type"`
	RequireAuth  bool       `json:"require_auth"`
	IsExpired    bool       `json:"is_expired"`
	CreatedAt    time.Time  `json:"created_at"`
}

ShareStatsResponse 分享统计响应

func ConvertShareStatsToWeb

func ConvertShareStatsToWeb(data *service.ShareStatsData) *ShareStatsResponse

ConvertShareStatsToWeb 将服务层分享统计数据转换为Web响应

type ShareTextRequest

type ShareTextRequest struct {
	Text        string `json:"text" binding:"required"`
	ExpireValue int    `json:"expire_value"`
	ExpireStyle string `json:"expire_style"`
	RequireAuth bool   `json:"require_auth"`
}

ShareTextRequest 分享文本请求

type StorageConnectionResponse

type StorageConnectionResponse struct {
	Type   string `json:"type"`
	Status string `json:"status"`
}

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 TestDataRequest struct {
	Port string `json:"port"`
	Host string `json:"host"`
}

type TokenResponse

type TokenResponse struct {
	Token    string      `json:"token"`
	UserInfo interface{} `json:"user_info,omitempty"`
}

TokenResponse 令牌响应

type TransferLogItem added in v1.9.5

type TransferLogItem struct {
	ID         uint   `json:"id"`
	Operation  string `json:"operation"`
	FileCode   string `json:"file_code"`
	FileName   string `json:"file_name"`
	FileSize   int64  `json:"file_size"`
	UserID     *uint  `json:"user_id,omitempty"`
	Username   string `json:"username"`
	IP         string `json:"ip"`
	DurationMs int64  `json:"duration_ms"`
	CreatedAt  string `json:"created_at"`
}

TransferLogItem 审计日志单条记录

type TransferLogListResponse added in v1.9.5

type TransferLogListResponse struct {
	Logs       []TransferLogItem  `json:"logs"`
	Pagination PaginationResponse `json:"pagination"`
}

TransferLogListResponse 审计日志列表响应

type UploadInfoResponse

type UploadInfoResponse struct {
	ShareCode    string `json:"share_code"`
	DownloadLink string `json:"download_link"`
}

UploadInfoResponse 上传信息响应

type UserAPIKeyCreateRequest added in v1.9.9

type UserAPIKeyCreateRequest struct {
	Name          string  `json:"name"`
	ExpiresInDays *int    `json:"expires_in_days"`
	ExpiresAt     *string `json:"expires_at"`
}

UserAPIKeyCreateRequest 用户 API Key 创建请求 可以指定名称以及过期时间(expires_in_days 或 RFC3339 格式的 expires_at)

type UserAPIKeyCreateResponse added in v1.9.9

type UserAPIKeyCreateResponse struct {
	Key    string             `json:"key"`
	APIKey UserAPIKeyResponse `json:"api_key"`
}

type UserAPIKeyListResponse added in v1.9.9

type UserAPIKeyListResponse struct {
	Keys []UserAPIKeyResponse `json:"keys"`
}

UserAPIKeyListResponse 用户 API Key 列表响应

type UserAPIKeyResponse added in v1.9.9

type UserAPIKeyResponse struct {
	ID         uint   `json:"id"`
	Name       string `json:"name"`
	Prefix     string `json:"prefix"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
	LastUsedAt string `json:"last_used_at,omitempty"`
	ExpiresAt  string `json:"expires_at,omitempty"`
	RevokedAt  string `json:"revoked_at,omitempty"`
	Revoked    bool   `json:"revoked"`
}

func MakeUserAPIKeyResponse added in v1.9.9

func MakeUserAPIKeyResponse(key models.UserAPIKey) UserAPIKeyResponse

MakeUserAPIKeyResponse 将数据库模型转换为响应结构

type UserDataRequest added in v1.7.1

type UserDataRequest struct {
	Username string `json:"username" binding:"required"`
	Email    string `json:"email" binding:"omitempty,email"`
	Password string `json:"password" binding:"required"`
	Nickname string `json:"nickname"`
	IsAdmin  bool   `json:"is_admin"`
	IsActive bool   `json:"is_active"`
}

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 存储详情

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL