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
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
63 lines
1.5 KiB
Python
Executable File
63 lines
1.5 KiB
Python
Executable File
"""
|
|
用户仓储接口
|
|
"""
|
|
|
|
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from packages.domain.entities import User
|
|
|
|
|
|
class UserRepository(ABC):
|
|
"""用户仓储接口"""
|
|
|
|
@abstractmethod
|
|
def save(self, user: User) -> None:
|
|
"""保存用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_id(self, user_id: str) -> Optional[User]:
|
|
"""根据 ID 查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_email(self, email: str) -> Optional[User]:
|
|
"""根据邮箱查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_username(self, username: str) -> Optional[User]:
|
|
"""根据用户名查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_verification_token(self, token: str) -> Optional[User]:
|
|
"""根据邮箱验证令牌查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_password_reset_token(self, token: str) -> Optional[User]:
|
|
"""根据密码重置令牌查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_wechat_openid(self, openid: str) -> Optional[User]:
|
|
"""根据微信 openid 查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_wechat_unionid(self, unionid: str) -> Optional[User]:
|
|
"""根据微信 unionid 查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_phone(self, phone: str) -> Optional[User]:
|
|
"""根据手机号查找用户"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def delete(self, user_id: str) -> bool:
|
|
"""删除用户"""
|
|
pass
|