entity

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileStatusActive   = "active"   // 正常
	FileStatusInactive = "inactive" // 禁用
	FileStatusDeleted  = "deleted"  // 已删除
)

FileStatus 文件状态常量

View Source
const (
	// 通用配置
	GoogleIndexConfigKeyEnabled  = "google_index_enabled"   // 是否启用Google索引功能
	GoogleIndexConfigKeySiteURL  = "google_index_site_url"  // 网站URL
	GoogleIndexConfigKeySiteName = "google_index_site_name" // 网站名称

	// 认证配置
	GoogleIndexConfigKeyCredentialsFile = "google_index_credentials_file" // 凭证文件路径
	GoogleIndexConfigKeyClientEmail     = "google_index_client_email"     // 客户端邮箱
	GoogleIndexConfigKeyClientID        = "google_index_client_id"        // 客户端ID
	GoogleIndexConfigKeyPrivateKey      = "google_index_private_key"      // 私钥(加密存储)
	GoogleIndexConfigKeyToken           = "google_index_token"            // 访问令牌

	// 调度配置
	GoogleIndexConfigKeyCheckInterval = "google_index_check_interval" // 检查间隔(分钟)
	GoogleIndexConfigKeyBatchSize     = "google_index_batch_size"     // 批处理大小
	GoogleIndexConfigKeyConcurrency   = "google_index_concurrency"    // 并发数

	// 重试配置
	GoogleIndexConfigKeyRetryAttempts = "google_index_retry_attempts" // 重试次数
	GoogleIndexConfigKeyRetryDelay    = "google_index_retry_delay"    // 重试延迟(秒)

	// 网站地图配置
	GoogleIndexConfigKeyAutoSitemap     = "google_index_auto_sitemap"     // 自动提交网站地图
	GoogleIndexConfigKeySitemapPath     = "google_index_sitemap_path"     // 网站地图路径
	GoogleIndexConfigKeySitemapSchedule = "google_index_sitemap_schedule" // 网站地图调度
)

GoogleIndexConfigKeys Google索引配置键常量

View Source
const (
	GoogleIndexConfigDefaultCheckInterval = 60
	GoogleIndexConfigDefaultBatchSize     = 100
	GoogleIndexConfigDefaultConcurrency   = 5
)

Google索引配置默认值

View Source
const (
	// 通用配置
	BingIndexConfigKeyEnabled = "bing_index_enabled" // 是否启用Bing索引功能
	BingIndexConfigKeyAPIKey  = "bing_index_api_key" // Bing Webmaster API密钥
)

BingIndexConfigKeys Bing索引配置键常量

View Source
const (
	// SEO 配置
	ConfigKeySiteTitle       = "site_title"
	ConfigKeySiteDescription = "site_description"
	ConfigKeyKeywords        = "keywords"
	ConfigKeyAuthor          = "author"
	ConfigKeyCopyright       = "copyright"

	// 自动处理配置组
	ConfigKeyAutoProcessReadyResources = "auto_process_ready_resources"
	ConfigKeyAutoProcessInterval       = "auto_process_interval"
	ConfigKeyAutoTransferEnabled       = "auto_transfer_enabled"
	ConfigKeyAutoTransferLimitDays     = "auto_transfer_limit_days"
	ConfigKeyAutoTransferMinSpace      = "auto_transfer_min_space"
	ConfigKeyAutoFetchHotDramaEnabled  = "auto_fetch_hot_drama_enabled"

	// API配置
	ConfigKeyApiToken = "api_token"

	// 违禁词配置
	ConfigKeyForbiddenWords = "forbidden_words"

	// 广告配置
	ConfigKeyAdKeywords   = "ad_keywords"    // 广告关键词
	ConfigKeyAutoInsertAd = "auto_insert_ad" // 自动插入广告

	// 其他配置
	ConfigKeyPageSize        = "page_size"
	ConfigKeyMaintenanceMode = "maintenance_mode"
	ConfigKeyEnableRegister  = "enable_register"

	// 三方统计配置
	ConfigKeyThirdPartyStatsCode = "third_party_stats_code"

	// Meilisearch配置
	ConfigKeyMeilisearchEnabled   = "meilisearch_enabled"
	ConfigKeyMeilisearchHost      = "meilisearch_host"
	ConfigKeyMeilisearchPort      = "meilisearch_port"
	ConfigKeyMeilisearchMasterKey = "meilisearch_master_key"
	ConfigKeyMeilisearchIndexName = "meilisearch_index_name"

	// Telegram配置
	ConfigKeyTelegramBotEnabled         = "telegram_bot_enabled"
	ConfigKeyTelegramBotApiKey          = "telegram_bot_api_key"
	ConfigKeyTelegramAutoReplyEnabled   = "telegram_auto_reply_enabled"
	ConfigKeyTelegramAutoReplyTemplate  = "telegram_auto_reply_template"
	ConfigKeyTelegramAutoDeleteEnabled  = "telegram_auto_delete_enabled"
	ConfigKeyTelegramAutoDeleteInterval = "telegram_auto_delete_interval"
	ConfigKeyTelegramProxyEnabled       = "telegram_proxy_enabled"
	ConfigKeyTelegramProxyType          = "telegram_proxy_type"
	ConfigKeyTelegramProxyHost          = "telegram_proxy_host"
	ConfigKeyTelegramProxyPort          = "telegram_proxy_port"
	ConfigKeyTelegramProxyUsername      = "telegram_proxy_username"
	ConfigKeyTelegramProxyPassword      = "telegram_proxy_password"

	// 微信公众号配置
	ConfigKeyWechatBotEnabled       = "wechat_bot_enabled"
	ConfigKeyWechatAppId            = "wechat_app_id"
	ConfigKeyWechatAppSecret        = "wechat_app_secret"
	ConfigKeyWechatToken            = "wechat_token"
	ConfigKeyWechatEncodingAesKey   = "wechat_encoding_aes_key"
	ConfigKeyWechatWelcomeMessage   = "wechat_welcome_message"
	ConfigKeyWechatAutoReplyEnabled = "wechat_auto_reply_enabled"
	ConfigKeyWechatSearchLimit      = "wechat_search_limit"

	// 界面配置
	ConfigKeyEnableAnnouncements = "enable_announcements"
	ConfigKeyAnnouncements       = "announcements"
	ConfigKeyEnableFloatButtons  = "enable_float_buttons"
	ConfigKeyWechatSearchImage   = "wechat_search_image"
	ConfigKeyTelegramQrImage     = "telegram_qr_image"
	ConfigKeyQrCodeStyle         = "qr_code_style"

	// Sitemap配置
	ConfigKeySitemapConfig              = "sitemap_config"
	ConfigKeySitemapLastGenerateTime    = "sitemap_last_generate_time"
	ConfigKeySitemapAutoGenerateEnabled = "sitemap_auto_generate_enabled"

	// 网站URL配置
	ConfigKeyWebsiteURL = "website_url"
)

