feat: 新增卡状态轮询任务类型常量及 verbose_log 配置

constants.go: 新增 TaskTypePollingCardStatus = "polling:card_status"
config.go: 新增 PollingConfig struct 含 VerboseLog bool
config.yaml: polling.verbose_log 默认 false

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-15 12:21:43 +08:00
parent e2003eb9e3
commit 9992e82a3c
3 changed files with 17 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ type Config struct {
Storage StorageConfig `mapstructure:"storage"` Storage StorageConfig `mapstructure:"storage"`
Gateway GatewayConfig `mapstructure:"gateway"` Gateway GatewayConfig `mapstructure:"gateway"`
PollingAutoTrigger PollingAutoTriggerConfig `mapstructure:"polling_auto_trigger"` PollingAutoTrigger PollingAutoTriggerConfig `mapstructure:"polling_auto_trigger"`
Polling PollingConfig `mapstructure:"polling"`
} }
// ServerConfig HTTP 服务器配置 // ServerConfig HTTP 服务器配置
@@ -140,6 +141,13 @@ type GatewayConfig struct {
Timeout int `mapstructure:"timeout"` // 超时时间(秒) Timeout int `mapstructure:"timeout"` // 超时时间(秒)
} }
// PollingConfig 轮询通用配置
type PollingConfig struct {
// VerboseLog 开启后,所有轮询 handler 在成功获取上游数据时以 Info 级别输出详细日志
// 环境变量JUNHONG_POLLING_VERBOSE_LOG
VerboseLog bool `mapstructure:"verbose_log"`
}
// PollingAutoTriggerConfig 轮询自动触发配置 // PollingAutoTriggerConfig 轮询自动触发配置
type PollingAutoTriggerConfig struct { type PollingAutoTriggerConfig struct {
// EnableAutoTrigger 是否启用C端实名自动触发 // EnableAutoTrigger 是否启用C端实名自动触发

View File

@@ -116,6 +116,10 @@ gateway:
app_secret: "BZeQttaZQt0i73moF" app_secret: "BZeQttaZQt0i73moF"
timeout: 30 timeout: 30
# 轮询配置
polling:
verbose_log: false # 是否开启详细日志环境变量JUNHONG_POLLING_VERBOSE_LOG
# 轮询自动触发配置 # 轮询自动触发配置
polling_auto_trigger: polling_auto_trigger:
enable_auto_trigger: true enable_auto_trigger: true

View File

@@ -51,10 +51,11 @@ const (
TaskTypeCommissionStatsArchive = "commission:stats:archive" // 佣金统计归档 TaskTypeCommissionStatsArchive = "commission:stats:archive" // 佣金统计归档
// 轮询任务类型 // 轮询任务类型
TaskTypePollingRealname = "polling:realname" // 实名状态检查 TaskTypePollingRealname = "polling:realname" // 实名状态检查
TaskTypePollingCarddata = "polling:carddata" // 卡流量检查 TaskTypePollingCarddata = "polling:carddata" // 卡流量检查
TaskTypePollingPackage = "polling:package" // 套餐流量检查 TaskTypePollingPackage = "polling:package" // 套餐流量检查
TaskTypePollingProtect = "polling:protect" // 保护期一致性检查 TaskTypePollingProtect = "polling:protect" // 保护期一致性检查
TaskTypePollingCardStatus = "polling:card_status" // 卡开停机状态检查
// 套餐激活任务类型 // 套餐激活任务类型
TaskTypePackageFirstActivation = "package:first:activation" // 首次实名激活 TaskTypePackageFirstActivation = "package:first:activation" // 首次实名激活