Files
urldb/db/dto/telegram_channel.go

106 lines
4.5 KiB
Go
Raw Normal View History

2025-09-16 00:07:02 +08:00
package dto
import "time"
2025-09-19 18:37:50 +08:00
// TelegramChannelRequest 创建 Telegram 频道/群组请求
2025-09-16 00:07:02 +08:00
type TelegramChannelRequest struct {
ChatID int64 `json:"chat_id" binding:"required"`
ChatName string `json:"chat_name" binding:"required"`
ChatType string `json:"chat_type" binding:"required"` // channel 或 group
PushEnabled bool `json:"push_enabled"`
PushFrequency int `json:"push_frequency"`
2025-09-17 14:31:12 +08:00
PushStartTime string `json:"push_start_time"`
PushEndTime string `json:"push_end_time"`
2025-09-16 00:07:02 +08:00
ContentCategories string `json:"content_categories"`
2025-09-19 18:37:50 +08:00
ContentTags string `json:"content_tags"`
IsActive bool `json:"is_active"`
2025-10-10 19:17:03 +08:00
ResourceStrategy string `json:"resource_strategy"`
TimeLimit string `json:"time_limit"`
2025-09-19 18:37:50 +08:00
}
// TelegramChannelUpdateRequest 更新 Telegram 频道/群组请求ChatID可选
type TelegramChannelUpdateRequest struct {
ChatID int64 `json:"chat_id"` // 可选,用于验证
ChatName string `json:"chat_name" binding:"required"`
ChatType string `json:"chat_type" binding:"required"` // channel 或 group
PushEnabled bool `json:"push_enabled"`
PushFrequency int `json:"push_frequency"`
PushStartTime string `json:"push_start_time"`
PushEndTime string `json:"push_end_time"`
ContentCategories string `json:"content_categories"`
2025-09-16 00:07:02 +08:00
ContentTags string `json:"content_tags"`
IsActive bool `json:"is_active"`
2025-10-10 19:17:03 +08:00
ResourceStrategy string `json:"resource_strategy"`
TimeLimit string `json:"time_limit"`
2025-09-16 00:07:02 +08:00
}
// TelegramChannelResponse Telegram 频道/群组响应
type TelegramChannelResponse struct {
ID uint `json:"id"`
ChatID int64 `json:"chat_id"`
ChatName string `json:"chat_name"`
ChatType string `json:"chat_type"`
PushEnabled bool `json:"push_enabled"`
PushFrequency int `json:"push_frequency"`
2025-09-17 14:31:12 +08:00
PushStartTime string `json:"push_start_time"`
PushEndTime string `json:"push_end_time"`
2025-09-16 00:07:02 +08:00
ContentCategories string `json:"content_categories"`
ContentTags string `json:"content_tags"`
IsActive bool `json:"is_active"`
2025-10-10 19:17:03 +08:00
ResourceStrategy string `json:"resource_strategy"`
TimeLimit string `json:"time_limit"`
2025-09-16 00:07:02 +08:00
LastPushAt *time.Time `json:"last_push_at"`
RegisteredBy string `json:"registered_by"`
RegisteredAt time.Time `json:"registered_at"`
}
// TelegramBotConfigRequest Telegram 机器人配置请求
type TelegramBotConfigRequest struct {
BotEnabled *bool `json:"bot_enabled"`
BotApiKey *string `json:"bot_api_key"`
AutoReplyEnabled *bool `json:"auto_reply_enabled"`
AutoReplyTemplate *string `json:"auto_reply_template"`
AutoDeleteEnabled *bool `json:"auto_delete_enabled"`
AutoDeleteInterval *int `json:"auto_delete_interval"`
2025-09-18 18:34:35 +08:00
ProxyEnabled *bool `json:"proxy_enabled"`
ProxyType *string `json:"proxy_type"`
ProxyHost *string `json:"proxy_host"`
ProxyPort *int `json:"proxy_port"`
ProxyUsername *string `json:"proxy_username"`
ProxyPassword *string `json:"proxy_password"`
2025-09-16 00:07:02 +08:00
}
// TelegramBotConfigResponse Telegram 机器人配置响应
type TelegramBotConfigResponse struct {
BotEnabled bool `json:"bot_enabled"`
BotApiKey string `json:"bot_api_key"`
AutoReplyEnabled bool `json:"auto_reply_enabled"`
AutoReplyTemplate string `json:"auto_reply_template"`
AutoDeleteEnabled bool `json:"auto_delete_enabled"`
AutoDeleteInterval int `json:"auto_delete_interval"`
2025-09-18 18:34:35 +08:00
ProxyEnabled bool `json:"proxy_enabled"`
ProxyType string `json:"proxy_type"`
ProxyHost string `json:"proxy_host"`
ProxyPort int `json:"proxy_port"`
ProxyUsername string `json:"proxy_username"`
ProxyPassword string `json:"proxy_password"`
2025-09-16 00:07:02 +08:00
}
// ValidateTelegramApiKeyRequest 验证 Telegram API Key 请求
type ValidateTelegramApiKeyRequest struct {
2025-09-17 18:45:12 +08:00
ApiKey string `json:"api_key" binding:"required"`
ProxyEnabled bool `json:"proxy_enabled"`
ProxyType string `json:"proxy_type"`
ProxyHost string `json:"proxy_host"`
ProxyPort int `json:"proxy_port"`
ProxyUsername string `json:"proxy_username"`
ProxyPassword string `json:"proxy_password"`
2025-09-16 00:07:02 +08:00
}
// ValidateTelegramApiKeyResponse 验证 Telegram API Key 响应
type ValidateTelegramApiKeyResponse struct {
Valid bool `json:"valid"`
Error string `json:"error,omitempty"`
BotInfo map[string]interface{} `json:"bot_info,omitempty"`
}