handlers

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchCreateReadyResources

func BatchCreateReadyResources(c *gin.Context)

BatchCreateReadyResources 批量创建待处理资源

func BatchDeleteResources added in v1.0.8

func BatchDeleteResources(c *gin.Context)

BatchDeleteResources 批量删除资源

func ChangePassword

func ChangePassword(c *gin.Context)

ChangePassword 修改用户密码(管理员)

func CheckResourceExists

func CheckResourceExists(c *gin.Context)

CheckResourceExists 检查资源是否存在(测试FindExists函数)

func CheckUpdate

func CheckUpdate(c *gin.Context)

CheckUpdate 检查更新

func ClearReadyResources

func ClearReadyResources(c *gin.Context)

ClearReadyResources 清空所有待处理资源

func CreateCategory

func CreateCategory(c *gin.Context)

CreateCategory 创建分类

func CreateCks

func CreateCks(c *gin.Context)

CreateCks 创建Cookie

func CreateHotDrama

func CreateHotDrama(c *gin.Context)

CreateHotDrama 创建热播剧记录

func CreatePan

func CreatePan(c *gin.Context)

CreatePan 创建平台

func CreateReadyResource

func CreateReadyResource(c *gin.Context)

CreateReadyResource 创建待处理资源

func CreateReadyResourcesFromText

func CreateReadyResourcesFromText(c *gin.Context)

CreateReadyResourcesFromText 从文本创建待处理资源

func CreateResource

func CreateResource(c *gin.Context)

CreateResource 创建资源

func CreateTag

func CreateTag(c *gin.Context)

CreateTag 创建标签

func CreateUser

func CreateUser(c *gin.Context)

CreateUser 创建用户(管理员)

func DeleteCategory

func DeleteCategory(c *gin.Context)

DeleteCategory 删除分类

func DeleteCks

func DeleteCks(c *gin.Context)

DeleteCks 删除Cookie

func DeleteHotDrama

func DeleteHotDrama(c *gin.Context)

DeleteHotDrama 删除热播剧记录

func DeletePan

func DeletePan(c *gin.Context)

DeletePan 删除平台

func DeleteReadyResource

func DeleteReadyResource(c *gin.Context)

DeleteReadyResource 删除待处理资源

func DeleteResource

func DeleteResource(c *gin.Context)

DeleteResource 删除资源

func DeleteTag

func DeleteTag(c *gin.Context)

DeleteTag 删除标签

func DeleteUser

func DeleteUser(c *gin.Context)

DeleteUser 删除用户(管理员)

func ErrorResponse

func ErrorResponse(c *gin.Context, message string, code int)

ErrorResponse 错误响应

func FetchHotDramaNames

func FetchHotDramaNames(c *gin.Context)

手动获取热播剧名字

func GetCategories

func GetCategories(c *gin.Context)

GetCategories 获取分类列表

func GetCks

func GetCks(c *gin.Context)

GetCks 获取Cookie列表

func GetCksByID

func GetCksByID(c *gin.Context)

GetCksByID 根据ID获取Cookie详情

func GetCksByIDGlobal

func GetCksByIDGlobal(c *gin.Context)

GetCksByID 根据ID获取Cookie详情(使用全局repoManager)

func GetDailyStats

func GetDailyStats(c *gin.Context)

GetDailyStats 获取每日统计(使用全局repoManager)

func GetFullVersionInfo

func GetFullVersionInfo(c *gin.Context)

GetFullVersionInfo 获取完整版本信息

func GetHotDramaByID

func GetHotDramaByID(c *gin.Context)

GetHotDramaByID 根据ID获取热播剧详情(使用全局repoManager)

func GetHotDramaList

func GetHotDramaList(c *gin.Context)

GetHotDramaList 获取热播剧列表(使用全局repoManager)

func GetHotKeywords

func GetHotKeywords(c *gin.Context)

GetHotKeywords 获取热门关键词(使用全局repoManager)

func GetKeywordTrend

func GetKeywordTrend(c *gin.Context)

GetKeywordTrend 获取关键词趋势(使用全局repoManager)

func GetPan

func GetPan(c *gin.Context)

GetPan 根据ID获取平台

func GetPans

func GetPans(c *gin.Context)

GetPans 获取平台列表

func GetPerformanceStats

func GetPerformanceStats(c *gin.Context)

GetPerformanceStats 获取性能监控信息

func GetProfile

func GetProfile(c *gin.Context)

GetProfile 获取用户资料

func GetPublicSystemConfig added in v1.0.8

func GetPublicSystemConfig(c *gin.Context)

新增:公开获取系统配置(不含api_token)

func GetReadyResources

func GetReadyResources(c *gin.Context)

GetReadyResources 获取待处理资源列表

func GetResourceByID

func GetResourceByID(c *gin.Context)

GetResourceByID 根据ID获取资源

func GetResources

func GetResources(c *gin.Context)

