feat: support send Email to others (close #44)

This commit is contained in:
JustSong
2023-04-16 11:23:05 +08:00
parent 3d38260e5b
commit c16530cf6e
5 changed files with 53 additions and 5 deletions
+2 -1
View File
@@ -42,6 +42,7 @@ type User struct {
TelegramBotToken string `json:"telegram_bot_token"`
TelegramChatId string `json:"telegram_chat_id"`
DiscordWebhookURL string `json:"discord_webhook_url"`
SendEmailToOthers int `json:"send_email_to_others" gorm:"type:int;default:0"`
}
func GetMaxUserId() int {
@@ -51,7 +52,7 @@ func GetMaxUserId() int {
}
func GetAllUsers(startIdx int, num int) (users []*User, err error) {
err = DB.Order("id desc").Limit(num).Offset(startIdx).Select([]string{"id", "username", "display_name", "role", "status", "email"}).Find(&users).Error
err = DB.Order("id desc").Limit(num).Offset(startIdx).Select([]string{"id", "username", "display_name", "role", "status", "email", "send_email_to_others"}).Find(&users).Error
return users, err
}