-
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.
- Loading branch information
Showing
15 changed files
with
132 additions
and
182 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
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
47 changes: 0 additions & 47 deletions
47
src/main/kotlin/com/example/onui/domain/timeline/entity/Timeline.kt
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/example/onui/domain/timeline/exception/InvalidDateFormatException.kt
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,6 @@ | ||
package com.example.onui.domain.timeline.exception | ||
|
||
import com.example.onui.global.config.error.data.ErrorCode | ||
import com.example.onui.global.config.error.exception.BusinessException | ||
|
||
object InvalidDateFormatException : BusinessException(ErrorCode.INVALID_DATE_FORMAT) |
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/kotlin/com/example/onui/domain/timeline/repository/QTimelineRepository.kt
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 com.example.onui.domain.timeline.repository | ||
|
||
import com.example.onui.domain.diary.presentation.response.DiaryDetailResponse | ||
import org.springframework.data.domain.Page | ||
import org.springframework.data.domain.Pageable | ||
import java.time.LocalDate | ||
|
||
interface QTimelineRepository { | ||
|
||
fun findPageByDate(pageable: Pageable, date: LocalDate): Page<DiaryDetailResponse> | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/com/example/onui/domain/timeline/repository/QTimelineRepositoryImpl.kt
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,32 @@ | ||
package com.example.onui.domain.timeline.repository | ||
|
||
import com.example.onui.domain.diary.entity.QDiary.diary | ||
import com.example.onui.domain.diary.presentation.response.DiaryDetailResponse | ||
import com.querydsl.jpa.impl.JPAQueryFactory | ||
import org.springframework.data.domain.Page | ||
import org.springframework.data.domain.PageImpl | ||
import org.springframework.data.domain.Pageable | ||
import org.springframework.stereotype.Service | ||
import java.time.LocalDate | ||
|
||
@Service | ||
class QTimelineRepositoryImpl( | ||
private val query: JPAQueryFactory | ||
) : QTimelineRepository { | ||
|
||
override fun findPageByDate(pageable: Pageable, date: LocalDate): Page<DiaryDetailResponse> { | ||
val query = query.selectFrom(diary).where( | ||
diary.isPosted.eq(true).and( | ||
diary.day.eq(date.dayOfMonth).and( | ||
diary.month.eq(date.monthValue).and( | ||
diary.year.eq(date.year) | ||
) | ||
) | ||
) | ||
).orderBy(diary.createdAt.desc()).offset(pageable.offset).limit(pageable.pageSize.toLong()) | ||
|
||
val iterable = query.fetch().map { it.toDetailResponse() } | ||
|
||
return PageImpl(iterable, pageable, iterable.size.toLong()) | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
src/main/kotlin/com/example/onui/domain/timeline/repository/TimelineRepository.kt
This file was deleted.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
src/main/kotlin/com/example/onui/domain/timeline/service/TimeLineService.kt
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,13 +1,13 @@ | ||
package com.example.onui.domain.timeline.service | ||
|
||
import com.example.onui.domain.timeline.presentation.dto.response.TimelineResponse | ||
import com.example.onui.domain.diary.presentation.response.DiaryDetailResponse | ||
import org.springframework.data.domain.Page | ||
import java.time.DayOfWeek | ||
import java.time.LocalDate | ||
import java.util.* | ||
|
||
interface TimeLineService { | ||
|
||
fun post(id: UUID): TimelineResponse | ||
fun post(id: UUID): DiaryDetailResponse | ||
|
||
fun searchByDayOfWeek(idx: Int, size: Int, dayOfWeek: DayOfWeek): Page<TimelineResponse> | ||
fun searchByDate(idx: Int, size: Int, date: LocalDate): Page<DiaryDetailResponse> | ||
} |
Oops, something went wrong.