GetResources 获取资源列表

func GetSchedulerStatus

func GetSchedulerStatus(c *gin.Context)

GetSchedulerStatus 获取调度器状态

func GetSearchStats

func GetSearchStats(c *gin.Context)

GetSearchStats 获取搜索统计(使用全局repoManager)

func GetSearchStatsSummary added in v1.0.8

func GetSearchStatsSummary(c *gin.Context)

GetSearchStatsSummary 获取搜索统计汇总

func GetSearchTrend

func GetSearchTrend(c *gin.Context)

GetSearchTrend 获取搜索趋势(使用全局repoManager)

func GetStats

func GetStats(c *gin.Context)

GetStats 获取基础统计信息

func GetSystemConfig

func GetSystemConfig(c *gin.Context)

GetSystemConfig 获取系统配置(使用全局repoManager)

func GetSystemInfo

func GetSystemInfo(c *gin.Context)

GetSystemInfo 获取系统信息

func GetTagByID

func GetTagByID(c *gin.Context)

GetTagByID 根据ID获取标签详情

func GetTagByIDGlobal

func GetTagByIDGlobal(c *gin.Context)

GetTagByID 根据ID获取标签详情(使用全局repoManager)

func GetTags

func GetTags(c *gin.Context)

GetTags 获取标签列表

func GetTagsByCategory

func GetTagsByCategory(c *gin.Context)

GetTagsByCategory 根据分类ID获取标签列表

func GetTagsGlobal

func GetTagsGlobal(c *gin.Context)

GetTags 获取标签列表(使用全局repoManager)

func GetUsers

func GetUsers(c *gin.Context)

GetUsers 获取用户列表(管理员)

func GetVersion

func GetVersion(c *gin.Context)

GetVersion 获取版本信息

func GetVersionString

func GetVersionString(c *gin.Context)

GetVersionString 获取版本字符串

func IncrementResourceViewCount added in v1.0.8

func IncrementResourceViewCount(c *gin.Context)

增加资源浏览次数

func ListResponse

func ListResponse(c *gin.Context, data interface{}, total int64)

ListResponse 列表响应

func Login

func Login(c *gin.Context)

Login 用户登录

func PageResponse

func PageResponse(c *gin.Context, data interface{}, total int64, page, limit int)

PageResponse 分页响应

func RecordSearch

func RecordSearch(c *gin.Context)

RecordSearch 记录搜索

func RefreshCapacity

func RefreshCapacity(c *gin.Context)

RefreshCapacity 刷新账号容量信息

func Register

func Register(c *gin.Context)

Register 用户注册

func SearchResources

func SearchResources(c *gin.Context)

SearchResources 搜索资源

func SetRepositoryManager

func SetRepositoryManager(rm *repo.RepositoryManager)

SetRepositoryManager 设置Repository管理器

func StartAutoTransferScheduler

func StartAutoTransferScheduler(c *gin.Context)

启动自动转存定时任务

func StartHotDramaScheduler

func StartHotDramaScheduler(c *gin.Context)

启动热播剧定时任务

func StartReadyResourceScheduler

func StartReadyResourceScheduler(c *gin.Context)

启动待处理资源自动处理任务

func StopAutoTransferScheduler

func StopAutoTransferScheduler(c *gin.Context)

停止自动转存定时任务

func StopHotDramaScheduler

func StopHotDramaScheduler(c *gin.Context)

停止热播剧定时任务

func StopReadyResourceScheduler

func StopReadyResourceScheduler(c *gin.Context)

停止待处理资源自动处理任务

func SuccessResponse

func SuccessResponse(c *gin.Context, data interface{})

SuccessResponse 成功响应

func TriggerAutoTransferScheduler

func TriggerAutoTransferScheduler(c *gin.Context)

手动触发自动转存定时任务

func TriggerHotDramaScheduler

func TriggerHotDramaScheduler(c *gin.Context)

手动触发热播剧定时任务

func TriggerReadyResourceScheduler

func TriggerReadyResourceScheduler(c *gin.Context)

手动触发待处理资源自动处理任务

func UpdateCategory

func UpdateCategory(c *gin.Context)

UpdateCategory 更新分类

func UpdateCks

func UpdateCks(c *gin.Context)

UpdateCks 更新Cookie

func UpdateHotDrama

func UpdateHotDrama(c *gin.Context)

UpdateHotDrama 更新热播剧记录

func UpdatePan

func UpdatePan(c *gin.Context)

UpdatePan 更新平台

func UpdateResource

func UpdateResource(c *gin.Context)

UpdateResource 更新资源

func UpdateSystemConfig

func UpdateSystemConfig(c *gin.Context)

UpdateSystemConfig 更新系统配置(使用全局repoManager)

func UpdateTag

func UpdateTag(c *gin.Context)

UpdateTag 更新标签

func UpdateUser

