From 0d5e8cd214090d704fd209016e2dfc8990f7eddf Mon Sep 17 00:00:00 2001 From: wonjun0120 Date: Fri, 5 Jul 2024 03:36:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20dev=20=EB=A8=B8=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #24 --- .../java/com/umc/hackaton/snapspot/spot/entity/Spot.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/umc/hackaton/snapspot/spot/entity/Spot.java b/src/main/java/com/umc/hackaton/snapspot/spot/entity/Spot.java index a29379c..252c1e0 100644 --- a/src/main/java/com/umc/hackaton/snapspot/spot/entity/Spot.java +++ b/src/main/java/com/umc/hackaton/snapspot/spot/entity/Spot.java @@ -48,6 +48,14 @@ public class Spot extends BaseEntity { @Column(name = "description", nullable = false, columnDefinition = "TEXT") private String description; + public void increaseLike() { + this.likeNum -= 1; + } + + public void decreaseLike() { + this.likeNum += 1; + } + @Override public boolean equals(Object o) { if (this == o) return true; From caed91b8456ff5eb2c98a2d35859d51e9f0ceb2d Mon Sep 17 00:00:00 2001 From: wonjun0120 Date: Fri, 5 Jul 2024 03:50:26 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #24 --- .../category/service/CategoryService.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/main/java/com/umc/hackaton/snapspot/category/service/CategoryService.java b/src/main/java/com/umc/hackaton/snapspot/category/service/CategoryService.java index 442a735..ba4b8ec 100644 --- a/src/main/java/com/umc/hackaton/snapspot/category/service/CategoryService.java +++ b/src/main/java/com/umc/hackaton/snapspot/category/service/CategoryService.java @@ -5,9 +5,7 @@ import com.umc.hackaton.snapspot.category.entity.CategorySpot; import com.umc.hackaton.snapspot.category.repository.CategoryRepository; import com.umc.hackaton.snapspot.category.repository.CategorySpotRepository; -import com.umc.hackaton.snapspot.spot.dto.SpotDto; import com.umc.hackaton.snapspot.spot.entity.Spot; -import com.umc.hackaton.snapspot.user.entity.User; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -43,22 +41,6 @@ public List showSpotsByCategoryIds(List categoryIds) { .collect(Collectors.toList()); spots.addAll(categorySpotsMapped); } -// if (category != null) { -// List categorySpots = categorySpotRepository.findAllByCategory(category); -// for (CategorySpot categorySpot : categorySpots) { -// SpotDto spotDto = new SpotDto(); -// User user = categorySpot.getSpot().getUser(); -// spotDto.setUser(user); -// spotDto.setLatitude(categorySpot.getSpot().getLatitude()); -// spotDto.setLongitude(categorySpot.getSpot().getLongitude()); -// spotDto.setTitle(categorySpot.getSpot().getTitle()); -// spotDto.setDescription(categorySpot.getSpot().getDescription()); -// spotDto.setImgUrl(categorySpot.getSpot().getImgUrl()); -// -// Spot spot = spotDto.toEntity(); -// spots.add(spot); -// } -// } } return new ArrayList<>(spots); }