修改账号注册方法,以及邮箱协议对接

This commit is contained in:
zyj
2025-09-24 18:22:25 +08:00
parent 002419a7ed
commit 81ed379cf3
21 changed files with 1090 additions and 8 deletions

27
services/email_service.go Normal file
View File

@@ -0,0 +1,27 @@
package services
import (
"go-account-register/models"
"go-account-register/utils"
"gorm.io/gorm"
)
type EmailService struct {
db *gorm.DB
}
func InitEmailService() *EmailService {
db := utils.GetDB()
return &EmailService{db: db}
}
func (e *EmailService) GetEmailOne() *models.Email {
var email models.Email
err := e.db.Model(email).Where("use_status = ?", 0).First(&email).Error
if err != nil {
return nil
}
return &email
}