-
Notifications
You must be signed in to change notification settings - Fork 0
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 #13 from Mojacknong/feature_11/240408회의-api-개발-및-엔…
…티티-수정 Feature 11/240408회의 api 개발 및 엔티티 수정
- Loading branch information
Showing
24 changed files
with
603 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## #️⃣연관된 이슈 | ||
|
||
> ex) #이슈번호, #이슈번호 | ||
## 📝작업 내용 | ||
|
||
> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능) | ||
### 스크린샷 (선택) | ||
|
||
## 💬리뷰 요구사항(선택) | ||
|
||
> 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요 | ||
> | ||
> ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요? |
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
4 changes: 0 additions & 4 deletions
4
src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/TestDto.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...om/modernfarmer/farmusspring/domain/myveggiegarden/dto/request/DeleteMyVeggieRequest.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,16 @@ | ||
package com.modernfarmer.farmusspring.domain.myveggiegarden.dto.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class DeleteMyVeggieRequest { | ||
|
||
@NotNull(message = "null 값을 가지면 안됩니다.") | ||
private Long myVeggieId; | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
.../java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/request/MyVeggieUpdate.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,28 @@ | ||
package com.modernfarmer.farmusspring.domain.myveggiegarden.dto.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.format.annotation.DateTimeFormat; | ||
|
||
import java.time.LocalDate; | ||
import java.util.Date; | ||
|
||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class MyVeggieUpdate { | ||
|
||
@NotNull(message = "null 값을 가지면 안됩니다.") | ||
private Long myVeggieId; | ||
|
||
|
||
@NotNull(message = "null 값을 가지면 안됩니다.") | ||
private String nickname; | ||
|
||
@NotNull(message = "null 값을 가지면 안됩니다.") | ||
private Date birth; | ||
|
||
} |
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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/AllDairy.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,37 @@ | ||
package com.modernfarmer.farmusspring.domain.myveggiegarden.dto.response; | ||
|
||
import com.modernfarmer.farmusspring.domain.myveggiegarden.entity.Diary; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import java.util.List; | ||
|
||
import static com.modernfarmer.farmusspring.domain.myveggiegarden.util.DateManager.formatDate; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
public class AllDairy { | ||
|
||
private String date; | ||
private String image; | ||
private String content; | ||
private Boolean isOpen; | ||
|
||
public static AllDairy of(Diary diary, String date){ | ||
return new AllDairy( | ||
date, | ||
diary.getImage(), | ||
diary.getContent(), | ||
diary.getIsOpen() | ||
); | ||
} | ||
|
||
public static List<AllDairy> processData(List<Diary> diaryList){ | ||
return diaryList.stream() | ||
.map(diary -> AllDairy.of(diary, formatDate(diary.getCreatedDate()))) | ||
.toList(); | ||
} | ||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...va/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyDetailMyVeggie.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,21 @@ | ||
package com.modernfarmer.farmusspring.domain.myveggiegarden.dto.response; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor(staticName = "of") | ||
@Getter | ||
public class MyDetailMyVeggie { | ||
|
||
String nickname; | ||
String image; | ||
String veggieName; | ||
String birthDay; | ||
int period; | ||
Long myVeggieId; | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/MyDetailMyVeggieDto.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,37 @@ | ||
package com.modernfarmer.farmusspring.domain.myveggiegarden.dto.response; | ||
|
||
import com.modernfarmer.farmusspring.domain.myveggiegarden.entity.MyVeggie; | ||
import com.modernfarmer.farmusspring.domain.myveggiegarden.util.DateManager; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
|
||
@AllArgsConstructor | ||
@Getter | ||
@Component | ||
public class MyDetailMyVeggieDto { | ||
|
||
|
||
private final DateManager dateManager; | ||
|
||
public List<MyDetailMyVeggie> processData(List<MyVeggie> myVeggieList){ | ||
|
||
return myVeggieList.stream() | ||
.map(myVeggie -> MyDetailMyVeggie.of( | ||
myVeggie.getNickname(), | ||
myVeggie.getVeggieImage(), | ||
myVeggie.getVeggieName(), | ||
dateManager.parsingDotDate(myVeggie.getBirth()), | ||
dateManager.calculateDay(myVeggie.getBirth(), new Date()), | ||
myVeggie.getId() | ||
|
||
)).toList(); | ||
} | ||
|
||
} |
Oops, something went wrong.