Files
xiaoxia-saas/packages/ports/verification_code_repository.py
xiaoxia 269723ced2
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1m6s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1374h8m10s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1374h8m12s
CI/CD Pipeline / Build Production API Image (push) Failing after 1374h8m13s
CI/CD Pipeline / Deploy Production (push) Failing after 1374h8m11s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1374h8m14s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Has been skipped
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1374h40m21s
CI/CD Pipeline / ACR Image Cleanup (push) Has been skipped
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