-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/byulbyul/byulbyulpoll/controller/dto/ProjectResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package byulbyul.byulbyulpoll.controller.dto; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class ProjectResponseDto { | ||
private Long id; | ||
private String title; | ||
private String description; | ||
private int voteCount; | ||
|
||
|
||
public ProjectResponseDto(Long id, String title, String description, int voteCount){ | ||
this.id = id; | ||
this.title = title; | ||
this.description = description; | ||
this.voteCount = voteCount; | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
src/main/java/byulbyul/byulbyulpoll/repository/ProjectRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package byulbyul.byulbyulpoll.repository; | ||
|
||
import byulbyul.byulbyulpoll.entity.Project; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface ProjectRepository extends JpaRepository<Project, Long> { | ||
|
||
List<Project> findByPollId(long pollId); | ||
List<Project> findByPollId(long pollId, Sort sort); | ||
|
||
Optional<Project> findByTitle(String title); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters