From 70c903f876a4e359e4cf1821b1bfe45d90a8c0d2 Mon Sep 17 00:00:00 2001 From: YGXB_net Date: Sun, 26 Jul 2026 18:13:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E6=B7=BB=E5=8A=A0=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E4=BB=A4=E7=89=8C=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/config/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index a8f2087..1795ebe 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,6 +11,8 @@ import ( type Config struct { Url string `json:"url" mapstructure:"url"` Token string `json:"token" mapstructure:"token"` + HasVideoToken string `json:"has_video_token" mapstructure:"has-video-token"` + NoVideoToken string `json:"no_video_token" mapstructure:"no-video-token"` ThreadCount int `json:"thread_count" mapstructure:"thread-count"` HandleFileCount int `json:"handle_file_count" mapstructure:"handle-file-count"` IsRunOnStart bool `json:"is_run_on_start" mapstructure:"is-run-on-start"` @@ -24,6 +26,8 @@ var configMu sync.Mutex const ( Url = "url" Token = "token" + HasVideoToken = "has-video-token" + NoVideoToken = "no-video-token" ThreadCount = "thread-count" HandleFileCount = "handle-file-count" IsRunOnStart = "is-run-on-start" @@ -36,6 +40,8 @@ func InitConfig() { defaultConfig := Config{ Url: "http://127.0.0.1:8080", Token: "", + HasVideoToken: "1234", + NoVideoToken: "5678", ThreadCount: 10, HandleFileCount: 25, IsRunOnStart: false, @@ -44,6 +50,8 @@ func InitConfig() { } viper.SetDefault(Url, defaultConfig.Url) viper.SetDefault(Token, defaultConfig.Token) + viper.SetDefault(HasVideoToken, defaultConfig.HasVideoToken) + viper.SetDefault(NoVideoToken, defaultConfig.NoVideoToken) viper.SetDefault(ThreadCount, defaultConfig.ThreadCount) viper.SetDefault(HandleFileCount, defaultConfig.HandleFileCount) viper.SetDefault(IsRunOnStart, defaultConfig.IsRunOnStart)