Initial backend repository commit.
Set up project files and add .gitignore to exclude local build/runtime artifacts. Made-with: Cursor
This commit is contained in:
33
internal/pkg/email/config.go
Normal file
33
internal/pkg/email/config.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package email
|
||||
|
||||
import "carrot_bbs/internal/config"
|
||||
|
||||
// Config SMTP 邮件配置(由应用配置转换)
|
||||
type Config struct {
|
||||
Enabled bool
|
||||
Host string
|
||||
Port int
|
||||
Username string
|
||||
Password string
|
||||
FromAddress string
|
||||
FromName string
|
||||
UseTLS bool
|
||||
InsecureSkipVerify bool
|
||||
TimeoutSeconds int
|
||||
}
|
||||
|
||||
// ConfigFromAppConfig 从应用配置转换
|
||||
func ConfigFromAppConfig(cfg *config.EmailConfig) Config {
|
||||
return Config{
|
||||
Enabled: cfg.Enabled,
|
||||
Host: cfg.Host,
|
||||
Port: cfg.Port,
|
||||
Username: cfg.Username,
|
||||
Password: cfg.Password,
|
||||
FromAddress: cfg.FromAddress,
|
||||
FromName: cfg.FromName,
|
||||
UseTLS: cfg.UseTLS,
|
||||
InsecureSkipVerify: cfg.InsecureSkipVerify,
|
||||
TimeoutSeconds: cfg.Timeout,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user