feat(realestate-lab): 즐겨찾기 + 가격 표시 + 일정 없는 공고 필터링
- announcements 테이블에 is_bookmarked 컬럼 추가 (마이그레이션 포함)
- PATCH /announcements/{id}/bookmark 토글 API 추가
- 공고 목록에 모델 기반 가격 범위(min_price, max_price_display) 포함
- 대시보드에 즐겨찾기 목록 + 개별 이벤트 일정 형식 반환
- 지역 검색을 LIKE 부분 매칭으로 변경
- 수집 시 일정 정보 없는 공고 건너뛰기
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,8 @@ from apscheduler.schedulers.background import BackgroundScheduler
|
||||
|
||||
from .db import (
|
||||
init_db, get_announcements, get_announcement, create_announcement,
|
||||
update_announcement, delete_announcement, update_all_statuses,
|
||||
update_announcement, delete_announcement, toggle_bookmark,
|
||||
update_all_statuses,
|
||||
get_profile, upsert_profile, get_matches, mark_match_read,
|
||||
get_last_collect_log, get_dashboard,
|
||||
)
|
||||
@@ -74,11 +75,12 @@ def api_announcements(
|
||||
status: str = None,
|
||||
house_type: str = None,
|
||||
matched_only: bool = False,
|
||||
bookmarked: bool = False,
|
||||
sort: str = "date",
|
||||
page: int = Query(1, ge=1),
|
||||
size: int = Query(20, ge=1, le=100),
|
||||
):
|
||||
return get_announcements(region, status, house_type, matched_only, sort, page, size)
|
||||
return get_announcements(region, status, house_type, matched_only, bookmarked, sort, page, size)
|
||||
|
||||
|
||||
@app.get("/api/realestate/announcements/{ann_id}")
|
||||
@@ -102,6 +104,14 @@ def api_announcement_update(ann_id: int, body: AnnouncementUpdate):
|
||||
return updated
|
||||
|
||||
|
||||
@app.patch("/api/realestate/announcements/{ann_id}/bookmark")
|
||||
def api_announcement_bookmark(ann_id: int):
|
||||
result = toggle_bookmark(ann_id)
|
||||
if result is None:
|
||||
raise HTTPException(status_code=404, detail="Announcement not found")
|
||||
return result
|
||||
|
||||
|
||||
@app.delete("/api/realestate/announcements/{ann_id}")
|
||||
def api_announcement_delete(ann_id: int):
|
||||
if not delete_announcement(ann_id):
|
||||
|
||||
Reference in New Issue
Block a user