ConfigKey 配置键常量

View Source
const (
	ConfigTypeString = "string"
	ConfigTypeInt    = "int"
	ConfigTypeBool   = "bool"
	ConfigTypeJSON   = "json"
)

ConfigType 配置类型常量

View Source
const (
	// 基础字段
	ConfigResponseFieldID        = "id"
	ConfigResponseFieldCreatedAt = "created_at"
	ConfigResponseFieldUpdatedAt = "updated_at"

	// SEO 配置字段
	ConfigResponseFieldSiteTitle       = "site_title"
	ConfigResponseFieldSiteDescription = "site_description"
	ConfigResponseFieldKeywords        = "keywords"
	ConfigResponseFieldAuthor          = "author"
	ConfigResponseFieldCopyright       = "copyright"

	// 自动处理配置字段
	ConfigResponseFieldAutoProcessReadyResources = "auto_process_ready_resources"
	ConfigResponseFieldAutoProcessInterval       = "auto_process_interval"
	ConfigResponseFieldAutoTransferEnabled       = "auto_transfer_enabled"
	ConfigResponseFieldAutoTransferLimitDays     = "auto_transfer_limit_days"
	ConfigResponseFieldAutoTransferMinSpace      = "auto_transfer_min_space"
	ConfigResponseFieldAutoFetchHotDramaEnabled  = "auto_fetch_hot_drama_enabled"

	// API配置字段
	ConfigResponseFieldApiToken = "api_token"

	// 违禁词配置字段
	ConfigResponseFieldForbiddenWords = "forbidden_words"

	// 广告配置字段
	ConfigResponseFieldAdKeywords   = "ad_keywords"
	ConfigResponseFieldAutoInsertAd = "auto_insert_ad"

	// 其他配置字段
	ConfigResponseFieldPageSize        = "page_size"
	ConfigResponseFieldMaintenanceMode = "maintenance_mode"
	ConfigResponseFieldEnableRegister  = "enable_register"

	// 三方统计配置字段
	ConfigResponseFieldThirdPartyStatsCode = "third_party_stats_code"

	// Meilisearch配置字段
	ConfigResponseFieldMeilisearchEnabled   = "meilisearch_enabled"
	ConfigResponseFieldMeilisearchHost      = "meilisearch_host"
	ConfigResponseFieldMeilisearchPort      = "meilisearch_port"
	ConfigResponseFieldMeilisearchMasterKey = "meilisearch_master_key"
	ConfigResponseFieldMeilisearchIndexName = "meilisearch_index_name"

	// Telegram配置字段
	ConfigResponseFieldTelegramBotEnabled         = "telegram_bot_enabled"
	ConfigResponseFieldTelegramBotApiKey          = "telegram_bot_api_key"
	ConfigResponseFieldTelegramAutoReplyEnabled   = "telegram_auto_reply_enabled"
	ConfigResponseFieldTelegramAutoReplyTemplate  = "telegram_auto_reply_template"
	ConfigResponseFieldTelegramAutoDeleteEnabled  = "telegram_auto_delete_enabled"
	ConfigResponseFieldTelegramAutoDeleteInterval = "telegram_auto_delete_interval"
	ConfigResponseFieldTelegramProxyEnabled       = "telegram_proxy_enabled"
	ConfigResponseFieldTelegramProxyType          = "telegram_proxy_type"
	ConfigResponseFieldTelegramProxyHost          = "telegram_proxy_host"
	ConfigResponseFieldTelegramProxyPort          = "telegram_proxy_port"
	ConfigResponseFieldTelegramProxyUsername      = "telegram_proxy_username"
	ConfigResponseFieldTelegramProxyPassword      = "telegram_proxy_password"

	// 微信公众号配置字段
	ConfigResponseFieldWechatBotEnabled       = "wechat_bot_enabled"
	ConfigResponseFieldWechatAppId            = "wechat_app_id"
	ConfigResponseFieldWechatAppSecret        = "wechat_app_secret"
	ConfigResponseFieldWechatToken            = "wechat_token"
	ConfigResponseFieldWechatEncodingAesKey   = "wechat_encoding_aes_key"
	ConfigResponseFieldWechatWelcomeMessage   = "wechat_welcome_message"
	ConfigResponseFieldWechatAutoReplyEnabled = "wechat_auto_reply_enabled"
	ConfigResponseFieldWechatSearchLimit      = "wechat_search_limit"

	// 界面配置字段
	ConfigResponseFieldEnableAnnouncements = "enable_announcements"
	ConfigResponseFieldAnnouncements       = "announcements"
	ConfigResponseFieldEnableFloatButtons  = "enable_float_buttons"
	ConfigResponseFieldWechatSearchImage   = "wechat_search_image"
	ConfigResponseFieldTelegramQrImage     = "telegram_qr_image"
	ConfigResponseFieldQrCodeStyle         = "qr_code_style"

	// 网站URL配置字段
	ConfigResponseFieldWebsiteURL = "site_url"
)

ConfigResponseField API响应字段名常量

