feat(server): add PATCH/DELETE /attachment/box mirroring product box ops
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
11
app/main.py
11
app/main.py
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user