feat(utils): 新增工具类:邮箱、请求

This commit is contained in:
2025-11-24 22:07:55 +08:00
parent 584575fd29
commit 09ea1ab8fe
3 changed files with 127 additions and 0 deletions

View File

@@ -36,11 +36,19 @@ type JWT struct {
ExpireDurationHour time.Duration `mapstructure:"expire_duration_hour"`
}
type Email struct {
SMTPServer string `mapstructure:"smtp_server"`
Port int `mapstructure:"port"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
}
type Config struct {
Server Server `mapstructure:"server"`
Log Log `mapstructure:"log"`
Database Database `mapstructure:"database"`
JWT JWT `mapstructure:"jwt"`
Email Email `mapstructure:"email"`
}
func DefaultConfig() *Config {
@@ -72,5 +80,11 @@ func DefaultConfig() *Config {
SecretKey: common.Rand(16),
ExpireDurationHour: 24,
},
Email: Email{
SMTPServer: "smtp.qq.com",
Port: 465,
Username: "xxx@qq.com",
Password: "xxx",
},
}
}