-
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 #29 from TravelMate-KU/test
refactor: DTO 추가, DTO <-> Entity 변환 디자인 패턴 변경
- Loading branch information
Showing
21 changed files
with
225 additions
and
170 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
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
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
9 changes: 9 additions & 0 deletions
9
src/main/java/konkuk/travelmate/dto/request/GetRequestsRequest.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,9 @@ | ||
package konkuk.travelmate.dto.request; | ||
|
||
|
||
public record GetRequestsRequest(Integer walk, Integer see, Integer talk, Integer listen, Integer iq, Integer depression, Integer bipolarDisorder) { | ||
|
||
public boolean isNotNull() { | ||
return walk != null && see != null && talk != null && listen != null && iq != null && depression != null && bipolarDisorder != null; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/konkuk/travelmate/dto/request/PostRequestRequest.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,26 @@ | ||
package konkuk.travelmate.dto.request; | ||
|
||
import konkuk.travelmate.domain.*; | ||
|
||
import java.sql.Timestamp; | ||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.time.LocalTime; | ||
|
||
import static konkuk.travelmate.domain.RequestState.*; | ||
|
||
public record PostRequestRequest(TravelType type, LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime) { | ||
|
||
public Request toEntity(User disabled, Course course) { | ||
return Request.builder() | ||
.type(type()) | ||
.state(PENDING) | ||
.startTime(Timestamp.valueOf(LocalDateTime.of(startDate, startTime))) | ||
.endTime(Timestamp.valueOf(LocalDateTime.of(endDate, endTime))) | ||
.disabled(disabled) | ||
.course(course) | ||
.build(); | ||
} | ||
|
||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/konkuk/travelmate/dto/response/GetRequestsResponse.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,10 @@ | ||
package konkuk.travelmate.dto.response; | ||
|
||
import konkuk.travelmate.domain.TravelType; | ||
|
||
import java.sql.Timestamp; | ||
|
||
public record GetRequestsResponse(Long requestId, String disabledName, TravelType requestsType, String courseName, | ||
Timestamp startTime, Timestamp endTime) { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/konkuk/travelmate/dto/response/GetVolunteerMatchingResponse.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,10 @@ | ||
package konkuk.travelmate.dto.response; | ||
|
||
import konkuk.travelmate.domain.RequestState; | ||
import konkuk.travelmate.domain.TravelType; | ||
|
||
import java.sql.Timestamp; | ||
|
||
public record GetVolunteerMatchingResponse(String disabledName, Timestamp startTime, Timestamp endTime, TravelType type, | ||
RequestState state, String disabledPhoneName, String disabledEmail) { | ||
} |
19 changes: 0 additions & 19 deletions
19
src/main/java/konkuk/travelmate/form/request/RequestsRequest.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/konkuk/travelmate/form/response/RequestsResponse.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.