Files
xiaoxia-saas/packages/ports/verification_code_repository.py
xiaoxia 269723ced2
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Successful in 53s
CI/CD Pipeline / Frontend Lint (push) Successful in 2m57s
CI/CD Pipeline / Unit Tests (push) Successful in 4m29s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m9s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 4m35s
CI/CD Pipeline / Integration Tests (push) Successful in 1m53s
CI/CD Pipeline / Build Staging API Image (push) Successful in 13m17s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 16m0s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m14s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 44s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1m6s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m20s
feat(#558): 微信登录 + 绑定手机号邮箱完整后端实现 (#670)
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
2026-07-21 09:21:01 +08:00

33 lines
814 B
Python
Executable File

"""
验证码仓储接口
"""
from abc import ABC, abstractmethod
from typing import Optional
from packages.domain.verification_code import VerificationCode
class VerificationCodeRepository(ABC):
"""验证码仓储接口"""
@abstractmethod
def save(self, code: VerificationCode) -> None:
"""保存验证码"""
pass
@abstractmethod
def find_latest(self, recipient: str, code_type: str) -> Optional[VerificationCode]:
"""查找最新的有效验证码"""
pass
@abstractmethod
def find_by_id(self, code_id: str) -> Optional[VerificationCode]:
"""根据 ID 查找验证码"""
pass
@abstractmethod
def count_today(self, recipient: str, code_type: str) -> int:
"""统计当日发送次数(频控用)"""
pass