-
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.
fix: 블로그 방문자 수, 포스트 조회 수 통계 작업 오류 수정 (#138)
* [#136] feat: 블로그 방문자 수 통계 작업 시 시작 시간대와 끝 시간대를 설정할 수 있도록 변경 * [#136] feat: 포스트 조회수 통계 작업 시 시작 시간대와 끝 시간대를 설정할 수 있도록 변경 (cherry picked from commit 8b6ddb5)
- Loading branch information
1 parent
1530e8c
commit a170185
Showing
8 changed files
with
222 additions
and
21 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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/mallang/statistics/statistic/source/BlogVisitHistoryRepository.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,10 +1,20 @@ | ||
package com.mallang.statistics.statistic.source; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.UUID; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface BlogVisitHistoryRepository extends JpaRepository<BlogVisitHistory, Long> { | ||
|
||
Optional<BlogVisitHistory> findFirstByUuidAndBlogNameOrderByCreatedDateDesc(UUID uuid, String blogName); | ||
|
||
@Query("SELECT h FROM BlogVisitHistory h WHERE h.createdDate >= :startInclude AND h.createdDate < :endExclude") | ||
List<BlogVisitHistory> findWithCreatedDateBetweenIncludeStartAndExcludeEnd( | ||
@Param("startInclude") LocalDateTime startInclude, | ||
@Param("endExclude") LocalDateTime endExclude | ||
); | ||
} |
11 changes: 10 additions & 1 deletion
11
src/main/java/com/mallang/statistics/statistic/source/PostViewHistoryRepository.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,12 +1,21 @@ | ||
package com.mallang.statistics.statistic.source; | ||
|
||
import com.mallang.post.domain.PostId; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.UUID; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface PostViewHistoryRepository extends JpaRepository<PostViewHistory, Long> { | ||
|
||
|
||
Optional<PostViewHistory> findFirstByUuidAndPostIdOrderByCreatedDateDesc(UUID uuid, PostId postId); | ||
|
||
@Query("SELECT h FROM PostViewHistory h WHERE h.createdDate >= :startInclude AND h.createdDate < :endExclude") | ||
List<PostViewHistory> findWithCreatedDateBetweenIncludeStartAndExcludeEnd( | ||
@Param("startInclude") LocalDateTime startInclude, | ||
@Param("endExclude") LocalDateTime endExclude | ||
); | ||
} |
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
Oops, something went wrong.