Skip to content

Commit

Permalink
refactor: 불필요한 코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyj0 committed Aug 14, 2024
1 parent e453787 commit b5f46ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,6 @@ public static class PlaceCandidates {
}
}

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public static class PlaceVoteStatusResponse {
private Boolean existence;
@JsonInclude(JsonInclude.Include.NON_NULL)
private List<PlaceCandidates> allPlaceCandidates;
@JsonInclude(JsonInclude.Include.NON_NULL)
private List<PlaceCandidates> userVotedCandidates;

public static PlaceVoteStatusResponse from(Boolean existence, List<PlaceCandidates> allPlaceCandidates, List<PlaceCandidates> userVotedCandidates) {
return new PlaceVoteStatusResponse(existence, allPlaceCandidates, userVotedCandidates);
}

@Getter
@AllArgsConstructor(access = AccessLevel.PUBLIC)
public static class PlaceCandidates {
private Long id;
private String name;
private String siDo;
private String siGunGu;
private String roadNameAddress;
private Double addressLat;
private Double addressLong;
}
}

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public static class PlaceVoteRoomCreateResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
package middle_point_search.backend.domains.placeVoteRoom.repository;

import middle_point_search.backend.domains.placeVoteRoom.domain.PlaceVoteCandidate;
import middle_point_search.backend.domains.placeVoteRoom.domain.PlaceVoteCandidateMember;
import middle_point_search.backend.domains.placeVoteRoom.domain.PlaceVoteRoom;
import middle_point_search.backend.domains.member.domain.Member;
import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;
import middle_point_search.backend.domains.member.domain.Member;
import middle_point_search.backend.domains.placeVoteRoom.domain.PlaceVoteCandidateMember;
import middle_point_search.backend.domains.placeVoteRoom.domain.PlaceVoteRoom;

public interface PlaceVoteCandidateMemberRepository extends JpaRepository<PlaceVoteCandidateMember, Long> {
boolean existsByPlaceVoteCandidate_PlaceVoteRoomAndMember(PlaceVoteRoom placeVoteRoom, Member member);
boolean existsByPlaceVoteCandidateAndMember(PlaceVoteCandidate candidate, Member member);
List<PlaceVoteCandidateMember> findAllByPlaceVoteCandidate_PlaceVoteRoomAndMember(PlaceVoteRoom placeVoteRoom,
Member member);

Optional<PlaceVoteCandidateMember> findByPlaceVoteCandidate_PlaceVoteRoomAndMember(PlaceVoteRoom placeVoteRoom,
Member member);
}

0 comments on commit b5f46ea

Please sign in to comment.