This commit is contained in:
oneao committed 2026-01-25 22:18:27 +08:00
1 parent 500fab7a80
commit 8f3f6982db
54 files changed
+2076 -1877

No files matched your search

+10 -4
View File
@@ -1,11 +1,12 @@
package conf
import (
"github.com/spf13/viper"
"os"
"path/filepath"
"sync"
"time"
"github.com/spf13/viper"
)
var (
@@ -21,6 +22,7 @@ type Config struct {
Snowflake SnowflakeConfig `mapstructure:"snowflake" yaml:"snowflake"`
Pgsql PgsqlConfig `mapstructure:"pgsql" yaml:"pgsql"`
Log LogConfig `mapstructure:"log" yaml:"log"`
Wx WxConfig `mapstructure:"wx" yaml:"wx"`
}
type ServerConfig struct {
@@ -29,9 +31,8 @@ type ServerConfig struct {
}
type JwtConfig struct {
Secret string `mapstructure:"secret" yaml:"secret"`
AccessExpiry time.Duration `mapstructure:"access_expiry" yaml:"access_expiry"`
RefreshExpiry time.Duration `mapstructure:"refresh_expiry" yaml:"refresh_expiry"`
Secret string `mapstructure:"secret" yaml:"secret"`
AccessExpiry time.Duration `mapstructure:"access_expiry" yaml:"access_expiry"`
}
type SnowflakeConfig struct {
@@ -61,6 +62,11 @@ type LogConfig struct {
Compress bool `mapstructure:"compress" yaml:"compress"`
}
type WxConfig struct {
AppId string `mapstructure:"app_id" yaml:"app_id"`
AppSecret string `mapstructure:"app_secret" yaml:"app_secret"`
}
func GetConf() *Config {
once.Do(initConf)
return conf