Documentation
¶
Index ¶
- type BatchCreateReadyResourceRequest
- type BatchReadyResourceRequest
- type BatchTransferInputData
- type BatchTransferOutputData
- type BatchTransferTaskConfig
- type CategoryResponse
- type ChangePasswordRequest
- type CksResponse
- type CleanupTaskConfig
- type CreateCategoryRequest
- type CreateCksRequest
- type CreatePanRequest
- type CreateReadyResourceRequest
- type CreateResourceRequest
- type CreateTagRequest
- type CreateUserRequest
- type DailySearchStatResponse
- type DataSyncTaskConfig
- type FileDeleteRequest
- type FileListRequest
- type FileListResponse
- type FileResponse
- type FileUpdateRequest
- type FileUploadRequest
- type FileUploadResponse
- type HotDramaListResponse
- type HotDramaRequest
- type HotDramaResponse
- type HotKeywordResponse
- type LoginRequest
- type LoginResponse
- type PanResponse
- type ReadyResourceRequest
- type ReadyResourceResponse
- type RegisterRequest
- type ResourceResponse
- type SearchRequest
- type SearchResponse
- type SearchStatRequest
- type SearchStatResponse
- type SearchStatsResponse
- type SearchTrendResponse
- type Stats
- type SystemConfigItem
- type SystemConfigListResponse
- type SystemConfigRequest
- type SystemConfigResponse
- type TagResponse
- type TaskConfig
- type TaskItemData
- type UpdateCategoryRequest
- type UpdateCksRequest
- type UpdatePanRequest
- type UpdateResourceRequest
- type UpdateTagRequest
- type UpdateUserRequest
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchCreateReadyResourceRequest ¶
type BatchCreateReadyResourceRequest struct {
Resources []CreateReadyResourceRequest `json:"resources" binding:"required"`
}
BatchCreateReadyResourceRequest 批量创建待处理资源请求
type BatchReadyResourceRequest ¶
type BatchReadyResourceRequest struct {
Resources []ReadyResourceRequest `json:"resources" validate:"required"`
}
BatchReadyResourceRequest 批量待处理资源请求
type BatchTransferInputData ¶ added in v1.2.0
type BatchTransferInputData struct {
Title string `json:"title"` // 资源标题
URL string `json:"url"` // 资源链接
CategoryID *uint `json:"category_id"` // 分类ID
TagIDs []uint `json:"tag_ids"` // 标签ID列表
}
BatchTransferInputData 批量转存任务的输入数据
func (BatchTransferInputData) GetDisplayName ¶ added in v1.2.0
func (data BatchTransferInputData) GetDisplayName() string
GetDisplayName 实现TaskItemData接口
func (BatchTransferInputData) Validate ¶ added in v1.2.0
func (data BatchTransferInputData) Validate() error
Validate 验证批量转存输入数据
type BatchTransferOutputData ¶ added in v1.2.0
type BatchTransferOutputData struct {
ResourceID uint `json:"resource_id"` // 创建的资源ID
SaveURL string `json:"save_url"` // 转存后的链接
PlatformID uint `json:"platform_id"` // 平台ID
}
BatchTransferOutputData 批量转存任务的输出数据
func (BatchTransferOutputData) GetDisplayName ¶ added in v1.2.0
func (data BatchTransferOutputData) GetDisplayName() string
GetDisplayName 实现TaskItemData接口
func (BatchTransferOutputData) Validate ¶ added in v1.2.0
func (data BatchTransferOutputData) Validate() error
Validate 验证批量转存输出数据
type BatchTransferTaskConfig ¶ added in v1.2.0
type BatchTransferTaskConfig struct {
CategoryID *uint `json:"category_id"` // 默认分类ID
TagIDs []uint `json:"tag_ids"` // 默认标签ID列表
}
BatchTransferTaskConfig 批量转存任务配置
func (BatchTransferTaskConfig) Validate ¶ added in v1.2.0
func (config BatchTransferTaskConfig) Validate() error
Validate 验证批量转存任务配置
type CategoryResponse ¶
type CategoryResponse struct {
ID uint `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ResourceCount int64 `json:"resource_count"`
TagNames []string `json:"tag_names"`
}
CategoryResponse 分类响应
type ChangePasswordRequest ¶
type ChangePasswordRequest struct {
NewPassword string `json:"new_password" binding:"required,min=6"`
}
ChangePasswordRequest 修改密码请求
type CksResponse ¶
type CksResponse struct {
ID uint `json:"id"`
PanID uint `json:"pan_id"`
Idx int `json:"idx"`
Ck string `json:"ck"`
IsValid bool `json:"is_valid"`
Space int64 `json:"space"`
LeftSpace int64 `json:"left_space"`
UsedSpace int64 `json:"used_space"`
Username string `json:"username"`
VipStatus bool `json:"vip_status"`
ServiceType string `json:"service_type"`
Remark string `json:"remark"`
Pan *PanResponse `json:"pan,omitempty"`
}
CksResponse Cookie响应
type CleanupTaskConfig ¶ added in v1.2.0
type CleanupTaskConfig struct {
RetentionDays int `json:"retention_days"` // 保留天数
CleanupType string `json:"cleanup_type"` // 清理类型
}
CleanupTaskConfig 清理任务配置(示例)
func (CleanupTaskConfig) Validate ¶ added in v1.2.0
func (config CleanupTaskConfig) Validate() error
Validate 验证清理任务配置
type CreateCategoryRequest ¶
type CreateCategoryRequest struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
}
CreateCategoryRequest 创建分类请求
type CreateCksRequest ¶
type CreateCksRequest struct {
PanID uint `json:"pan_id" binding:"required"`
Idx int `json:"idx"`
Ck string `json:"ck"`
IsValid bool `json:"is_valid"`
Space int64 `json:"space"`
LeftSpace int64 `json:"left_space"`
UsedSpace int64 `json:"used_space"`
Username string `json:"username"`
VipStatus bool `json:"vip_status"`
ServiceType string `json:"service_type"`
Remark string `json:"remark"`
}
CreateCksRequest 创建cookie请求
type CreatePanRequest ¶
type CreatePanRequest struct {
Name string `json:"name" binding:"required"`
Key int `json:"key"`
Icon string `json:"icon"`
Remark string `json:"remark"`
}
CreatePanRequest 创建平台请求
type CreateReadyResourceRequest ¶
type CreateReadyResourceRequest struct {
Title *string `json:"title"`
Description string `json:"description"`
URL []string `json:"url" binding:"required"`
Category string `json:"category"`
Tags string `json:"tags"`
Img string `json:"img"`
Source string `json:"source"`
Extra string `json:"extra"`
IP *string `json:"ip"`
Key string `json:"key"`
}
CreateReadyResourceRequest 创建待处理资源请求
type CreateResourceRequest ¶
type CreateResourceRequest struct {
Title string `json:"title" binding:"required"`
Description string `json:"description"`
URL string `json:"url"`
PanID *uint `json:"pan_id"`
SaveURL string `json:"save_url"`
FileSize string `json:"file_size"`
CategoryID *uint `json:"category_id"`
IsValid bool `json:"is_valid"`
IsPublic bool `json:"is_public"`
TagIDs []uint `json:"tag_ids"`
Cover string `json:"cover"`
Author string `json:"author"`
ErrorMsg string `json:"error_msg"`
}
CreateResourceRequest 创建资源请求
type CreateTagRequest ¶
type CreateTagRequest struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
CategoryID *uint `json:"category_id"`
}
CreateTagRequest 创建标签请求
type CreateUserRequest ¶
type CreateUserRequest struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
Email string `json:"email" binding:"required,email"`
Role string `json:"role"`
IsActive bool `json:"is_active"`
}
CreateUserRequest 创建用户请求
type DailySearchStatResponse ¶
type DailySearchStatResponse struct {
Date time.Time `json:"date"`
TotalSearches int `json:"total_searches"`
UniqueKeywords int `json:"unique_keywords"`
}
DailySearchStatResponse 每日搜索统计响应
type DataSyncTaskConfig ¶ added in v1.2.0
type DataSyncTaskConfig struct {
SourceType string `json:"source_type"` // 数据源类型
TargetType string `json:"target_type"` // 目标类型
SyncMode string `json:"sync_mode"` // 同步模式
}
DataSyncTaskConfig 数据同步任务配置(示例)
func (DataSyncTaskConfig) Validate ¶ added in v1.2.0
func (config DataSyncTaskConfig) Validate() error
Validate 验证数据同步任务配置
type FileDeleteRequest ¶ added in v1.2.3
type FileDeleteRequest struct {
IDs []uint `json:"ids" binding:"required"`
}
FileDeleteRequest 文件删除请求
type FileListRequest ¶ added in v1.2.3
type FileListRequest struct {
Page int `json:"page" form:"page"`
PageSize int `json:"page_size" form:"page_size"`
Search string `json:"search" form:"search"`
FileType string `json:"file_type" form:"file_type"`
Status string `json:"status" form:"status"`
UserID uint `json:"user_id" form:"user_id"`
}
FileListRequest 文件列表请求
type FileListResponse ¶ added in v1.2.3
type FileListResponse struct {
Files []FileResponse `json:"files"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
}
FileListResponse 文件列表响应
type FileResponse ¶ added in v1.2.3
type FileResponse struct {
ID uint `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
// 文件信息
OriginalName string `json:"original_name"`
FileName string `json:"file_name"`
FilePath string `json:"file_path"`
FileSize int64 `json:"file_size"`
FileType string `json:"file_type"`
MimeType string `json:"mime_type"`
FileHash string `json:"file_hash"`
// 访问信息
AccessURL string `json:"access_url"`
// 用户信息
UserID uint `json:"user_id"`
User string `json:"user"` // 用户名
// 状态信息
Status string `json:"status"`
IsPublic bool `json:"is_public"`
IsDeleted bool `json:"is_deleted"`
}
FileResponse 文件响应
type FileUpdateRequest ¶ added in v1.2.3
type FileUpdateRequest struct {
ID uint `json:"id" binding:"required"`
IsPublic *bool `json:"is_public"`
Status string `json:"status"`
}
FileUpdateRequest 文件更新请求
type FileUploadRequest ¶ added in v1.2.3
type FileUploadRequest struct {
IsPublic bool `json:"is_public" form:"is_public"` // 是否公开
FileHash string `json:"file_hash" form:"file_hash"` // 文件哈希值
}
FileUploadRequest 文件上传请求
type FileUploadResponse ¶ added in v1.2.3
type FileUploadResponse struct {
File FileResponse `json:"file"`
Message string `json:"message"`
Success bool `json:"success"`
IsDuplicate bool `json:"is_duplicate"` // 是否为重复文件
}
FileUploadResponse 文件上传响应
type HotDramaListResponse ¶
type HotDramaListResponse struct {
Total int `json:"total"`
Items []HotDramaResponse `json:"items"`
}
HotDramaListResponse 热播剧列表响应
type HotDramaRequest ¶
type HotDramaRequest struct {
Title string `json:"title" validate:"required"`
CardSubtitle string `json:"card_subtitle"`
EpisodesInfo string `json:"episodes_info"`
IsNew bool `json:"is_new"`
Rating float64 `json:"rating"`
RatingCount int `json:"rating_count"`
Year string `json:"year"`
Region string `json:"region"`
Genres string `json:"genres"`
Directors string `json:"directors"`
Actors string `json:"actors"`
PosterURL string `json:"poster_url"`
Category string `json:"category"`
SubType string `json:"sub_type"`
Source string `json:"source"`
DoubanID string `json:"douban_id"`
DoubanURI string `json:"douban_uri"`
}
HotDramaRequest 热播剧请求
type HotDramaResponse ¶
type HotDramaResponse struct {
ID uint `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Title string `json:"title"`
CardSubtitle string `json:"card_subtitle"`
EpisodesInfo string `json:"episodes_info"`
IsNew bool `json:"is_new"`
Rating float64 `json:"rating"`
RatingCount int `json:"rating_count"`
Year string `json:"year"`
Region string `json:"region"`
Genres string `json:"genres"`
Directors string `json:"directors"`
Actors string `json:"actors"`
PosterURL string `json:"poster_url"`
Category string `json:"category"`
SubType string `json:"sub_type"`
Source string `json:"source"`
DoubanID string `json:"douban_id"`
DoubanURI string `json:"douban_uri"`
}
HotDramaResponse 热播剧响应
type HotKeywordResponse ¶
type HotKeywordResponse struct {
Keyword string `json:"keyword"`
Count int `json:"count"`
Rank int `json:"rank"`
}
HotKeywordResponse 热门关键词响应
type LoginRequest ¶
type LoginRequest struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
}
LoginRequest 登录请求
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
User UserResponse `json:"user"`
}
LoginResponse 登录响应
type PanResponse ¶
type PanResponse struct {
ID uint `json:"id"`
Name string `json:"name"`
Key int `json:"key"`
Icon string `json:"icon"`
Remark string `json:"remark"`
}
PanResponse 平台响应
type ReadyResourceRequest ¶
type ReadyResourceRequest struct {
Title string `json:"title" validate:"required" example:"示例资源标题"`
Description string `json:"description" example:"这是一个示例资源描述"`
Url []string `json:"url" validate:"required" example:"https://example.com/resource"`
Category string `json:"category" example:"示例分类"`
Tags string `json:"tags" example:"标签1,标签2"`
Img string `json:"img" example:"https://example.com/image.jpg"`
Source string `json:"source" example:"数据来源"`
Extra string `json:"extra" example:"额外信息"`
ErrorMsg string `json:"error_msg" example:"错误信息"`
}
ReadyResourceRequest 待处理资源请求
type ReadyResourceResponse ¶
type ReadyResourceResponse struct {
ID uint `json:"id"`
Title *string `json:"title"`
Description string `json:"description"`
URL string `json:"url"`
Category string `json:"category"`
Tags string `json:"tags"`
Img string `json:"img"`
Source string `json:"source"`
Extra string `json:"extra"`
Key string `json:"key"`
ErrorMsg string `json:"error_msg"`
CreateTime time.Time `json:"create_time"`
IP *string `json:"ip"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
IsDeleted bool `json:"is_deleted"`
}
ReadyResourceResponse 待处理资源响应
type RegisterRequest ¶
type RegisterRequest struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
Email string `json:"email" binding:"required,email"`
}
RegisterRequest 注册请求
type ResourceResponse ¶
type ResourceResponse struct {
ID uint `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
URL string `json:"url"`
PanID *uint `json:"pan_id"`
SaveURL string `json:"save_url"`
FileSize string `json:"file_size"`
CategoryID *uint `json:"category_id"`
CategoryName string `json:"category_name"`
ViewCount int `json:"view_count"`
IsValid bool `json:"is_valid"`
IsPublic bool `json:"is_public"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Tags []TagResponse `json:"tags"`
Cover string `json:"cover"`
Author string `json:"author"`
ErrorMsg string `json:"error_msg"`
}
ResourceResponse 资源响应
type SearchRequest ¶
type SearchRequest struct {
Query string `json:"query"`
CategoryID *uint `json:"category_id"`
Page int `json:"page"`
Limit int `json:"limit"`
}
SearchRequest 搜索请求
type SearchResponse ¶
type SearchResponse struct {
Resources []ResourceResponse `json:"resources"`
Total int64 `json:"total"`
Page int `json:"page"`
Limit int `json:"limit"`
}
SearchResponse 搜索响应
type SearchStatRequest ¶
type SearchStatRequest struct {
Keyword string `json:"keyword" binding:"required"`
}
SearchStatRequest 搜索统计请求
type SearchStatResponse ¶
type SearchStatResponse struct {
ID uint `json:"id"`
Keyword string `json:"keyword"`
Count int `json:"count"`
Date time.Time `json:"date"`
CreatedAt time.Time `json:"created_at"`
}
SearchStatResponse 搜索统计响应
type SearchStatsResponse ¶
type SearchStatsResponse struct {
TodaySearches int `json:"today_searches"`
WeekSearches int `json:"week_searches"`
MonthSearches int `json:"month_searches"`
HotKeywords []HotKeywordResponse `json:"hot_keywords"`
DailyStats []DailySearchStatResponse `json:"daily_stats"`
SearchTrend SearchTrendResponse `json:"search_trend"`
}
SearchStatsResponse 搜索统计总览响应
type SearchTrendResponse ¶
SearchTrendResponse 搜索趋势响应
type Stats ¶
type Stats struct {
TotalResources int64 `json:"total_resources"`
TotalCategories int64 `json:"total_categories"`
TotalTags int64 `json:"total_tags"`
TotalViews int64 `json:"total_views"`
}
Stats 统计信息
type SystemConfigItem ¶ added in v1.0.10
type SystemConfigItem struct {
Key string `json:"key"`
Value string `json:"value"`
Type string `json:"type"`
}
SystemConfigItem 单个配置项
type SystemConfigListResponse ¶ added in v1.0.10
type SystemConfigListResponse struct {
Configs []SystemConfigItem `json:"configs"`
}
SystemConfigListResponse 配置列表响应
type SystemConfigRequest ¶
type SystemConfigRequest struct {
// SEO 配置
SiteTitle *string `json:"site_title,omitempty"`
SiteDescription *string `json:"site_description,omitempty"`
Keywords *string `json:"keywords,omitempty"`
Author *string `json:"author,omitempty"`
Copyright *string `json:"copyright,omitempty"`
SiteLogo *string `json:"site_logo,omitempty"`
// 自动处理配置组
AutoProcessReadyResources *bool `json:"auto_process_ready_resources,omitempty"` // 自动处理待处理资源
AutoProcessInterval *int `json:"auto_process_interval,omitempty"` // 自动处理间隔(分钟)
AutoTransferEnabled *bool `json:"auto_transfer_enabled,omitempty"` // 开启自动转存
AutoTransferLimitDays *int `json:"auto_transfer_limit_days,omitempty"` // 自动转存限制天数(0表示不限制)
AutoTransferMinSpace *int `json:"auto_transfer_min_space,omitempty"` // 最小存储空间(GB)
AutoFetchHotDramaEnabled *bool `json:"auto_fetch_hot_drama_enabled,omitempty"` // 自动拉取热播剧名字
// API配置
ApiToken *string `json:"api_token,omitempty"` // 公开API访问令牌
// 违禁词配置
ForbiddenWords *string `json:"forbidden_words,omitempty"` // 违禁词列表,用逗号分隔
// 广告配置
AdKeywords *string `json:"ad_keywords,omitempty"` // 广告关键词列表,用逗号分隔
AutoInsertAd *string `json:"auto_insert_ad,omitempty"` // 自动插入广告内容
// 其他配置
PageSize *int `json:"page_size,omitempty"`
MaintenanceMode *bool `json:"maintenance_mode,omitempty"`
EnableRegister *bool `json:"enable_register,omitempty"` // 开启注册功能
// 三方统计配置
ThirdPartyStatsCode *string `json:"third_party_stats_code,omitempty"` // 三方统计代码
}
SystemConfigRequest 系统配置请求
type SystemConfigResponse ¶
type SystemConfigResponse struct {
ID uint `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
// SEO 配置
SiteTitle string `json:"site_title"`
SiteDescription string `json:"site_description"`
Keywords string `json:"keywords"`
Author string `json:"author"`
Copyright string `json:"copyright"`
SiteLogo string `json:"site_logo"`
// 自动处理配置组
AutoProcessReadyResources bool `json:"auto_process_ready_resources"` // 自动处理待处理资源
AutoProcessInterval int `json:"auto_process_interval"` // 自动处理间隔(分钟)
AutoTransferEnabled bool `json:"auto_transfer_enabled"` // 开启自动转存
AutoTransferLimitDays int `json:"auto_transfer_limit_days"` // 自动转存限制天数(0表示不限制)
AutoTransferMinSpace int `json:"auto_transfer_min_space"` // 最小存储空间(GB)
AutoFetchHotDramaEnabled bool `json:"auto_fetch_hot_drama_enabled"` // 自动拉取热播剧名字
// API配置
ApiToken string `json:"api_token"` // 公开API访问令牌
// 违禁词配置
ForbiddenWords string `json:"forbidden_words"` // 违禁词列表,用逗号分隔
// 广告配置
AdKeywords string `json:"ad_keywords"` // 广告关键词列表,用逗号分隔
AutoInsertAd string `json:"auto_insert_ad"` // 自动插入广告内容
// 其他配置
PageSize int `json:"page_size"`
MaintenanceMode bool `json:"maintenance_mode"`
EnableRegister bool `json:"enable_register"` // 开启注册功能
// 三方统计配置
ThirdPartyStatsCode string `json:"third_party_stats_code"` // 三方统计代码
}
SystemConfigResponse 系统配置响应
type TagResponse ¶
type TagResponse struct {
ID uint `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
CategoryID *uint `json:"category_id"`
CategoryName string `json:"category_name"`
ResourceCount int64 `json:"resource_count"`
}
TagResponse 标签响应
type TaskConfig ¶ added in v1.2.0
type TaskConfig interface {
// Validate 验证配置有效性
Validate() error
}
TaskConfig 通用任务配置接口
type TaskItemData ¶ added in v1.2.0
type TaskItemData interface {
// GetDisplayName 获取显示名称(用于前端显示)
GetDisplayName() string
// Validate 验证数据有效性
Validate() error
}
TaskItemData 通用任务项数据接口
type UpdateCategoryRequest ¶
type UpdateCategoryRequest struct {
Name string `json:"name"`
Description string `json:"description"`
}
UpdateCategoryRequest 更新分类请求
type UpdateCksRequest ¶
type UpdateCksRequest struct {
PanID uint `json:"pan_id"`
Idx int `json:"idx"`
Ck string `json:"ck"`
IsValid bool `json:"is_valid"`
Space int64 `json:"space"`
LeftSpace int64 `json:"left_space"`
UsedSpace int64 `json:"used_space"`
Username string `json:"username"`
VipStatus bool `json:"vip_status"`
ServiceType string `json:"service_type"`
Remark string `json:"remark"`
}
UpdateCksRequest 更新cookie请求
type UpdatePanRequest ¶
type UpdatePanRequest struct {
Name string `json:"name"`
Key int `json:"key"`
Icon string `json:"icon"`
Remark string `json:"remark"`
}
UpdatePanRequest 更新平台请求
type UpdateResourceRequest ¶
type UpdateResourceRequest struct {
Title string `json:"title"`
Description string `json:"description"`
URL string `json:"url"`
PanID *uint `json:"pan_id"`
SaveURL string `json:"save_url"`
FileSize string `json:"file_size"`
CategoryID *uint `json:"category_id"`
IsValid bool `json:"is_valid"`
IsPublic bool `json:"is_public"`
TagIDs []uint `json:"tag_ids"`
Cover string `json:"cover"`
Author string `json:"author"`
ErrorMsg string `json:"error_msg"`
}
UpdateResourceRequest 更新资源请求
type UpdateTagRequest ¶
type UpdateTagRequest struct {
Name string `json:"name"`
Description string `json:"description"`
CategoryID *uint `json:"category_id"`
}
UpdateTagRequest 更新标签请求
type UpdateUserRequest ¶
type UpdateUserRequest struct {
Username string `json:"username"`
Email string `json:"email"`
Role string `json:"role"`
IsActive bool `json:"is_active"`
}
UpdateUserRequest 更新用户请求
type UserResponse ¶
type UserResponse struct {
ID uint `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Role string `json:"role"`
IsActive bool `json:"is_active"`
LastLogin *time.Time `json:"last_login"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
UserResponse 用户响应