View Source
const (
	// SEO 配置默认值
	ConfigDefaultSiteTitle       = "老九网盘资源数据库"
	ConfigDefaultSiteDescription = "专业的老九网盘资源数据库"
	ConfigDefaultKeywords        = "网盘,资源管理,文件分享"
	ConfigDefaultAuthor          = "系统管理员"
	ConfigDefaultCopyright       = "© 2024 老九网盘资源数据库"

	// 自动处理配置默认值
	ConfigDefaultAutoProcessReadyResources = "false"
	ConfigDefaultAutoProcessInterval       = "30"
	ConfigDefaultAutoTransferEnabled       = "false"
	ConfigDefaultAutoTransferLimitDays     = "0"
	ConfigDefaultAutoTransferMinSpace      = "100"
	ConfigDefaultAutoFetchHotDramaEnabled  = "false"

	// API配置默认值
	ConfigDefaultApiToken = ""

	// 违禁词配置默认值
	ConfigDefaultForbiddenWords = ""

	// 广告配置默认值
	ConfigDefaultAdKeywords   = ""
	ConfigDefaultAutoInsertAd = ""

	// 其他配置默认值
	ConfigDefaultPageSize        = "100"
	ConfigDefaultMaintenanceMode = "false"
	ConfigDefaultEnableRegister  = "true"

	// 三方统计配置默认值
	ConfigDefaultThirdPartyStatsCode = ""

	// Meilisearch配置默认值
	ConfigDefaultMeilisearchEnabled   = "false"
	ConfigDefaultMeilisearchHost      = "localhost"
	ConfigDefaultMeilisearchPort      = "7700"
	ConfigDefaultMeilisearchMasterKey = ""
	ConfigDefaultMeilisearchIndexName = "resources"

	// Telegram配置默认值
	ConfigDefaultTelegramBotEnabled         = "false"
	ConfigDefaultTelegramBotApiKey          = ""
	ConfigDefaultTelegramAutoReplyEnabled   = "true"
	ConfigDefaultTelegramAutoReplyTemplate  = "您好!我可以帮您搜索网盘资源,请输入您要搜索的内容。"
	ConfigDefaultTelegramAutoDeleteEnabled  = "false"
	ConfigDefaultTelegramAutoDeleteInterval = "60"
	ConfigDefaultTelegramProxyEnabled       = "false"
	ConfigDefaultTelegramProxyType          = "http"
	ConfigDefaultTelegramProxyHost          = ""
	ConfigDefaultTelegramProxyPort          = "8080"
	ConfigDefaultTelegramProxyUsername      = ""
	ConfigDefaultTelegramProxyPassword      = ""

	// 微信公众号配置默认值
	ConfigDefaultWechatBotEnabled       = "false"
	ConfigDefaultWechatAppId            = ""
	ConfigDefaultWechatAppSecret        = ""
	ConfigDefaultWechatToken            = ""
	ConfigDefaultWechatEncodingAesKey   = ""
	ConfigDefaultWechatWelcomeMessage   = "欢迎关注老九网盘资源库!发送关键词即可搜索资源。"
	ConfigDefaultWechatAutoReplyEnabled = "true"
	ConfigDefaultWechatSearchLimit      = "5"

	// 界面配置默认值
	ConfigDefaultEnableAnnouncements = "false"
	ConfigDefaultAnnouncements       = ""
	ConfigDefaultEnableFloatButtons  = "false"
	ConfigDefaultWechatSearchImage   = ""
	ConfigDefaultTelegramQrImage     = ""
	ConfigDefaultQrCodeStyle         = "Plain"

	// 网站URL配置默认值
	ConfigDefaultWebsiteURL = "https://example.com"
)

ConfigDefaultValue 配置默认值常量

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAccessLog added in v1.3.1

type APIAccessLog struct {
	ID             uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	IP             string         `json:"ip" gorm:"size:45;not null;comment:客户端IP地址"`
	UserAgent      string         `json:"user_agent" gorm:"size:500;comment:用户代理"`
	Endpoint       string         `json:"endpoint" gorm:"size:255;not null;comment:访问的接口路径"`
	Method         string         `json:"method" gorm:"size:10;not null;comment:HTTP方法"`
	RequestParams  string         `json:"request_params" gorm:"type:text;comment:查询参数(JSON格式)"`
	ResponseStatus int            `json:"response_status" gorm:"default:200;comment:响应状态码"`
	ResponseData   string         `json:"response_data" gorm:"type:text;comment:响应数据(JSON格式)"`
	ProcessCount   int            `json:"process_count" gorm:"default:0;comment:处理数量(查询结果数或添加的数量)"`
	ErrorMessage   string         `json:"error_message" gorm:"size:500;comment:错误消息"`
	ProcessingTime int64          `json:"processing_time" gorm:"comment:处理时间(毫秒)"`
	CreatedAt      time.Time      `json:"created_at"`
	UpdatedAt      time.Time      `json:"updated_at"`
	DeletedAt      gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}

APIAccessLog API访问日志模型

func (APIAccessLog) TableName added in v1.3.1

func (APIAccessLog) TableName() string

TableName 指定表名

type APIAccessLogStats added in v1.3.1

type APIAccessLogStats struct {
	Endpoint       string    `json:"endpoint"`
	Method         string    `json:"method"`
	RequestCount   int64     `json:"request_count"`
	ErrorCount     int64     `json:"error_count"`
	AvgProcessTime int64     `json:"avg_process_time"`
	LastAccess     time.Time `json:"last_access"`
}

APIAccessLogStats 按端点统计

type APIAccessLogSummary added in v1.3.1

type APIAccessLogSummary struct {
	TotalRequests int64 `json:"total_requests"`
	TodayRequests int64 `json:"today_requests"`
	WeekRequests  int64 `json:"week_requests"`
	MonthRequests int64 `json:"month_requests"`
	ErrorRequests int64 `json:"error_requests"`
	UniqueIPs     int64 `json:"unique_ips"`
}

APIAccessLogSummary API访问日志汇总统计

type AccessStats added in v1.3.6

type AccessStats struct {
	ID         uint      `gorm:"primaryKey" json:"id"`
	URLID      string    `gorm:"not null;index" json:"url_id"`
	UserID     *string   `gorm:"index" json:"user_id"`
	AccessTime time.Time `gorm:"not null;index" json:"access_time"`
	Referrer   string    `gorm:"type:text" json:"referrer"`
	UserAgent  string    `gorm:"type:text" json:"user_agent"`
	IPAddress  string    `gorm:"index" json:"ip_address"`
}

AccessStats 访问统计表

type Category

type Category struct {
	ID          uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	Name        string         `json:"name" gorm:"size:100;not null;unique;comment:分类名称"`
	Description string         `json:"description" gorm:"type:text;comment:分类描述"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	// 关联关系
	Resources []Resource `json:"resources" gorm:"foreignKey:CategoryID"`
	Tags      []Tag      `json:"tags" gorm:"foreignKey:CategoryID"`
}

Category 分类模型

func (Category) TableName

func (Category) TableName() string

TableName 指定表名

type Cks

type Cks struct {
	ID          uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	PanID       uint           `json:"pan_id" gorm:"not null;comment:平台ID"`
	Idx         int            `json:"idx" gorm:"comment:索引"`
	Ck          string         `json:"ck" gorm:"type:text;comment:cookie"`
	IsValid     bool           `json:"is_valid" gorm:"default:true;comment:是否有效"`
	Space       int64          `json:"space" gorm:"default:0;comment:总空间(字节)"`
	LeftSpace   int64          `json:"left_space" gorm:"default:0;comment:剩余空间(字节)"`
	UsedSpace   int64          `json:"used_space" gorm:"default:0;comment:已使用空间(字节)"`
	Username    string         `json:"username" gorm:"size:100;comment:用户名"`
	VipStatus   bool           `json:"vip_status" gorm:"default:false;comment:VIP状态"`
	ServiceType string         `json:"service_type" gorm:"size:20;comment:服务类型"`
	Remark      string         `json:"remark" gorm:"size:64;not null;comment:备注"`
	Extra       string         `json:"extra" gorm:"type:text;comment:额外的中间数据如token等"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	// 关联关系
	Pan Pan `json:"pan" gorm:"foreignKey:PanID"`
}

