Skip to content

Commit

Permalink
Merge pull request #32 from UMC-HACKATHON-SnapSpot/feat/#24
Browse files Browse the repository at this point in the history
feat: dev 머지
  • Loading branch information
wonjun0120 authored Jul 4, 2024
2 parents 0c69d52 + caed91b commit 5e23986
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -43,22 +41,6 @@ public List<Spot> showSpotsByCategoryIds(List<Long> categoryIds) {
.collect(Collectors.toList());
spots.addAll(categorySpotsMapped);
}
// if (category != null) {
// List<CategorySpot> 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);
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/umc/hackaton/snapspot/spot/entity/Spot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5e23986

Please sign in to comment.