-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/recruit-search
- Loading branch information
Showing
16 changed files
with
527 additions
and
446 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ out/ | |
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
### VS Code ###* | ||
.vscode/ | ||
.DS_Store | ||
|
||
|
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
93 changes: 46 additions & 47 deletions
93
...er/introduce/dto/IntroduceListResDto.java → ...oller/response/IntroduceListResponse.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,47 +1,46 @@ | ||
package umc.kkijuk.server.introduce.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import umc.kkijuk.server.introduce.domain.Introduce; | ||
import umc.kkijuk.server.member.domain.Member; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.Duration; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
@Getter | ||
@Setter | ||
public class IntroduceListResDto { | ||
private Long id; | ||
private Long memberId; | ||
private Long recruitId; | ||
private String recruitTitle; | ||
private String deadline; | ||
private String updatedAt; | ||
private String timeSinceUpdate; | ||
private int state; | ||
|
||
@Builder | ||
public IntroduceListResDto(Introduce introduce) { | ||
this.id = introduce.getId(); | ||
this.memberId = introduce.getMemberId(); | ||
this.recruitId=introduce.getRecruit().toModel().getId(); | ||
this.recruitTitle=introduce.getRecruit().toModel().getTitle(); | ||
this.deadline=formatUpdatedAt(introduce.getRecruit().toModel().getEndTime()); | ||
this.updatedAt = formatUpdatedAt(introduce.getUpdatedAt()); | ||
this.timeSinceUpdate = calculateTimeUntilDeadline(introduce.getUpdatedAt(), introduce.getRecruit().toModel().getEndTime()); | ||
this.state=introduce.getState(); | ||
} | ||
|
||
private String formatUpdatedAt(LocalDateTime updatedAt) { | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
return updatedAt != null ? updatedAt.format(formatter) : null; | ||
} | ||
|
||
private String calculateTimeUntilDeadline(LocalDateTime updatedAt, LocalDateTime deadline) { | ||
Duration duration = Duration.between(updatedAt, deadline); | ||
long days = duration.toDays() + 1; | ||
return "D-" + days; | ||
} | ||
} | ||
package umc.kkijuk.server.introduce.controller.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import umc.kkijuk.server.introduce.domain.Introduce; | ||
|
||
import java.time.Duration; | ||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
@Getter | ||
@Setter | ||
public class IntroduceListResponse { | ||
private Long id; | ||
private Long memberId; | ||
private Long recruitId; | ||
private String recruitTitle; | ||
private String deadline; | ||
private String updatedAt; | ||
private String timeSinceUpdate; | ||
private int state; | ||
|
||
@Builder | ||
public IntroduceListResponse(Introduce introduce) { | ||
this.id = introduce.getId(); | ||
this.memberId = introduce.getMemberId(); | ||
this.recruitId=introduce.getRecruit().toModel().getId(); | ||
this.recruitTitle=introduce.getRecruit().toModel().getTitle(); | ||
this.deadline=formatUpdatedAt(introduce.getRecruit().toModel().getEndTime()); | ||
this.updatedAt = formatUpdatedAt(introduce.getUpdatedAt()); | ||
this.timeSinceUpdate = calculateTimeUntilDeadline(introduce.getUpdatedAt(), introduce.getRecruit().toModel().getEndTime()); | ||
this.state=introduce.getState(); | ||
} | ||
|
||
private String formatUpdatedAt(LocalDateTime updatedAt) { | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
return updatedAt != null ? updatedAt.format(formatter) : null; | ||
} | ||
|
||
private String calculateTimeUntilDeadline(LocalDateTime updatedAt, LocalDateTime deadline) { | ||
Duration duration = Duration.between(updatedAt, deadline); | ||
long days = duration.toDays() + 1; | ||
return "D-" + days; | ||
} | ||
} |
114 changes: 56 additions & 58 deletions
114
...server/introduce/dto/IntroduceResDto.java → ...ontroller/response/IntroduceResponse.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,58 +1,56 @@ | ||
package umc.kkijuk.server.introduce.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import umc.kkijuk.server.introduce.domain.Introduce; | ||
import umc.kkijuk.server.member.domain.Member; | ||
|
||
import java.time.Duration; | ||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@Setter | ||
public class IntroduceResDto { | ||
private Long id; | ||
private Long recruitId; | ||
private Long memberId; | ||
private String recruitTitle; | ||
private List<QuestionDto> questionList; | ||
private String deadline; | ||
private List<String> tags; | ||
private String link; | ||
private String updatedAt; | ||
private String timeSinceUpdate; | ||
/* private List<String> introduceList;*/ | ||
private int state; | ||
|
||
@Builder | ||
public IntroduceResDto(Introduce introduce, List<QuestionDto> questionList/*, List<String> introduceList*/) { | ||
this.id = introduce.getId(); | ||
this.recruitId=introduce.getRecruit().toModel().getId(); | ||
this.memberId=introduce.getMemberId(); | ||
this.recruitTitle=introduce.getRecruit().toModel().getTitle(); | ||
this.questionList = questionList; | ||
this.deadline=formatUpdatedAt(introduce.getRecruit().toModel().getEndTime()); | ||
this.tags=introduce.getRecruit().toModel().getTags(); | ||
this.link=introduce.getRecruit().toModel().getLink(); | ||
this.updatedAt = formatUpdatedAt(introduce.getUpdatedAt()); | ||
this.timeSinceUpdate = calculateTimeUntilDeadline(introduce.getUpdatedAt(), introduce.getRecruit().toModel().getEndTime()); | ||
/*this.introduceList = introduceList;*/ | ||
this.state=introduce.getState(); | ||
} | ||
|
||
private String formatUpdatedAt(LocalDateTime updatedAt) { | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
return updatedAt != null ? updatedAt.format(formatter) : null; | ||
} | ||
|
||
private String calculateTimeUntilDeadline(LocalDateTime updatedAt, LocalDateTime deadline) { | ||
Duration duration = Duration.between(updatedAt, deadline); | ||
long days = duration.toDays() + 1; | ||
return "D-" + days; | ||
} | ||
|
||
} | ||
package umc.kkijuk.server.introduce.controller.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import umc.kkijuk.server.introduce.domain.Introduce; | ||
import umc.kkijuk.server.introduce.dto.QuestionDto; | ||
|
||
import java.time.Duration; | ||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
public class IntroduceResponse { | ||
private Long id; | ||
private Long recruitId; | ||
private Long memberId; | ||
private String recruitTitle; | ||
private List<QuestionDto> questionList; | ||
private String deadline; | ||
private List<String> tags; | ||
private String link; | ||
private String updatedAt; | ||
private String timeSinceUpdate; | ||
/* private List<String> introduceList;*/ | ||
private int state; | ||
|
||
@Builder | ||
public IntroduceResponse(Introduce introduce, List<QuestionDto> questionList/*, List<String> introduceList*/) { | ||
this.id = introduce.getId(); | ||
this.recruitId=introduce.getRecruit().toModel().getId(); | ||
this.memberId=introduce.getMemberId(); | ||
this.recruitTitle=introduce.getRecruit().toModel().getTitle(); | ||
this.questionList = questionList; | ||
this.deadline=formatUpdatedAt(introduce.getRecruit().toModel().getEndTime()); | ||
this.tags=introduce.getRecruit().toModel().getTags(); | ||
this.link=introduce.getRecruit().toModel().getLink(); | ||
this.updatedAt = formatUpdatedAt(introduce.getUpdatedAt()); | ||
this.timeSinceUpdate = calculateTimeUntilDeadline(introduce.getUpdatedAt(), introduce.getRecruit().toModel().getEndTime()); | ||
/*this.introduceList = introduceList;*/ | ||
this.state=introduce.getState(); | ||
} | ||
|
||
private String formatUpdatedAt(LocalDateTime updatedAt) { | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
return updatedAt != null ? updatedAt.format(formatter) : null; | ||
} | ||
|
||
private String calculateTimeUntilDeadline(LocalDateTime updatedAt, LocalDateTime deadline) { | ||
Duration duration = Duration.between(updatedAt, deadline); | ||
long days = duration.toDays() + 1; | ||
return "D-" + days; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/umc/kkijuk/server/introduce/controller/response/MasterIntroduceResponse.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,38 @@ | ||
package umc.kkijuk.server.introduce.controller.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import umc.kkijuk.server.introduce.domain.Introduce; | ||
import umc.kkijuk.server.introduce.domain.MasterIntroduce; | ||
import umc.kkijuk.server.introduce.dto.QuestionDto; | ||
|
||
import java.time.Duration; | ||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
public class MasterIntroduceResponse { | ||
private Long id; | ||
private Long memberId; | ||
private List<QuestionDto> questionList; | ||
private String updatedAt; | ||
private int state; | ||
|
||
@Builder | ||
public MasterIntroduceResponse(MasterIntroduce masterIntroduce, List<QuestionDto> questionList) { | ||
this.id = masterIntroduce.getId(); | ||
this.memberId=masterIntroduce.getMemberId(); | ||
this.questionList = questionList; | ||
this.updatedAt = formatUpdatedAt(masterIntroduce.getUpdatedAt()); | ||
this.state=masterIntroduce.getState(); | ||
} | ||
|
||
private String formatUpdatedAt(LocalDateTime updatedAt) { | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
return updatedAt != null ? updatedAt.format(formatter) : null; | ||
} | ||
|
||
} |
Oops, something went wrong.