Cks 第三方平台账号cookie表

func (Cks) TableName

func (Cks) TableName() string

TableName 指定表名

type ClassificationStats added in v1.3.6

type ClassificationStats struct {
	ID        uint      `gorm:"primaryKey" json:"id"`
	Category  string    `gorm:"uniqueIndex;not null" json:"category"`
	TagCount  int       `gorm:"default:0" json:"tag_count"`
	CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
}

ClassificationStats 分类统计表

type CopyrightClaim added in v1.3.5

type CopyrightClaim struct {
	ID           uint           `gorm:"primaryKey" json:"id"`
	ResourceKey  string         `gorm:"type:varchar(255);not null;index" json:"resource_key"` // 资源唯一标识
	Identity     string         `gorm:"type:varchar(50);not null" json:"identity"`            // 申述人身份
	ProofType    string         `gorm:"type:varchar(50);not null" json:"proof_type"`          // 证明类型
	Reason       string         `gorm:"type:text;not null" json:"reason"`                     // 申述理由
	ContactInfo  string         `gorm:"type:varchar(255);not null" json:"contact_info"`       // 联系信息
	ClaimantName string         `gorm:"type:varchar(100);not null" json:"claimant_name"`      // 申述人姓名
	ProofFiles   string         `gorm:"type:text" json:"proof_files"`                         // 证明文件(JSON格式)
	UserAgent    string         `gorm:"type:text" json:"user_agent"`                          // 用户代理
	IPAddress    string         `gorm:"type:varchar(45)" json:"ip_address"`                   // IP地址
	Status       string         `gorm:"type:varchar(20);default:'pending'" json:"status"`     // 处理状态: pending, approved, rejected
	ProcessedAt  *time.Time     `json:"processed_at"`                                         // 处理时间
	ProcessedBy  *uint          `json:"processed_by"`                                         // 处理人ID
	Note         string         `gorm:"type:text" json:"note"`                                // 处理备注
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
	DeletedAt    gorm.DeletedAt `json:"deleted_at"`
}

CopyrightClaim 版权申述实体

func (CopyrightClaim) TableName added in v1.3.5

func (CopyrightClaim) TableName() string

TableName 表名

type CronJob added in v1.3.6

type CronJob struct {
	ID            uint       `gorm:"primaryKey" json:"id"`
	JobName       string     `gorm:"uniqueIndex;not null" json:"job_name"`
	Schedule      string     `gorm:"not null" json:"schedule"`
	HandlerScript string     `gorm:"type:text;not null" json:"handler_script"`
	Enabled       bool       `gorm:"default:true" json:"enabled"`
	LastRun       *time.Time `json:"last_run"`
	NextRun       *time.Time `gorm:"index" json:"next_run"`
	CreatedAt     time.Time  `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt     time.Time  `gorm:"autoUpdateTime" json:"updated_at"`
}

CronJob 定时任务表

type CustomEvent added in v1.3.6

type CustomEvent struct {
	ID          uint       `gorm:"primaryKey" json:"id"`
	EventName   string     `gorm:"not null;index" json:"event_name"`
	EventData   string     `gorm:"type:text;not null" json:"event_data"`
	Processed   bool       `gorm:"default:false;index" json:"processed"`
	CreatedAt   time.Time  `gorm:"autoCreateTime;index" json:"created_at"`
	ProcessedAt *time.Time `json:"processed_at"`
}

CustomEvent 自定义事件表

type DailyReport added in v1.3.6

type DailyReport struct {
	ID         uint      `gorm:"primaryKey" json:"id"`
	Type       string    `gorm:"not null;index" json:"type"`
	ReportData string    `gorm:"type:text;not null" json:"report_data"`
	CreatedAt  time.Time `gorm:"autoCreateTime;index" json:"created_at"`
}

DailyReport 每日报告表

type DailySearchStat

type DailySearchStat struct {
	Date           time.Time `json:"date"`
	TotalSearches  int       `json:"total_searches"`
	UniqueKeywords int       `json:"unique_keywords"`
}

DailySearchStat 每日搜索统计

type DomainPattern added in v1.3.6

type DomainPattern struct {
	ID       uint      `gorm:"primaryKey" json:"id"`
	Domain   string    `gorm:"uniqueIndex;not null" json:"domain"`
	Count    int       `gorm:"default:1" json:"count"`
	LastSeen time.Time `gorm:"autoUpdateTime" json:"last_seen"`
}

DomainPattern 域名模式表

type File added in v1.2.3

type File struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	// 文件信息
	OriginalName string `json:"original_name" gorm:"size:255;not null;comment:原始文件名"`
	FileName     string `json:"file_name" gorm:"size:255;not null;unique;comment:存储文件名"`
	FilePath     string `json:"file_path" gorm:"size:500;not null;comment:文件路径"`
	FileSize     int64  `json:"file_size" gorm:"not null;comment:文件大小(字节)"`
	FileType     string `json:"file_type" gorm:"size:100;not null;comment:文件类型"`
	MimeType     string `json:"mime_type" gorm:"size:100;comment:MIME类型"`
	FileHash     string `json:"file_hash" gorm:"size:64;uniqueIndex;comment:文件哈希值"`

	// 访问信息
	AccessURL string `json:"access_url" gorm:"size:500;comment:访问URL"`

	// 用户信息
	UserID uint `json:"user_id" gorm:"comment:上传用户ID"`
	User   User `json:"user" gorm:"foreignKey:UserID"`

	// 状态信息
	Status    string `json:"status" gorm:"size:20;default:'active';comment:文件状态"`
	IsPublic  bool   `json:"is_public" gorm:"default:true;comment:是否公开"`
	IsDeleted bool   `json:"is_deleted" gorm:"default:false;comment:是否已删除"`
}

File 文件实体

func (File) TableName added in v1.2.3

func (File) TableName() string

TableName 指定表名

type HotDrama

type HotDrama struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	// 基本信息
	Title        string  `json:"title" gorm:"size:255;not null"` // 剧名
	CardSubtitle string  `json:"card_subtitle" gorm:"size:500"`  // 副标题
	EpisodesInfo string  `json:"episodes_info" gorm:"size:100"`  // 集数信息
	IsNew        bool    `json:"is_new" gorm:"default:false"`    // 是否新剧
	Rating       float64 `json:"rating" gorm:"default:0"`        // 评分
	RatingCount  int     `json:"rating_count" gorm:"default:0"`  // 评分人数
	Year         string  `json:"year" gorm:"size:10"`            // 年份
	Region       string  `json:"region" gorm:"size:100"`         // 地区
	Genres       string  `json:"genres" gorm:"size:500"`         // 类型(多个用逗号分隔)
	Directors    string  `json:"directors" gorm:"size:500"`      // 导演(多个用逗号分隔)
	Actors       string  `json:"actors" gorm:"size:1000"`        // 演员(多个用逗号分隔)
	PosterURL    string  `json:"poster_url" gorm:"size:500"`     // 海报URL

	// 分类信息
	Category string `json:"category" gorm:"size:50"` // 分类(电影/电视剧)
	SubType  string `json:"sub_type" gorm:"size:50"` // 子类型(华语/欧美/韩国/日本等)
	Rank     int    `json:"rank" gorm:"default:0"`   // 排序(豆瓣返回顺序)

	// 数据来源
	Source    string `json:"source" gorm:"size:50;default:'douban'"` // 数据来源
	DoubanID  string `json:"douban_id" gorm:"size:50"`               // 豆瓣ID
	DoubanURI string `json:"douban_uri" gorm:"size:200"`             // 豆瓣链接
}

HotDrama 热播剧实体

func (HotDrama) TableName

func (HotDrama) TableName() string

TableName 指定表名

type KeywordStat

type KeywordStat struct {
	Keyword string `json:"keyword"`
	Count   int    `json:"count"`
	Rank    int    `json:"rank"`
}

KeywordStat 关键词统计

type Pan

type Pan struct {
	ID        uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	Name      string         `json:"name" gorm:"size:64;comment:平台名称"`
	Key       int            `json:"key" gorm:"comment:平台标识"`
	Icon      string         `json:"icon" gorm:"size:128;comment:图标文字"`
	Remark    string         `json:"remark" gorm:"size:64;not null;comment:备注"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	// 关联关系
	Cks []Cks `json:"cks" gorm:"foreignKey:PanID"`
}

