-
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.
* Feat : 여행 일기 crud * Feat : 타이틀 이미지 필드 추가 * Feat : 개별 diary 조회, title 이미지 반환값에 추가 * Feat : 여행일기 조회 페이지네이션 * Style: 코드 포맷팅
- Loading branch information
Showing
34 changed files
with
338 additions
and
173 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
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
1 change: 0 additions & 1 deletion
1
src/main/java/solitour_backend/solitour/category/repository/CategoryRepository.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
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
49 changes: 49 additions & 0 deletions
49
src/main/java/solitour_backend/solitour/diary/dto/DiaryContent.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,49 @@ | ||
package solitour_backend.solitour.diary.dto; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import solitour_backend.solitour.diary.diary_day_content.DiaryDayContent; | ||
import solitour_backend.solitour.diary.entity.Diary; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
public class DiaryContent { | ||
private Long diaryId; | ||
private String title; | ||
private String titleImage; | ||
private LocalDateTime startDatetime; | ||
private LocalDateTime endDatetime; | ||
private DiaryDayContentResponse diaryDayContentResponses; | ||
|
||
public static DiaryContent from(Diary diary) { | ||
return DiaryContent.builder() | ||
.diaryId(diary.getId()) | ||
.title(diary.getTitle()) | ||
.titleImage(diary.getTitleImage()) | ||
.startDatetime(diary.getStartDatetime()) | ||
.endDatetime(diary.getEndDatetime()) | ||
.diaryDayContentResponses(new DiaryDayContentResponse(diary.getDiaryDayContent())) | ||
.build(); | ||
} | ||
|
||
@Getter | ||
public static class DiaryDayContentResponse { | ||
private final List<DiaryDayContentDetail> diaryDayContentDetail; | ||
|
||
public DiaryDayContentResponse(List<DiaryDayContent> diaryDayContent) { | ||
this.diaryDayContentDetail = diaryDayContent.stream() | ||
.map(diaryDayContentDetail -> | ||
new DiaryDayContentDetail( | ||
diaryDayContentDetail.getContent(), | ||
diaryDayContentDetail.getFeelingStatus().name(), | ||
diaryDayContentDetail.getPlace() | ||
) | ||
).collect(Collectors.toList()); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/solitour_backend/solitour/diary/dto/DiaryDayContentDetail.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,14 @@ | ||
package solitour_backend.solitour.diary.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
public class DiaryDayContentDetail { | ||
private String content; | ||
private String feelingStatus; | ||
private String place; | ||
} |
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/solitour_backend/solitour/diary/repository/DiaryDayContentRepository.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,11 +1,7 @@ | ||
package solitour_backend.solitour.diary.repository; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import solitour_backend.solitour.diary.diary_day_content.DiaryDayContent; | ||
import solitour_backend.solitour.diary.entity.Diary; | ||
import solitour_backend.solitour.user.entity.User; | ||
|
||
public interface DiaryDayContentRepository extends JpaRepository<DiaryDayContent, Long> { | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/solitour_backend/solitour/diary/repository/DiaryRepositoryCustom.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,11 @@ | ||
package solitour_backend.solitour.diary.repository; | ||
|
||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.repository.NoRepositoryBean; | ||
import solitour_backend.solitour.diary.dto.DiaryContent; | ||
|
||
@NoRepositoryBean | ||
public interface DiaryRepositoryCustom { | ||
Page<DiaryContent> getAllDiaryPageFilterAndOrder(Pageable pageable, Long userId); | ||
} |
Oops, something went wrong.