-
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.
- Loading branch information
Showing
8 changed files
with
124 additions
and
10 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
9 changes: 9 additions & 0 deletions
9
src/main/java/aromanticcat/umcproject/repository/SlowLetterRepository.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,8 +1,17 @@ | ||
package aromanticcat.umcproject.repository; | ||
|
||
import aromanticcat.umcproject.entity.Letter; | ||
import aromanticcat.umcproject.entity.Member; | ||
import aromanticcat.umcproject.entity.SlowLetter; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface SlowLetterRepository extends JpaRepository<SlowLetter, Long> { | ||
Optional<List<SlowLetter>> findSlowLettersByMember(Member member); | ||
Optional<SlowLetter> findBySlowLetterId(Long slowLetterId); | ||
|
||
Optional<List<SlowLetter>> findSlowLettersByDateBetweenAndMemberId(LocalDate startDate, LocalDate endDate, Long memberId); | ||
} |
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
15 changes: 15 additions & 0 deletions
15
src/main/java/aromanticcat/umcproject/web/dto/slowLetter/SlowLetterCalResponse.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,15 @@ | ||
package aromanticcat.umcproject.web.dto.slowLetter; | ||
|
||
import aromanticcat.umcproject.entity.SlowLetter; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record SlowLetterCalResponse( | ||
String date | ||
) { | ||
public static SlowLetterCalResponse from(SlowLetter slowLetter) { | ||
return SlowLetterCalResponse.builder() | ||
.date(slowLetter.getDate().toString()) | ||
.build(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/aromanticcat/umcproject/web/dto/slowLetter/SlowLetterGetResponse.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,19 @@ | ||
package aromanticcat.umcproject.web.dto.slowLetter; | ||
|
||
import aromanticcat.umcproject.entity.SlowLetter; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record SlowLetterGetResponse( | ||
Long slowLetterId, | ||
String date, | ||
String content | ||
) { | ||
public static SlowLetterGetResponse from(SlowLetter slowLetter) { | ||
return SlowLetterGetResponse.builder() | ||
.slowLetterId(slowLetter.getSlowLetterId()) | ||
.date(slowLetter.getDate().toString()) | ||
.content(slowLetter.getContent()) | ||
.build(); | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
...umcproject/web/dto/SlowLetterRequest.java → ...web/dto/slowLetter/SlowLetterRequest.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
2 changes: 1 addition & 1 deletion
2
...mcproject/web/dto/SlowLetterResponse.java → ...eb/dto/slowLetter/SlowLetterResponse.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