Skip to content
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] 게시물 통계 기능 구현 #20

Merged
merged 7 commits into from
Aug 26, 2024
Merged

[feat] 게시물 통계 기능 구현 #20

merged 7 commits into from
Aug 26, 2024

Conversation

pie2457
Copy link
Contributor

@pie2457 pie2457 commented Aug 25, 2024

Issue

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • 기능 추가
  • 기능 변경
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트

반영 브랜치

ex) feat/statistics -> refactor/modify_post_entity

변경 사항

  • QueryDSL을 사용하기 위한 dependency 및 Config 파일 추가
  • 게시물 통계 기능 구현
  • ErrorResponse 클래스 record 클래스로 변경

테스트 결과

Request

HTTP :  GET 
URL: /api/statistics

Response : 성공시

{
    "count": [게시글 개수 or 조회수, 공유수, 좋아요수 합]
}

Response : 실패시

400 BadRequestException

@pie2457 pie2457 added the feat label Aug 25, 2024
@pie2457 pie2457 self-assigned this Aug 25, 2024
@pie2457 pie2457 linked an issue Aug 25, 2024 that may be closed by this pull request
4 tasks
Copy link
Contributor

@jw427 jw427 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

* and m.account = 'user1';
*/
public Long statistics(StatParam param) {
var selectQuery = switch (param.value()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var 키워드를 사용해본적이 별로 없어서 왜 var를 사용하신건지 궁금합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 코드의 간결성과 타입을 굳이 몰라도 될 때 사용하고 있습니다! 여기서는 selectQuery가 JPAQuery 타입인데, 보는 사람입장에서는 오히려 JPAQuery 타입이 생소하게 느껴질 것 같아 가독성있게 var를 사용했습니당~

Copy link
Contributor

@rhaehf rhaehf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다.

Copy link
Contributor

@K-0joo K-0joo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다! 혹시 브렌치를 dev가 아닌 기능 브렌치에 넣는 이유가 있을까요?

Base automatically changed from refactor/modify_post_entity to dev August 26, 2024 03:00
Copy link
Contributor

@jeongeungyeong jeongeungyeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

@pie2457 pie2457 merged commit 3f66cc0 into dev Aug 26, 2024
@pie2457 pie2457 deleted the feat/statistics branch August 26, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

게시물 통계 기능 구현
6 participants