Pan 第三方平台表

func (Pan) TableName

func (Pan) TableName() string

TableName 指定表名

type PathPattern added in v1.3.6

type PathPattern struct {
	ID       uint      `gorm:"primaryKey" json:"id"`
	Pattern  string    `gorm:"uniqueIndex;not null" json:"pattern"`
	Count    int       `gorm:"default:1" json:"count"`
	LastSeen time.Time `gorm:"autoUpdateTime" json:"last_seen"`
}

PathPattern 路径模式表

type PluginConfig added in v1.3.6

type PluginConfig struct {
	ID         uint      `gorm:"primaryKey" json:"id"`
	PluginName string    `gorm:"uniqueIndex;not null" json:"plugin_name"`
	ConfigJSON string    `gorm:"type:text;not null" json:"config_json"`
	Enabled    bool      `gorm:"default:true" json:"enabled"`
	CreatedAt  time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt  time.Time `gorm:"autoUpdateTime" json:"updated_at"`
}

PluginConfig 插件配置表

type PluginLog added in v1.3.6

type PluginLog struct {
	ID            uint      `gorm:"primaryKey" json:"id"`
	PluginName    string    `gorm:"not null;index" json:"plugin_name"`
	HookName      string    `gorm:"not null" json:"hook_name"`
	ExecutionTime int       `gorm:"not null" json:"execution_time"` // 毫秒
	Success       bool      `gorm:"not null" json:"success"`
	Message       *string   `gorm:"type:text" json:"message"`       // 日志消息内容
	ErrorMessage  *string   `gorm:"type:text" json:"error_message"` // 错误消息(仅error级别)
	CreatedAt     time.Time `gorm:"autoCreateTime;index" json:"created_at"`
}

PluginLog 插件执行日志表

type PopularResources added in v1.3.6

type PopularResources struct {
	ID           uint      `gorm:"primaryKey" json:"id"`
	URLID        string    `gorm:"uniqueIndex;not null" json:"url_id"`
	AccessCount  int       `gorm:"default:1" json:"access_count"`
	LastAccessed time.Time `gorm:"autoUpdateTime" json:"last_accessed"`
}

PopularResources 热门资源表

type ReadyResource

type ReadyResource struct {
	ID          uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	Title       *string        `json:"title" gorm:"size:255;comment:资源标题"`
	Description string         `json:"description" gorm:"type:text;comment:资源描述"`
	URL         string         `json:"url" gorm:"size:500;not null;comment:资源链接"`
	Category    string         `json:"category" gorm:"size:100;comment:资源分类"`
	Tags        string         `json:"tags" gorm:"size:500;comment:资源标签,多个标签用逗号分隔"`
	Img         string         `json:"img" gorm:"size:500;comment:封面链接"`
	Source      string         `json:"source" gorm:"size:100;comment:数据来源"`
	Extra       string         `json:"extra" gorm:"type:text;comment:额外附加数据"`
	Key         string         `json:"key" gorm:"size:64;index;comment:资源组标识,相同key表示同一组资源"`
	ErrorMsg    string         `json:"error_msg" gorm:"type:text;comment:处理失败时的错误信息"`
	CreateTime  time.Time      `json:"create_time" gorm:"default:CURRENT_TIMESTAMP"`
	IP          *string        `json:"ip" gorm:"size:45;comment:IP地址"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}

ReadyResource 待处理资源模型

func (ReadyResource) TableName

func (ReadyResource) TableName() string

TableName 指定表名

type RealTimeMetrics added in v1.3.6

type RealTimeMetrics struct {
	ID        uint      `gorm:"primaryKey" json:"id"`
	Metric    string    `gorm:"not null;index" json:"metric"`
	Value     float64   `gorm:"not null" json:"value"`
	Timestamp time.Time `gorm:"not null;index" json:"timestamp"`
}

RealTimeMetrics 实时指标表

type Report added in v1.3.5

type Report struct {
	ID          uint           `gorm:"primaryKey" json:"id"`
	ResourceKey string         `gorm:"type:varchar(255);not null;index" json:"resource_key"` // 资源唯一标识
	Reason      string         `gorm:"type:varchar(100);not null" json:"reason"`             // 举报原因
	Description string         `gorm:"type:text" json:"description"`                         // 详细描述
	Contact     string         `gorm:"type:varchar(255)" json:"contact"`                     // 联系方式
	UserAgent   string         `gorm:"type:text" json:"user_agent"`                          // 用户代理
	IPAddress   string         `gorm:"type:varchar(45)" json:"ip_address"`                   // IP地址
	Status      string         `gorm:"type:varchar(20);default:'pending'" json:"status"`     // 处理状态: pending, approved, rejected
	ProcessedAt *time.Time     `json:"processed_at"`                                         // 处理时间
	ProcessedBy *uint          `json:"processed_by"`                                         // 处理人ID
	Note        string         `gorm:"type:text" json:"note"`                                // 处理备注
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at"`
}

