Created
April 20, 2026 06:23
-
-
Save koorukuroo/17055413d8b784e8022477266451f41f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @app.get("/api/v1/requests", | |
| response_model=list[RequestResponse], | |
| tags=["점검 요청"]) | |
| def list_requests( | |
| status: Optional[str] = Query( | |
| None, | |
| description="상태 필터 (PENDING, ASSIGNED 등)" | |
| ), | |
| priority: Optional[str] = Query( | |
| None, | |
| description="우선순위 필터 (LOW, MEDIUM, HIGH, CRITICAL)" | |
| ), | |
| db: Session = Depends(get_db), | |
| ): | |
| query = db.query(InspectionRequest) | |
| # 선택적 필터링 | |
| if status: | |
| query = query.filter( | |
| InspectionRequest.status == status) | |
| if priority: | |
| query = query.filter( | |
| InspectionRequest.priority == priority) | |
| return query.order_by( | |
| InspectionRequest.created_at.desc() | |
| ).all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment