Skip to content

Commit

Permalink
๐Ÿ› ์‹ ์ฒญ ๋ชฉ๋ก ๋ฐ˜ํ™˜ ์‹œ ์‹ ์ฒญ ๊ธฐ๋ณธํ‚ค ๋ฐ˜ํ™˜ (#35) (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juye0nLee authored Nov 23, 2024
1 parent 5cac7b6 commit faeb705
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/ivory/ivory/dto/ApplyListDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
@AllArgsConstructor
@NoArgsConstructor
public class ApplyListDto {
private Long id;
private String name;
private String applyDate;
private String careDate;
private String careTime;
private String status;

public static ApplyListDto from(String name,String applyDate,String careDate,String careTime, String status) {
public static ApplyListDto from(Long id, String name,String applyDate,String careDate,String careTime, String status) {
return ApplyListDto.builder()
.id(id)
.name(name)
.applyDate(applyDate)
.careDate(careDate)
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/ivory/ivory/service/ApplyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public CustomApiResponse<?> getApplyList(Long childId, Long currentMemberId) {
//์‘๋‹ต dto ์ƒ์„ฑ
List<ApplyListDto> applyListDto = new ArrayList<>();
applyList.forEach(apply -> {
//์‹ ์ฒญ ๊ธฐ๋ณธํ‚ค
Long id = apply.getId();

//์ด๋ฆ„
String name = child.get().getName();

Expand All @@ -138,7 +141,7 @@ public CustomApiResponse<?> getApplyList(Long childId, Long currentMemberId) {
Status serviceStatus = getNowStatus(apply.getStartDate(),apply.getEndDate());
String status = getStatus(serviceStatus);

applyListDto.add(ApplyListDto.from(name,applyDate,careDate,careTime,status));
applyListDto.add(ApplyListDto.from(id,name,applyDate,careDate,careTime,status));
});
return CustomApiResponse.createSuccess(HttpStatus.OK.value(),"์‹ ์ฒญ ๋ชฉ๋ก ์กฐํšŒ์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.",applyListDto);
}
Expand Down

0 comments on commit faeb705

Please sign in to comment.