Report 举报实体

func (Report) TableName added in v1.3.5

func (Report) TableName() string

TableName 表名

type Resource

type Resource struct {
	ID                  uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	Title               string         `json:"title" gorm:"size:255;not null;comment:资源标题"`
	Description         string         `json:"description" gorm:"type:text;comment:资源描述"`
	URL                 string         `json:"url" gorm:"size:128;comment:资源链接"`
	PanID               *uint          `json:"pan_id" gorm:"comment:平台ID"`
	SaveURL             string         `json:"save_url" gorm:"size:500;comment:转存后的链接"`
	FileSize            string         `json:"file_size" gorm:"size:100;comment:文件大小"`
	CategoryID          *uint          `json:"category_id" gorm:"comment:分类ID"`
	ViewCount           int            `json:"view_count" gorm:"default:0;comment:浏览次数"`
	IsValid             bool           `json:"is_valid" gorm:"default:true;comment:是否有效"`
	IsPublic            bool           `json:"is_public" gorm:"default:true;comment:是否公开"`
	CreatedAt           time.Time      `json:"created_at"`
	UpdatedAt           time.Time      `json:"updated_at"`
	DeletedAt           gorm.DeletedAt `json:"deleted_at" gorm:"index"`
	Cover               string         `json:"cover" gorm:"size:500;comment:封面"`
	Author              string         `json:"author" gorm:"size:100;comment:作者"`
	ErrorMsg            string         `json:"error_msg" gorm:"size:255;comment:转存失败原因"`
	CkID                *uint          `json:"ck_id" gorm:"comment:账号ID"`
	Fid                 string         `json:"fid" gorm:"size:128;comment:网盘文件ID"`
	Key                 string         `json:"key" gorm:"size:64;index;comment:资源组标识,相同key表示同一组资源"`
	SyncedToMeilisearch bool           `json:"synced_to_meilisearch" gorm:"default:false;comment:是否已同步到Meilisearch"`
	SyncedAt            *time.Time     `json:"synced_at" gorm:"comment:同步时间"`

	// 关联关系
	Category Category `json:"category" gorm:"foreignKey:CategoryID"`
	Pan      Pan      `json:"pan" gorm:"foreignKey:PanID"`
	Tags     []Tag    `json:"tags" gorm:"many2many:resource_tags;"`
}

Resource 资源模型

func (*Resource) GetDescription added in v1.2.5

func (r *Resource) GetDescription() string

GetDescription 获取资源描述(实现utils.Resource接口)

func (*Resource) GetTitle added in v1.2.5

func (r *Resource) GetTitle() string

GetTitle 获取资源标题(实现utils.Resource接口)

func (*Resource) SetDescription added in v1.2.5

func (r *Resource) SetDescription(description string)

SetDescription 设置资源描述(实现utils.Resource接口)

func (*Resource) SetTitle added in v1.2.5

func (r *Resource) SetTitle(title string)

SetTitle 设置资源标题(实现utils.Resource接口)

func (Resource) TableName

func (Resource) TableName() string

TableName 指定表名

type ResourceTag

type ResourceTag struct {
	ID         uint      `json:"id" gorm:"primaryKey;autoIncrement"`
	ResourceID uint      `json:"resource_id" gorm:"not null;comment:资源ID"`
	TagID      uint      `json:"tag_id" gorm:"not null;comment:标签ID"`
	CreatedAt  time.Time `json:"created_at"`
}

ResourceTag 资源标签关联表

func (ResourceTag) TableName

func (ResourceTag) TableName() string

TableName 指定表名

type ResourceView added in v1.2.0

type ResourceView struct {
	ID         uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	ResourceID uint           `json:"resource_id" gorm:"not null;index;comment:资源ID"`
	IPAddress  string         `json:"ip_address" gorm:"size:45;comment:访问者IP地址"`
	UserAgent  string         `json:"user_agent" gorm:"type:text;comment:用户代理"`
	CreatedAt  time.Time      `json:"created_at" gorm:"autoCreateTime;comment:访问时间"`
	UpdatedAt  time.Time      `json:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt  gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	// 关联关系
	Resource Resource `json:"resource" gorm:"foreignKey:ResourceID"`
}

ResourceView 资源访问记录

func (ResourceView) TableName added in v1.2.0

func (ResourceView) TableName() string

TableName 指定表名

type SearchStat

type SearchStat struct {
	ID        uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	Keyword   string         `json:"keyword" gorm:"size:255;not null;comment:搜索关键词"`
	Count     int            `json:"count" gorm:"default:1;comment:搜索次数"`
	Date      time.Time      `json:"date" gorm:"type:date;not null;comment:搜索日期"`
	IP        string         `json:"ip" gorm:"size:45;comment:用户IP"`
	UserAgent string         `json:"user_agent" gorm:"size:500;comment:用户代理"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}

SearchStat 搜索统计模型

func (SearchStat) TableName

func (SearchStat) TableName() string

TableName 指定表名

type SystemConfig

type SystemConfig struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	// 键值对配置
	Key   string `json:"key" gorm:"size:100;not null;unique;comment:配置键"`
	Value string `json:"value" gorm:"type:text"`
	Type  string `json:"type" gorm:"size:20;default:'string'"` // string, int, bool, json
}

SystemConfig 系统配置实体(键值对形式)

