feat(location): add paicha overview endpoint
This commit is contained in:
17
app/main.py
17
app/main.py
@@ -18,7 +18,11 @@ except Exception as e:
|
||||
|
||||
from app.api.v1.location import router as location_router
|
||||
from app.api.v1.box import router as box_router
|
||||
from app.services.location_service import AlreadyOffShelfError, DuplicateLocationError
|
||||
from app.services.location_service import (
|
||||
AlreadyOffShelfError,
|
||||
DuplicateLocationError,
|
||||
PaichaNotFoundError,
|
||||
)
|
||||
from app.services.box_service import (
|
||||
BoxItemNotFoundError,
|
||||
DuplicateBoxItemError,
|
||||
@@ -137,6 +141,17 @@ async def box_item_not_found_handler(request: Request, exc: BoxItemNotFoundError
|
||||
)
|
||||
|
||||
|
||||
@app.exception_handler(PaichaNotFoundError)
|
||||
async def paicha_not_found_handler(request: Request, exc: PaichaNotFoundError):
|
||||
return JSONResponse(
|
||||
status_code=404,
|
||||
content={
|
||||
"error_code": "PAICHA_NOT_FOUND",
|
||||
"message": "暂无排产信息",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@app.exception_handler(InvalidQuantityError)
|
||||
async def invalid_quantity_handler(request: Request, exc: InvalidQuantityError):
|
||||
return JSONResponse(
|
||||
|
||||
Reference in New Issue
Block a user