diff --git a/backend/app/api/hero_banners.py b/backend/app/api/hero_banners.py index d2d4e91..a28fc52 100644 --- a/backend/app/api/hero_banners.py +++ b/backend/app/api/hero_banners.py @@ -124,6 +124,25 @@ def admin_get_banners( return banners +@router.get("/admin/banner-cars") +def get_banner_cars( + db: Session = Depends(get_db), + current_user: User = Depends(get_admin_user) +): + """배너 등록된 차량 목록 조회 (Admin) + + display_order 순으로 정렬된 차량 ID 목록 반환 + """ + banners = db.query(HeroBanner).filter( + HeroBanner.car_id.isnot(None) + ).order_by(HeroBanner.display_order.asc()).all() + + return { + "car_ids": [b.car_id for b in banners], + "count": len(banners) + } + + @router.get("/admin/{banner_id}", response_model=HeroBannerResponse) def admin_get_banner( banner_id: int, @@ -341,22 +360,3 @@ def reorder_banners( db.commit() return {"message": "Banner order updated", "count": len(request.car_ids)} - - -@router.get("/admin/banner-cars") -def get_banner_cars( - db: Session = Depends(get_db), - current_user: User = Depends(get_admin_user) -): - """배너 등록된 차량 목록 조회 (Admin) - - display_order 순으로 정렬된 차량 ID 목록 반환 - """ - banners = db.query(HeroBanner).filter( - HeroBanner.car_id.isnot(None) - ).order_by(HeroBanner.display_order.asc()).all() - - return { - "car_ids": [b.car_id for b in banners], - "count": len(banners) - }