func UpdateUser(c *gin.Context)

UpdateUser 更新用户(管理员)

Types

type HotDramaHandler

type HotDramaHandler struct {
	// contains filtered or unexported fields
}

HotDramaHandler 热播剧处理器

func NewHotDramaHandler

func NewHotDramaHandler(hotDramaRepo repo.HotDramaRepository) *HotDramaHandler

NewHotDramaHandler 创建热播剧处理器

func (*HotDramaHandler) GetHotDramaByID

func (h *HotDramaHandler) GetHotDramaByID(c *gin.Context)

GetHotDramaByID 根据ID获取热播剧详情

func (*HotDramaHandler) GetHotDramaList

func (h *HotDramaHandler) GetHotDramaList(c *gin.Context)

GetHotDramaList 获取热播剧列表

type PublicAPIHandler

type PublicAPIHandler struct{}

PublicAPIHandler 公开API处理器

func NewPublicAPIHandler

func NewPublicAPIHandler() *PublicAPIHandler

NewPublicAPIHandler 创建公开API处理器

func (*PublicAPIHandler) AddBatchResources

func (h *PublicAPIHandler) AddBatchResources(c *gin.Context)

AddBatchResources godoc @Summary 批量添加资源 @Description 通过公开API批量添加多个资源到待处理列表 @Tags PublicAPI @Accept json @Produce json @Param X-API-Token header string true "API访问令牌" @Param data body dto.BatchReadyResourceRequest true "批量资源信息" @Success 200 {object} map[string]interface{} "批量添加成功" @Failure 400 {object} map[string]interface{} "请求参数错误" @Failure 401 {object} map[string]interface{} "认证失败" @Failure 500 {object} map[string]interface{} "服务器内部错误" @Router /api/public/resources/batch-add [post]

func (*PublicAPIHandler) AddSingleResource

func (h *PublicAPIHandler) AddSingleResource(c *gin.Context)

AddSingleResource godoc @Summary 单个添加资源 @Description 通过公开API添加单个资源到待处理列表 @Tags PublicAPI @Accept json @Produce json @Param X-API-Token header string true "API访问令牌" @Param data body dto.ReadyResourceRequest true "资源信息" @Success 200 {object} map[string]interface{} "添加成功" @Failure 400 {object} map[string]interface{} "请求参数错误" @Failure 401 {object} map[string]interface{} "认证失败" @Failure 500 {object} map[string]interface{} "服务器内部错误" @Router /api/public/resources/add [post]

func (*PublicAPIHandler) GetHotDramas

func (h *PublicAPIHandler) GetHotDramas(c *gin.Context)

GetHotDramas godoc @Summary 获取热门剧列表 @Description 获取热门剧列表,支持分页 @Tags PublicAPI @Accept json @Produce json @Param X-API-Token header string true "API访问令牌" @Param page query int false "页码" default(1) @Param page_size query int false "每页数量" default(20) maximum(100) @Success 200 {object} map[string]interface{} "获取成功" @Failure 401 {object} map[string]interface{} "认证失败" @Failure 500 {object} map[string]interface{} "服务器内部错误" @Router /api/public/hot-dramas [get]

func (*PublicAPIHandler) SearchResources

func (h *PublicAPIHandler) SearchResources(c *gin.Context)

SearchResources godoc @Summary 资源搜索 @Description 搜索资源,支持关键词、标签、分类过滤 @Tags PublicAPI @Accept json @Produce json @Param X-API-Token header string true "API访问令牌" @Param keyword query string false "搜索关键词" @Param tag query string false "标签过滤" @Param category query string false "分类过滤" @Param page query int false "页码" default(1) @Param page_size query int false "每页数量" default(20) maximum(100) @Success 200 {object} map[string]interface{} "搜索成功" @Failure 401 {object} map[string]interface{} "认证失败" @Failure 500 {object} map[string]interface{} "服务器内部错误" @Router /api/public/resources/search [get]

type Response

type Response struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
	Code    int         `json:"code"`
}

Response 统一响应格式

type SystemConfigHandler

type SystemConfigHandler struct {
	// contains filtered or unexported fields
}

SystemConfigHandler 系统配置处理器

func NewSystemConfigHandler

func NewSystemConfigHandler(systemConfigRepo repo.SystemConfigRepository) *SystemConfigHandler

NewSystemConfigHandler 创建系统配置处理器

func (*SystemConfigHandler) GetConfig

func (h *SystemConfigHandler) GetConfig(c *gin.Context)

GetConfig 获取系统配置

func (*SystemConfigHandler) UpdateConfig

func (h *SystemConfigHandler) UpdateConfig(c *gin.Context)

UpdateConfig 更新系统配置

type VersionResponse

type VersionResponse struct {
	Success bool        `json:"success"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
	Time    time.Time   `json:"time"`
}

VersionResponse 版本响应结构

Jump to

Keyboard shortcuts

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