This commit is contained in:
2025-07-20 20:53:26 +08:00
parent 83bf9aea7d
commit 8ad1d7288e
158 changed files with 18156 additions and 13188 deletions

View File

@@ -41,6 +41,7 @@ const (
SMSSceneResetPassword SMSScene = "reset_password" // 重置密码 - 忘记密码重置
SMSSceneBind SMSScene = "bind" // 绑定手机号 - 绑定新手机号
SMSSceneUnbind SMSScene = "unbind" // 解绑手机号 - 解绑当前手机号
SMSSceneCertification SMSScene = "certification" // 企业认证 - 企业入驻认证
)
// BeforeCreate GORM钩子创建前自动生成UUID
@@ -195,6 +196,7 @@ func (s *SMSCode) IsSceneValid() bool {
SMSSceneResetPassword,
SMSSceneBind,
SMSSceneUnbind,
SMSSceneCertification,
}
for _, scene := range validScenes {
@@ -214,6 +216,7 @@ func (s *SMSCode) GetSceneName() string {
SMSSceneResetPassword: "重置密码",
SMSSceneBind: "绑定手机号",
SMSSceneUnbind: "解绑手机号",
SMSSceneCertification: "企业认证",
}
if name, exists := sceneNames[s.Scene]; exists {
@@ -283,6 +286,7 @@ func IsValidScene(scene SMSScene) bool {
SMSSceneResetPassword,
SMSSceneBind,
SMSSceneUnbind,
SMSSceneCertification,
}
for _, validScene := range validScenes {
@@ -302,6 +306,7 @@ func GetSceneName(scene SMSScene) string {
SMSSceneResetPassword: "重置密码",
SMSSceneBind: "绑定手机号",
SMSSceneUnbind: "解绑手机号",
SMSSceneCertification: "企业认证",
}
if name, exists := sceneNames[scene]; exists {