feat(auth): 登录注册 - 添加短信通知与组合验证支持

This commit is contained in:
ddCat
2026-09-22 23:44:23 +08:00
parent 6c013ebf7e
commit bc0d109428
55 changed files with 4013 additions and 103 deletions

View File

@@ -29,6 +29,10 @@ func Models() []any {
&model.UserIdentity{},
&model.OAuthState{},
&model.EmailVerificationCode{},
&model.AuthVerification{},
&model.NotificationQuota{},
&model.SMSChannel{},
&model.SMSRecord{},
&model.ModelChannel{},
&model.ChannelModel{},
&model.ChannelModelPriceTier{},
@@ -159,6 +163,9 @@ func migrateSchemaV1(db *gorm.DB) error {
if err := db.Exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_logical_model_source_active ON logical_models(source_channel_model_id) WHERE source_channel_model_id <> '' AND archived_at IS NULL").Error; err != nil {
return err
}
if err := db.Exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_users_phone_nonempty ON users(phone) WHERE phone <> ''").Error; err != nil {
return err
}
return db.Exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_users_email_nonempty ON users(lower(email)) WHERE email <> ''").Error
}