-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from TravelMate-KU/feat/requests
feat: Volunteer 매칭 요청 조회 API 구현
- Loading branch information
Showing
8 changed files
with
1,021 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
13 changes: 13 additions & 0 deletions
13
src/main/java/konkuk/travelmate/form/response/RequestsResponse.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,13 @@ | ||
package konkuk.travelmate.form.response; | ||
|
||
import konkuk.travelmate.domain.TravelType; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.sql.Timestamp; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public record RequestsResponse(String disabledName, TravelType requestsType, String courseName, Timestamp startTime, Timestamp endTime) { | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/konkuk/travelmate/repository/RequestRepository.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,7 +1,35 @@ | ||
package konkuk.travelmate.repository; | ||
|
||
import konkuk.travelmate.domain.Request; | ||
import konkuk.travelmate.form.response.RequestsResponse; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import java.util.List; | ||
|
||
public interface RequestRepository extends JpaRepository<Request, Long> { | ||
|
||
@Query("SELECT new konkuk.travelmate.form.response.RequestsResponse(d.name, r.type, c.name, r.startTime, r.endTime)" + | ||
"FROM Request r " + | ||
"join r.course c " + | ||
"join c.health h " + | ||
"join r.disabled d " + | ||
"WHERE r.state = 4 " + | ||
"and h.bipolarDisorder >= :bipolarDisorder " + | ||
"and h.depression >= :depression " + | ||
"and h.iq >= :iq " + | ||
"and h.listen >= :listen " + | ||
"and h.see >= :see " + | ||
"and h.talk >= :talk " + | ||
"and h.walk >= :walk ") | ||
List<RequestsResponse> findRequestsByStateAndHealthLevel( | ||
@Param("bipolarDisorder") int bipolarDisorder, | ||
@Param("depression") int depression, | ||
@Param("iq") int iq, | ||
@Param("listen") int listen, | ||
@Param("see") int see, | ||
@Param("talk") int talk, | ||
@Param("walk") int walk); | ||
|
||
} |
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
Oops, something went wrong.