This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(conf): Rename notify to admin_notify & admin_notify.email op…
…tion Signed-off-by: qwqcode <qwqcode@gmail.com>
- Loading branch information
Showing
6 changed files
with
53 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,26 +5,27 @@ import "time" | |
// Config 配置 | ||
// @link https://godoc.org/github.com/mitchellh/mapstructure | ||
type Config struct { | ||
AppKey string `mapstructure:"app_key" json:"app_key"` // 加密密钥 | ||
Debug bool `mapstructure:"debug" json:"debug"` // 调试模式 | ||
TimeZone string `mapstructure:"timezone" json:"timezone"` // 时区 | ||
Host string `mapstructure:"host" json:"host"` // HTTP Server 监听 IP | ||
Port int `mapstructure:"port" json:"port"` // HTTP Server 监听 Port | ||
DB DBConf `mapstructure:"db" json:"db"` // 数据文件 | ||
Cache CacheConf `mapstructure:"cache" json:"cache"` // 缓存 | ||
Log LogConf `mapstructure:"log" json:"log"` // 日志文件 | ||
AllowOrigins []string `mapstructure:"allow_origins" json:"allow_origins"` // @deprecated 已废弃 (请使用 TrustedDomains) | ||
TrustedDomains []string `mapstructure:"trusted_domains" json:"trusted_domains"` // 可信任的域名 (新) | ||
SSL SSLConf `mapstructure:"ssl" json:"ssl"` // SSL | ||
SiteDefault string `mapstructure:"site_default" json:"site_default"` // 默认站点名(当请求无指定 site_name 时使用) | ||
AdminUsers []AdminUserConf `mapstructure:"admin_users" json:"admin_users"` // 管理员账户 | ||
LoginTimeout int `mapstructure:"login_timeout" json:"login_timeout"` // 登陆超时 | ||
Moderator ModeratorConf `mapstructure:"moderator" json:"moderator"` // 评论审查 | ||
Captcha CaptchaConf `mapstructure:"captcha" json:"captcha"` // 验证码 | ||
Email EmailConf `mapstructure:"email" json:"email"` // 邮箱提醒 | ||
ImgUpload ImgUploadConf `mapstructure:"img_upload" json:"img_upload"` // 图片上传 | ||
Notify NotifyConf `mapstructure:"notify" json:"notify"` // 其他通知方式 | ||
Frontend FrontendConf `mapstructure:"frontend" json:"frontend"` | ||
AppKey string `mapstructure:"app_key" json:"app_key"` // 加密密钥 | ||
Debug bool `mapstructure:"debug" json:"debug"` // 调试模式 | ||
TimeZone string `mapstructure:"timezone" json:"timezone"` // 时区 | ||
Host string `mapstructure:"host" json:"host"` // HTTP Server 监听 IP | ||
Port int `mapstructure:"port" json:"port"` // HTTP Server 监听 Port | ||
DB DBConf `mapstructure:"db" json:"db"` // 数据文件 | ||
Cache CacheConf `mapstructure:"cache" json:"cache"` // 缓存 | ||
Log LogConf `mapstructure:"log" json:"log"` // 日志文件 | ||
AllowOrigins []string `mapstructure:"allow_origins" json:"allow_origins"` // @deprecated 已废弃 (请使用 TrustedDomains) | ||
TrustedDomains []string `mapstructure:"trusted_domains" json:"trusted_domains"` // 可信任的域名 (新) | ||
SSL SSLConf `mapstructure:"ssl" json:"ssl"` // SSL | ||
SiteDefault string `mapstructure:"site_default" json:"site_default"` // 默认站点名(当请求无指定 site_name 时使用) | ||
AdminUsers []AdminUserConf `mapstructure:"admin_users" json:"admin_users"` // 管理员账户 | ||
LoginTimeout int `mapstructure:"login_timeout" json:"login_timeout"` // 登陆超时 | ||
Moderator ModeratorConf `mapstructure:"moderator" json:"moderator"` // 评论审查 | ||
Captcha CaptchaConf `mapstructure:"captcha" json:"captcha"` // 验证码 | ||
Email EmailConf `mapstructure:"email" json:"email"` // 邮箱提醒 | ||
ImgUpload ImgUploadConf `mapstructure:"img_upload" json:"img_upload"` // 图片上传 | ||
AdminNotify AdminNotifyConf `mapstructure:"admin_notify" json:"admin_notify"` // 其他通知方式 | ||
Notify *AdminNotifyConf `mapstructure:"notify" json:"notify"` // @deprecated 已废弃 (请使用 AdminNotify) | ||
This comment has been minimized.
Sorry, something went wrong.
qwqcode
Author
Member
|
||
Frontend FrontendConf `mapstructure:"frontend" json:"frontend"` | ||
} | ||
|
||
type DBConf struct { | ||
|
@@ -141,7 +142,7 @@ type EmailConf struct { | |
SendName string `mapstructure:"send_name" json:"send_name"` // 发件人名 | ||
SendAddr string `mapstructure:"send_addr" json:"send_addr"` // 发件人地址 | ||
MailSubject string `mapstructure:"mail_subject" json:"mail_subject"` // 邮件标题 | ||
MailSubjectToAdmin string `mapstructure:"mail_subject_to_admin" json:"mail_subject_to_admin"` // 邮件标题 (发送给管理员用) | ||
MailSubjectToAdmin string `mapstructure:"mail_subject_to_admin" json:"mail_subject_to_admin"` // @deprecated 已废弃 (请使用 AdminNotify.Email.MailSubject) - 邮件标题 (发送给管理员用) | ||
MailTpl string `mapstructure:"mail_tpl" json:"mail_tpl"` // 邮件模板 | ||
SMTP SMTPConf `mapstructure:"smtp" json:"smtp"` // SMTP 配置 | ||
AliDM AliDMConf `mapstructure:"ali_dm" json:"ali_dm"` // 阿里云邮件配置 | ||
|
@@ -216,7 +217,8 @@ type UpgitConf struct { | |
} | ||
|
||
// 其他通知方式 | ||
type NotifyConf struct { | ||
type AdminNotifyConf struct { | ||
Email EmailConf `mapstructure:"email" json:"email"` // 邮件通知 | ||
Telegram NotifyTelegramConf `mapstructure:"telegram" json:"telegram"` // TG | ||
Lark NotifyLarkConf `mapstructure:"lark" json:"lark"` // 飞书 | ||
DingTalk NotifyDingTalkConf `mapstructure:"ding_talk" json:"ding_talk"` // 钉钉 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mail_subject_to_admin 弃用,变更为 admin_notify.email.mail_subject