Files
xiaoxia-saas/packages/ports/title_library_repository.py
xiaoxia 52ff2f80ad
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
style: apply black formatting to pass CI validation (#126)
2026-06-30 17:23:08 +08:00

32 lines
847 B
Python

"""Title library repository port."""
from __future__ import annotations
from typing import List, Optional, Protocol
from packages.domain.title_library import TitleLibraryItem
class TitleLibraryRepository(Protocol):
"""标题库仓储接口"""
def list_by_user(
self,
user_id: str,
*,
category: Optional[str] = None,
is_active: bool = True,
skip: int = 0,
limit: int = 50,
) -> List[TitleLibraryItem]: ...
def get(self, title_id: str, user_id: str) -> Optional[TitleLibraryItem]: ...
def create(self, item: TitleLibraryItem) -> TitleLibraryItem: ...
def update(self, item: TitleLibraryItem) -> TitleLibraryItem: ...
def delete(self, title_id: str, user_id: str) -> bool: ...
def count_by_user(self, user_id: str, is_active: bool = True) -> int: ...