Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ› ์‹ ์ฒญ ๋ชฉ๋ก ๋ฐ˜ํ™˜ ์‹œ ์‹ ์ฒญ ๊ธฐ๋ณธํ‚ค ๋ฐ˜ํ™˜ #35

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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