Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy to EC2 with Docker

on:
push:
branches: [main]
branches: [main, feat/#29-카페삭제관리자페이지]

jobs:
deploy:
Expand Down
33 changes: 31 additions & 2 deletions src/main/java/com/Minjin/TagCafe/controller/CafeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,38 @@ public ResponseEntity<String> deleteCafe(@PathVariable("cafeId") Long cafeId) {

@Operation(summary = "admin - 삭제 가능한 카페 목록 조회", description = "삭제할 수 있는 카페들의 전체 목록을 반환합니다.")
@GetMapping("/admin/delete-cafe")
public ResponseEntity<List<Cafe>> getCafesForDeletion() {
public ResponseEntity<List<CafeDto>> getCafesForDeletion() {
List<Cafe> cafes = cafeRepository.findAll();
return ResponseEntity.ok(cafes);

List<CafeDto> dtos = cafes.stream().map(cafe -> {
List<String> imageUrls = cafe.getImages().stream()
.map(CafeImage::getImageUrl)
.toList();


return new CafeDto(
cafe.getCafeId(),
cafe.getKakaoPlaceId(),
cafe.getCafeName(),
cafe.getLatitude(),
cafe.getLongitude(),
cafe.getAddress(),
cafe.getPhoneNumber(),
cafe.getWebsiteUrl(),
cafe.getUpdateAt(),
cafe.getAverageRating(),
cafe.getOpeningHours(),
cafe.getWifi(),
cafe.getOutlets(),
cafe.getDesk(),
cafe.getRestroom(),
cafe.getParking(),
null,
imageUrls
);
}).toList();

return ResponseEntity.ok(dtos);
}

// 모든 카페 조회 API 추가
Expand Down