Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #180 from Strong-Potato/#179-Change-vote-api-spec
Browse files Browse the repository at this point in the history
[Feat] 투표 Api Response Spec 수정
  • Loading branch information
Nine-JH authored Jan 24, 2024
2 parents 15bbef0 + 5abc631 commit f36ae28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

public interface VoteRepository extends JpaRepository<Vote, Long>, VoteRepositoryCustom {

@Query(value = "select v from Vote v where v.space.id in (select jm.space.id from JoinedMember jm where jm.member.id = :memberId) and v.space.id not in (" +
"select vrm.spaceId from VoteResultMember vrm where vrm.memberId = :memberId)", nativeQuery = true)
@Query("select v from Vote v where v.space.id in (select jm.space.id from JoinedMember jm where jm.member.id = :memberId) and v.space.id not in (select vrm.spaceId from VoteResultMember vrm where vrm.memberId = :memberId)")
List<Vote> findMemberVotes(Long memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public record VoteResultResponse(
Long id,
String title,
VoteStatus voteStatus,
MemberProfile ownerProfile,
MemberProfile createdBy,
List<CandidateResultResponse> candidatesResponses
) {

public record CandidateResultResponse(
Long id,
PlaceInfo placeInfo,
MemberProfile ownerProfile,
MemberProfile createdBy,
List<MemberProfile> votedMemberProfiles,
String tagline,
boolean amIVote,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ public record PlaceInfo(
Integer placeId,
String placeName,
String category,
int areaCode,
String placeImageUrl,
LatLng latLng
) {

public static PlaceInfo of(Place place) {
return new PlaceInfo(
place.getId(),
place.getThumbnail(),
place.getTitle(),
place.getCategory(),
place.getLocation().getAreaCode(),
place.getThumbnail(),
new LatLng(
place.getLocation().getLatitude(),
Expand Down

0 comments on commit f36ae28

Please sign in to comment.