feat(server): add GET /attachment/status with derived boxed qty

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-08-12 13:42:53 +08:00
parent ab774b8661
commit f155dc671b
3 changed files with 195 additions and 1 deletions

View File

@@ -3,7 +3,8 @@ from sqlalchemy.orm import Session
from app.core.database import get_db
from app.models.attachment import AttachmentCategory
from app.schemas.attachment import CategoryResponse
from app.schemas.attachment import AttachmentStatusResponse, CategoryResponse
from app.services.attachment_service import get_attachment_status
router = APIRouter(tags=["attachment"])
@@ -20,3 +21,8 @@ def list_categories(db: Session = Depends(get_db)):
return [
CategoryResponse(id=r.id, name=r.name, sort_order=r.sort_order) for r in rows
]
@router.get("/attachment/status", response_model=AttachmentStatusResponse)
def attachment_status(zongpai_no: str, db: Session = Depends(get_db)):
return get_attachment_status(db, zongpai_no)