feat(utils): 新增工具类:邮箱、请求
This commit is contained in:
@@ -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",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user