feat(server): add PATCH/DELETE /attachment/box mirroring product box ops

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-08-12 14:15:51 +08:00
parent 0ef4f0e990
commit 4d55420958
4 changed files with 235 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ from app.services.box_service import (
)
from app.services.attachment_service import (
AlreadyOffShelfAttachmentError,
AttachmentItemNotFoundError,
CategoryHasBoxesError,
CategoryNotFoundError,
DuplicateAttachmentBoxItemError,
@@ -247,6 +248,16 @@ async def duplicate_attachment_box_handler(
)
@app.exception_handler(AttachmentItemNotFoundError)
async def attachment_item_not_found_handler(
request: Request, exc: AttachmentItemNotFoundError
):
return JSONResponse(
status_code=404,
content={"error_code": "BOX_ITEM_NOT_FOUND", "message": "指定装箱明细不存在"},
)
@app.get("/")
async def root():
return {"message": "Welcome to CargoTrace API"}