feat: add versioned app chat API and fix release isolation bug

This commit is contained in:
wxy
2026-04-10 17:22:11 +08:00
parent 72fe3962cf
commit af83980f99
3 changed files with 9 additions and 9 deletions

View File

@@ -63,13 +63,13 @@ def get_apps_by_id(db: Session, app_id: uuid.UUID) -> App:
return repo.get_apps_by_id(app_id)
def get_release_by_version(db: Session, app_id: uuid.UUID, version: int):
"""根据版本号查询发布快照(仅返回激活状态)"""
def get_release_by_version(db: Session, app_id: uuid.UUID, release_id: uuid.UUID):
"""根据发布版本ID查询发布快照(仅返回激活状态)"""
from app.models.app_release_model import AppRelease
return db.scalars(
select(AppRelease).where(
AppRelease.app_id == app_id,
AppRelease.version == version,
AppRelease.id == release_id,
AppRelease.is_active.is_(True),
)
).first()