feat: 新增访客拦截器

This commit is contained in:
2026-03-03 00:58:22 +08:00
parent 52cfe1b911
commit 00a0a01b17
7 changed files with 566 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ type Config struct {
Log LogConfig `mapstructure:"log"`
MySQL MySQLConfig `mapstructure:"mysql"`
Redis RedisConfig `mapstructure:"redis"`
JWT JWTConfig `mapstructure:"jwt"`
}
// ServerConfig represents server configuration
@@ -73,6 +74,13 @@ type RedisConfig struct {
WriteTimeout int `mapstructure:"write_timeout"` // seconds
}
// JWTConfig represents jwt configuration
type JWTConfig struct {
Secret string `mapstructure:"secret"`
Issuer string `mapstructure:"issuer"`
Expires int `mapstructure:"expires"` // hours
}
// Load loads configuration from environment variable CFG_PATH
// Default path is config/config.yml
func Load() (*Config, error) {