func (SystemConfig) TableName

func (SystemConfig) TableName() string

TableName 指定表名

type SystemHealth added in v1.3.6

type SystemHealth struct {
	ID        uint      `gorm:"primaryKey" json:"id"`
	Status    string    `gorm:"not null" json:"status"`
	Metrics   string    `gorm:"type:text" json:"metrics"`
	CheckedAt time.Time `gorm:"autoCreateTime" json:"checked_at"`
}

SystemHealth 系统健康检查表

type Tag

type Tag struct {
	ID          uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	Name        string         `json:"name" gorm:"size:100;not null;unique;comment:标签名称"`
	Description string         `json:"description" gorm:"type:text;comment:标签描述"`
	CategoryID  *uint          `json:"category_id" gorm:"comment:分类ID,可以为空"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	// 关联关系
	Category  Category   `json:"category" gorm:"foreignKey:CategoryID"`
	Resources []Resource `json:"resources" gorm:"many2many:resource_tags;"`
}

Tag 标签模型

func (Tag) TableName

func (Tag) TableName() string

TableName 指定表名

type Task added in v1.2.0

type Task struct {
	ID          uint       `json:"id" gorm:"primaryKey;autoIncrement"`
	Title       string     `json:"title" gorm:"size:255;not null;comment:任务标题"`
	Name        string     `json:"name" gorm:"size:255;not null;default:'';comment:任务名称"`
	Type        TaskType   `json:"type" gorm:"size:50;not null;comment:任务类型"`
	Status      TaskStatus `json:"status" gorm:"size:20;not null;default:pending;comment:任务状态"`
	Description string     `json:"description" gorm:"type:text;comment:任务描述"`

	// 进度信息
	TotalItems     int     `json:"total_items" gorm:"not null;default:0;comment:总项目数"`
	ProcessedItems int     `json:"processed_items" gorm:"not null;default:0;comment:已处理项目数"`
	SuccessItems   int     `json:"success_items" gorm:"not null;default:0;comment:成功项目数"`
	FailedItems    int     `json:"failed_items" gorm:"not null;default:0;comment:失败项目数"`
	Progress       float64 `json:"progress" gorm:"not null;default:0.0;comment:任务进度"`

	// 任务配置 (JSON格式存储)
	Config string `json:"config" gorm:"type:text;comment:任务配置"`

	// 任务消息
	Message string `json:"message" gorm:"type:text;comment:任务消息"`

	// 进度数据 (JSON格式存储)
	ProgressData string `json:"progress_data" gorm:"type:text;comment:进度数据"`

	// Google索引特有字段 (当Type为google_index时使用)
	IndexedURLs int `json:"indexed_urls" gorm:"default:0;comment:已索引URL数量"`
	FailedURLs  int `json:"failed_urls" gorm:"default:0;comment:失败URL数量"`

	// 配置关联 (用于Google索引任务)
	ConfigID *uint `json:"config_id" gorm:"comment:配置ID"`

	// 时间信息
	StartedAt   *time.Time     `json:"started_at" gorm:"comment:开始时间"`
	CompletedAt *time.Time     `json:"completed_at" gorm:"comment:完成时间"`
	CreatedAt   time.Time      `json:"created_at" gorm:"autoCreateTime"`
	UpdatedAt   time.Time      `json:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	// 关联关系
	TaskItems []TaskItem `json:"task_items" gorm:"foreignKey:TaskID"`
}

Task 任务表

func (Task) TableName added in v1.2.0

func (Task) TableName() string

TableName 指定表名

type TaskItem added in v1.2.0

type TaskItem struct {
	ID     uint `json:"id" gorm:"primaryKey;autoIncrement"`
	TaskID uint `json:"task_id" gorm:"not null;index;comment:任务ID"`

	// 通用任务项信息
	Status       TaskItemStatus `json:"status" gorm:"size:20;not null;default:pending;comment:处理状态"`
	ErrorMessage string         `json:"error_message" gorm:"type:text;comment:错误信息"`

	// 输入数据 (JSON格式存储,支持不同任务类型的不同数据结构)
	InputData string `json:"input_data" gorm:"type:text;not null;comment:输入数据(JSON格式)"`

	// 输出数据 (JSON格式存储,支持不同任务类型的不同结果数据)
	OutputData string `json:"output_data" gorm:"type:text;comment:输出数据(JSON格式)"`

	// 处理日志 (可选,用于记录详细的处理过程)
	ProcessLog string `json:"process_log" gorm:"type:text;comment:处理日志"`

	// Google索引特有字段 (当任务类型为google_index时使用)
	URL            string     `json:"url" gorm:"size:2048;comment:URL (Google索引专用)"`
	IndexStatus    string     `json:"index_status" gorm:"size:50;comment:索引状态 (Google索引专用)"`
	InspectResult  string     `json:"inspect_result" gorm:"type:text;comment:检查结果 (Google索引专用)"`
	MobileFriendly bool       `json:"mobile_friendly" gorm:"default:false;comment:是否移动友好 (Google索引专用)"`
	LastCrawled    *time.Time `json:"last_crawled" gorm:"comment:最后抓取时间 (Google索引专用)"`
	StatusCode     int        `json:"status_code" gorm:"default:0;comment:HTTP状态码 (Google索引专用)"`

	// 时间信息
	ProcessedAt *time.Time     `json:"processed_at" gorm:"comment:处理时间"`
	CreatedAt   time.Time      `json:"created_at" gorm:"autoCreateTime"`
	UpdatedAt   time.Time      `json:"updated_at" gorm:"autoUpdateTime"`
	DeletedAt   gorm.DeletedAt `json:"deleted_at" gorm:"index"`

	// 关联关系
	Task Task `json:"task" gorm:"foreignKey:TaskID"`
}

TaskItem 任务项表(任务的详细记录)

func (*TaskItem) AddProcessLog added in v1.2.0

func (item *TaskItem) AddProcessLog(message string)

AddProcessLog 添加处理日志

func (*TaskItem) GetDisplayName added in v1.2.0

func (item *TaskItem) GetDisplayName(taskType TaskType) string

GetDisplayName 获取显示名称(用于前端显示)

func (*TaskItem) GetInputData added in v1.2.0

func (item *TaskItem) GetInputData(taskType TaskType) (interface{}, error)

GetInputData 获取输入数据(根据任务类型解析JSON)

func (*TaskItem) GetOutputData added in v1.2.0

func (item *TaskItem) GetOutputData(taskType TaskType) (interface{}, error)

