feat(server): add POST /attachment/box with real-evidence flip + cap
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,8 @@ from sqlalchemy.orm import Session
|
||||
from app.core.database import get_db
|
||||
from app.models.attachment import AttachmentCategory
|
||||
from app.schemas.attachment import (
|
||||
AttachmentBoxSaveRequest,
|
||||
AttachmentBoxSaveResponse,
|
||||
AttachmentConfigRequest,
|
||||
AttachmentLocationRequest,
|
||||
AttachmentLocationResponse,
|
||||
@@ -15,6 +17,7 @@ from app.services.attachment_service import (
|
||||
configure_attachment,
|
||||
get_attachment_status,
|
||||
register_attachment_location,
|
||||
save_attachment_box,
|
||||
)
|
||||
|
||||
router = APIRouter(tags=["attachment"])
|
||||
@@ -64,3 +67,18 @@ def post_attachment_location(
|
||||
created_at=record.created_at.isoformat(),
|
||||
previous_location=getattr(record, "previous_location", None),
|
||||
)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/attachment/box",
|
||||
response_model=AttachmentBoxSaveResponse,
|
||||
responses={
|
||||
400: {"description": "参数非法或超量", "model": ErrorResponse},
|
||||
404: {"description": "总排号/类型不存在", "model": ErrorResponse},
|
||||
409: {"description": "同箱同类型重复", "model": ErrorResponse},
|
||||
},
|
||||
)
|
||||
def post_attachment_box(
|
||||
req: AttachmentBoxSaveRequest, db: Session = Depends(get_db)
|
||||
):
|
||||
return save_attachment_box(db, req)
|
||||
|
||||
Reference in New Issue
Block a user