Skip to content

Commit

Permalink
Merge pull request #83 from SOPT-all/feat/82
Browse files Browse the repository at this point in the history
[FEAT] 게시물 조회 시 현재 사용자가 작성자인지 나타내는 식별자 추가
  • Loading branch information
dltnals317 authored Jan 23, 2025
2 parents 3c85fd6 + 9564bab commit ba63589
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public record PostResponseDTO(Long postId,
Double latitude,
Double longitude,
Long zzimCount,
Boolean isMine,
Boolean isZzim,
Boolean isScoop,
CategoryColorResponseDTO categoryColorResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public PostResponseDTO getPostById(Long postId, Long userId) {
LocalDateTime latestDate = postEntity.getUpdatedAt().isAfter(postEntity.getCreatedAt()) ? postEntity.getUpdatedAt() : postEntity.getCreatedAt();

Long zzimCount = zzimPostRepository.countByPost(postEntity);
Boolean isMine = postEntity.getUser().getUserId().equals(userId);
Boolean isZzim = zzimPostRepository.existsByUserAndPost(userEntity, postEntity);
Boolean isScoop = scoopPostRepository.existsByUserAndPost(userEntity, postEntity);
List<PhotoEntity> photoEntityList = photoRepository.findByPost(postEntity)
Expand Down Expand Up @@ -102,6 +103,7 @@ public PostResponseDTO getPostById(Long postId, Long userId) {
place.getLatitude(),
place.getLongitude(),
zzimCount,
isMine,
isZzim,
isScoop,
new CategoryColorResponseDTO(
Expand Down

0 comments on commit ba63589

Please sign in to comment.