fix: PR#164审查修复 - P1 count_by_user status参数 + P2 内存分页优化
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 170h11m59s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 170h12m4s
Deploy / Deploy Staging (push) Failing after 170h14m34s
CI/CD Pipeline / Frontend Lint (push) Failing after 170h15m9s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 170h15m14s
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 170h11m59s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 170h12m4s
Deploy / Deploy Staging (push) Failing after 170h14m34s
CI/CD Pipeline / Frontend Lint (push) Failing after 170h15m9s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 170h15m14s
P1修复: - voice_library_repository.count_by_user() 增加可选 status 参数 - 修复 list_voices_unified 中 TypeError: count_by_user got unexpected keyword argument 'status' P2修复: - 移除 limit=1000 全量拉取,改为直接传递 skip/limit 到仓储层 - 删除冗余的 clone_repository_count() 辅助函数 - 优化统一列表分页逻辑,代码更清晰 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,15 +110,17 @@ class SQLAlchemyVoiceLibraryRepository:
|
||||
self.session.commit()
|
||||
return True
|
||||
|
||||
def count_by_user(self, user_id: str) -> int:
|
||||
return (
|
||||
def count_by_user(self, user_id: str, *, status: Optional[str] = None) -> int:
|
||||
query = (
|
||||
self.session.query(VoiceLibraryModel)
|
||||
.filter(
|
||||
VoiceLibraryModel.user_id == user_id,
|
||||
VoiceLibraryModel.status != "deleted",
|
||||
)
|
||||
.count()
|
||||
)
|
||||
if status:
|
||||
query = query.filter(VoiceLibraryModel.status == status)
|
||||
return query.count()
|
||||
|
||||
@staticmethod
|
||||
def _model_to_entity(model: VoiceLibraryModel) -> VoiceLibraryItem:
|
||||
|
||||
Reference in New Issue
Block a user