{"repo": "adminer32/pycharmprojects", "files": {"GoBackend/internal/config/config.go": {"7bc5ead1e1d495d50b3e16f44ab17e53a2464d37": {"t": 1785746070.6643183, "n": 1973, "h": "3687a45ec37bef98", "c": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n)\n\ntype Config struct {\n\tServerAddr string\n\tVideoBasePath string\n\tUploadsPath string\n\tDatabase DatabaseConfig\n\tRedis RedisConfig\n\tJWT JWTConfig\n\tDeepSeek DeepSeekConfig\n\tDashScope DashScopeConfig\n\tSendGrid SendGridConfig\n\tCloudflareTurnstile CloudflareConfig\n}\n\ntype DatabaseConfig struct {\n\tHost string\n\tPort string\n\tUser string\n\tPassword string\n\tDBName string\n\tCharset string\n}\n\ntype RedisConfig struct {\n\tHost string\n\tPort string\n\tPassword string\n\tDB int\n}\n\ntype JWTConfig struct {\n\tSecret string\n\tAccessExpiry int64 // seconds\n\tRefreshExpiry int64\n}\n\ntype DeepSeekConfig struct {\n\tAPIKey string\n\tBaseURL string\n\tModel string\n}\n\ntype DashScopeConfig struct {\n\tAPIKey string\n}\n\ntype SendGridConfig struct {\n\tAPIKey string\n}\n\ntype CloudflareConfig struct {\n\tSiteKey string\n\tSecretKey string\n}\n\nfunc Load(path ...string) *Config {\n\tcfgPath := \"configs/config.json\"\n\tif len(path) > 0 {\n\t\tcfgPath = path[0]\n\t}\n\n\tdata, err := os.ReadFile(cfgPath)\n\tif err != nil {\n\t\t// fallback to env or defaults\n\t\treturn defaultConfig()\n\t}\n\n\tvar cfg Config\n\tif err := json.Unmarshal(data, &cfg); err != nil {\n\t\treturn defaultConfig()\n\t}\n\treturn &cfg\n}\n\nfunc defaultConfig() *Config {\n\treturn &Config{\n\t\tServerAddr: \":8001\",\n\t\tVideoBasePath: \"/home/mrliao/下载/GVHMR/InputVideo/视频\",\n\t\tUploadsPath: \"./data/uploads\",\n\t\tDatabase: DatabaseConfig{\n\t\t\tHost: \"127.0.0.1\",\n\t\t\tPort: \"3306\",\n\t\t\tUser: \"root\",\n\t\t\tPassword: \"\",\n\t\t\tDBName: \"aiidecn\",\n\t\t\tCharset: \"utf8mb4\",\n\t\t},\n\t\tRedis: RedisConfig{\n\t\t\tHost: \"127.0.0.1\",\n\t\t\tPort: \"6379\",\n\t\t\tDB: 0,\n\t\t},\n\t\tJWT: JWTConfig{\n\t\t\tSecret: \"change-me-in-production\",\n\t\t\tAccessExpiry: 14400,\n\t\t\tRefreshExpiry: 604800,\n\t\t},\n\t\tDeepSeek: DeepSeekConfig{\n\t\t\tBaseURL: \"https://api.deepseek.com/v1\",\n\t\t\tModel: \"deepseek-chat\",\n\t\t},\n\t\tDashScope: DashScopeConfig{\n\t\t\tAPIKey: \"\",\n\t\t},\n\t}\n}"}, "c384ba1e438ebe72dadff7abb010001e27ee501c": {"t": 1785759502.2755218, "n": 1973, "h": "3687a45ec37bef98", "c": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n)\n\ntype Config struct {\n\tServerAddr string\n\tVideoBasePath string\n\tUploadsPath string\n\tDatabase DatabaseConfig\n\tRedis RedisConfig\n\tJWT JWTConfig\n\tDeepSeek DeepSeekConfig\n\tDashScope DashScopeConfig\n\tSendGrid SendGridConfig\n\tCloudflareTurnstile CloudflareConfig\n}\n\ntype DatabaseConfig struct {\n\tHost string\n\tPort string\n\tUser string\n\tPassword string\n\tDBName string\n\tCharset string\n}\n\ntype RedisConfig struct {\n\tHost string\n\tPort string\n\tPassword string\n\tDB int\n}\n\ntype JWTConfig struct {\n\tSecret string\n\tAccessExpiry int64 // seconds\n\tRefreshExpiry int64\n}\n\ntype DeepSeekConfig struct {\n\tAPIKey string\n\tBaseURL string\n\tModel string\n}\n\ntype DashScopeConfig struct {\n\tAPIKey string\n}\n\ntype SendGridConfig struct {\n\tAPIKey string\n}\n\ntype CloudflareConfig struct {\n\tSiteKey string\n\tSecretKey string\n}\n\nfunc Load(path ...string) *Config {\n\tcfgPath := \"configs/config.json\"\n\tif len(path) > 0 {\n\t\tcfgPath = path[0]\n\t}\n\n\tdata, err := os.ReadFile(cfgPath)\n\tif err != nil {\n\t\t// fallback to env or defaults\n\t\treturn defaultConfig()\n\t}\n\n\tvar cfg Config\n\tif err := json.Unmarshal(data, &cfg); err != nil {\n\t\treturn defaultConfig()\n\t}\n\treturn &cfg\n}\n\nfunc defaultConfig() *Config {\n\treturn &Config{\n\t\tServerAddr: \":8001\",\n\t\tVideoBasePath: \"/home/mrliao/下载/GVHMR/InputVideo/视频\",\n\t\tUploadsPath: \"./data/uploads\",\n\t\tDatabase: DatabaseConfig{\n\t\t\tHost: \"127.0.0.1\",\n\t\t\tPort: \"3306\",\n\t\t\tUser: \"root\",\n\t\t\tPassword: \"\",\n\t\t\tDBName: \"aiidecn\",\n\t\t\tCharset: \"utf8mb4\",\n\t\t},\n\t\tRedis: RedisConfig{\n\t\t\tHost: \"127.0.0.1\",\n\t\t\tPort: \"6379\",\n\t\t\tDB: 0,\n\t\t},\n\t\tJWT: JWTConfig{\n\t\t\tSecret: \"change-me-in-production\",\n\t\t\tAccessExpiry: 14400,\n\t\t\tRefreshExpiry: 604800,\n\t\t},\n\t\tDeepSeek: DeepSeekConfig{\n\t\t\tBaseURL: \"https://api.deepseek.com/v1\",\n\t\t\tModel: \"deepseek-chat\",\n\t\t},\n\t\tDashScope: DashScopeConfig{\n\t\t\tAPIKey: \"\",\n\t\t},\n\t}\n}"}}, "GoBackend/configs/config.json": {"7bc5ead1e1d495d50b3e16f44ab17e53a2464d37": {"t": 1785746776.205162, "n": 816, "h": "c33ab518515c0ad6", "c": "{\n \"server_addr\": \":8001\",\n \"video_base_path\": \"/home/mrliao/下载/GVHMR/InputVideo/视频\",\n \"uploads_path\": \"./data/uploads\",\n \"database\": {\n \"host\": \"192.168.1.2\",\n \"port\": \"3306\",\n \"user\": \"root\",\n \"password\": \"\",\n \"db_name\": \"aiidecn\",\n \"charset\": \"utf8mb4\"\n },\n \"redis\": {\n \"host\": \"127.0.0.1\",\n \"port\": \"6379\",\n \"password\": \"\",\n \"db\": 0\n },\n \"jwt\": {\n \"secret\": \"replace-me-with-secure-secret\",\n \"access_expiry\": 14400,\n \"refresh_expiry\": 604800\n },\n \"deepseek\": {\n \"api_key\": \"sk-your-deepseek-api-key\",\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"model\": \"deepseek-chat\"\n },\n \"dashscope\": {\n \"api_key\": \"sk-your-dashscope-api-key\"\n },\n \"sendgrid\": {\n \"api_key\": \"\"\n },\n \"cloudflare_turnstile\": {\n \"site_key\": \"\",\n \"secret_key\": \"\"\n }\n}"}, "c384ba1e438ebe72dadff7abb010001e27ee501c": {"t": 1785759505.7756836, "n": 816, "h": "c33ab518515c0ad6", "c": "{\n \"server_addr\": \":8001\",\n \"video_base_path\": \"/home/mrliao/下载/GVHMR/InputVideo/视频\",\n \"uploads_path\": \"./data/uploads\",\n \"database\": {\n \"host\": \"192.168.1.2\",\n \"port\": \"3306\",\n \"user\": \"root\",\n \"password\": \"\",\n \"db_name\": \"aiidecn\",\n \"charset\": \"utf8mb4\"\n },\n \"redis\": {\n \"host\": \"127.0.0.1\",\n \"port\": \"6379\",\n \"password\": \"\",\n \"db\": 0\n },\n \"jwt\": {\n \"secret\": \"replace-me-with-secure-secret\",\n \"access_expiry\": 14400,\n \"refresh_expiry\": 604800\n },\n \"deepseek\": {\n \"api_key\": \"sk-your-deepseek-api-key\",\n \"base_url\": \"https://api.deepseek.com/v1\",\n \"model\": \"deepseek-chat\"\n },\n \"dashscope\": {\n \"api_key\": \"sk-your-dashscope-api-key\"\n },\n \"sendgrid\": {\n \"api_key\": \"\"\n },\n \"cloudflare_turnstile\": {\n \"site_key\": \"\",\n \"secret_key\": \"\"\n }\n}"}}}}