-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat/#221] 아티클 조회수 저장 방식 및 조회 방식 개선 #223
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1c16093
feat: ARTICLE_VIEW_COUNT 테이블 생성, 아티클 조회수 순 정렬 등에 사용 예정
hun-ca d8acd58
fix: ARTICLE_VIEW_COUNT 테이블 deleted_at 추가
hun-ca 6fca14c
feat: 아티클 조회시 article view his가 아닌 article view count를 보도록 수정(SL수정: c…
hun-ca 5e41a3d
test: ReadArticleUseCaseTest 수정 반영
hun-ca 13306e6
feat: ArticleViewCountHandler 추가
hun-ca 3f6a688
fix: view_count 컬럼 기준 내림차순 정렬 인덱스로 변경
hun-ca b5f58ce
feat: category_cd 컬럼 추가 in ARTICLE_VIEW_COUNT 테이블 and 인덱싱
hun-ca a1eb90a
test: category_cd 컬럼 추가 테스트 반영
hun-ca dc4a03a
Merge remote-tracking branch 'origin/main' into feat/#221_hunca
hun-ca 0ff043e
Merge branch 'main' into feat/#221_hunca
belljun3395 bc4d0ac
Merge remote-tracking branch 'origin/feat/#221_hunca' into feat/#221_…
hun-ca 680cf75
refactor: article category 유효하지 않을 경우에 대한 검증 추가
hun-ca c519e60
feat: article.invalid.category 에러코드 추가
hun-ca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ class ReadArticleUseCase( | |
articleViewHisAsyncHandler.addArticleViewHis( | ||
useCaseIn.articleId, | ||
useCaseIn.memberId, | ||
CategoryType.fromCode(articleRecord.category) | ||
CategoryType.fromCode(articleRecord.category) ?: throw RuntimeException("invalid article") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 모든 아티클은 카테고리가 필수인데, 카테고리에 정의되지 않은 경우가 발생하는거 자체가 말이 일단 안되는 상황이라.. 예외코드를 정의하고 던지는게 맞을까 싶어요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 그렇긴 한데 말이 안되는 상황도 대비하는 것은 나쁘지 않은 것 같아요 |
||
) | ||
|
||
return ReadArticleUseCaseOut( | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거는 뭔가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
article_view_count 테이블 로우는 아티클 당 한개로 구성되는데, 첫번째로 조회될 땐 insert가 가고, 이미 row가 있는 경우(이미 1번 이상 조회됨) Update(view_count + 1) 쿼리가 날라가는 upsert 쿼리입니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 신기하다..!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL 변환