feat(server): add PUT /attachment/config with removal guard
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,15 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.core.database import get_db
|
||||
from app.models.attachment import AttachmentCategory
|
||||
from app.schemas.attachment import AttachmentStatusResponse, CategoryResponse
|
||||
from app.services.attachment_service import get_attachment_status
|
||||
from app.schemas.attachment import (
|
||||
AttachmentConfigRequest,
|
||||
AttachmentStatusResponse,
|
||||
CategoryResponse,
|
||||
)
|
||||
from app.services.attachment_service import (
|
||||
configure_attachment,
|
||||
get_attachment_status,
|
||||
)
|
||||
|
||||
router = APIRouter(tags=["attachment"])
|
||||
|
||||
@@ -26,3 +33,8 @@ def list_categories(db: Session = Depends(get_db)):
|
||||
@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)
|
||||
|
||||
|
||||
@router.put("/attachment/config", response_model=AttachmentStatusResponse)
|
||||
def put_attachment_config(req: AttachmentConfigRequest, db: Session = Depends(get_db)):
|
||||
return configure_attachment(db, req)
|
||||
|
||||
Reference in New Issue
Block a user