GetOutputData 获取输出数据(根据任务类型解析JSON)

func (*TaskItem) SetInputData added in v1.2.0

func (item *TaskItem) SetInputData(data interface{}) error

SetInputData 设置输入数据(将结构体转换为JSON字符串)

func (*TaskItem) SetOutputData added in v1.2.0

func (item *TaskItem) SetOutputData(data interface{}) error

SetOutputData 设置输出数据(将结构体转换为JSON字符串)

func (TaskItem) TableName added in v1.2.0

func (TaskItem) TableName() string

TableName 指定表名

type TaskItemStatus added in v1.2.0

type TaskItemStatus string

TaskItemStatus 任务项状态

const (
	TaskItemStatusPending    TaskItemStatus = "pending"    // 等待处理
	TaskItemStatusProcessing TaskItemStatus = "processing" // 处理中
	TaskItemStatusSuccess    TaskItemStatus = "success"    // 成功
	TaskItemStatusFailed     TaskItemStatus = "failed"     // 失败
	TaskItemStatusSkipped    TaskItemStatus = "skipped"    // 跳过
)

type TaskStatus added in v1.2.0

type TaskStatus string

TaskStatus 任务状态

const (
	TaskStatusPending   TaskStatus = "pending"   // 等待中
	TaskStatusRunning   TaskStatus = "running"   // 运行中
	TaskStatusPaused    TaskStatus = "paused"    // 已暂停
	TaskStatusCompleted TaskStatus = "completed" // 已完成
	TaskStatusFailed    TaskStatus = "failed"    // 失败
	TaskStatusCancelled TaskStatus = "cancelled" // 已取消
)

type TaskType added in v1.2.0

type TaskType string

TaskType 任务类型

const (
	TaskTypeBatchTransfer TaskType = "batch_transfer" // 批量转存
	TaskTypeExpansion     TaskType = "expansion"      // 账号扩容
	TaskTypeGoogleIndex   TaskType = "google_index"   // Google索引
)

type TelegramChannel added in v1.3.0

type TelegramChannel struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	// Telegram 频道/群组信息
	ChatID   int64  `json:"chat_id" gorm:"not null;comment:Telegram 聊天ID"`
	ChatName string `json:"chat_name" gorm:"size:255;not null;comment:聊天名称"`
	ChatType string `json:"chat_type" gorm:"size:50;not null;comment:类型:channel/group"`

	// 推送配置
	PushEnabled       bool   `json:"push_enabled" gorm:"default:true;comment:是否启用推送"`
	PushFrequency     int    `json:"push_frequency" gorm:"default:5;comment:推送频率(分钟)"`
	PushStartTime     string `json:"push_start_time" gorm:"size:10;comment:推送开始时间,格式HH:mm"`
	PushEndTime       string `json:"push_end_time" gorm:"size:10;comment:推送结束时间,格式HH:mm"`
	ContentCategories string `json:"content_categories" gorm:"type:text;comment:推送的内容分类,用逗号分隔"`
	ContentTags       string `json:"content_tags" gorm:"type:text;comment:推送的标签,用逗号分隔"`

	// 频道状态
	IsActive   bool       `json:"is_active" gorm:"default:true;comment:是否活跃"`
	LastPushAt *time.Time `json:"last_push_at" gorm:"comment:最后推送时间"`

	// 注册信息
	RegisteredBy string    `json:"registered_by" gorm:"size:100;comment:注册者用户名"`
	RegisteredAt time.Time `json:"registered_at"`

	// API配置
	API             string `json:"api" gorm:"size:255;comment:API地址"`
	Token           string `json:"token" gorm:"size:255;comment:访问令牌"`
	ApiType         string `json:"api_type" gorm:"size:50;comment:API类型"`
	IsPushSavedInfo bool   `json:"is_push_saved_info" gorm:"default:false;comment:是否只推送已转存资源"`

	// 资源策略和时间限制配置
	ResourceStrategy string `` /* 144-byte string literal not displayed */
	TimeLimit        string `json:"time_limit" gorm:"size:20;default:'none';comment:时间限制:none-无限制,week-一周内,month-一月内"`
}

TelegramChannel Telegram 频道/群组实体

func (TelegramChannel) TableName added in v1.3.0

func (TelegramChannel) TableName() string

TableName 指定表名

type URLStats added in v1.3.6

type URLStats struct {
	ID        uint      `gorm:"primaryKey" json:"id"`
	URLID     string    `gorm:"not null;index" json:"url_id"`
	Domain    string    `gorm:"not null;index" json:"domain"`
	Category  string    `gorm:"index" json:"category"`
	CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
}

URLStats URL统计表

type User

type User struct {
	ID        uint           `json:"id" gorm:"primaryKey;autoIncrement"`
	Username  string         `json:"username" gorm:"size:50;not null;unique;comment:用户名"`
	Password  string         `json:"-" gorm:"size:255;not null;comment:密码"`
	Email     string         `json:"email" gorm:"size:100;comment:邮箱"`
	Role      string         `json:"role" gorm:"size:20;default:'user';comment:角色"`
	IsActive  bool           `json:"is_active" gorm:"default:true;comment:是否激活"`
	LastLogin *time.Time     `json:"last_login" gorm:"comment:最后登录时间"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}

User 用户模型

func (User) TableName

func (User) TableName() string

TableName 指定表名

type UserInterest added in v1.3.6

type UserInterest struct {
	ID          uint      `gorm:"primaryKey" json:"id"`
	UserID      string    `gorm:"not null;index" json:"user_id"`
	Category    string    `gorm:"not null" json:"category"`
	Score       int       `gorm:"default:1" json:"score"`
	LastUpdated time.Time `gorm:"autoUpdateTime" json:"last_updated"`
}

UserInterest 用户兴趣标签表

type UserPreference added in v1.3.6

type UserPreference struct {
	ID                uint      `gorm:"primaryKey" json:"id"`
	UserID            string    `gorm:"not null;index" json:"user_id"`
	Category          string    `gorm:"not null" json:"category"`
	PreferencesJSON   string    `gorm:"type:text" json:"preferences_json"`
	NotificationEmail bool      `gorm:"default:true" json:"notification_email"`
	NotificationPush  bool      `gorm:"default:true" json:"notification_push"`
	CreatedAt         time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt         time.Time `gorm:"autoUpdateTime" json:"updated_at"`
}

UserPreference 用户偏好设置表

Jump to

Keyboard shortcuts

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