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/#136 통계 관련 기능 구현 #144

Merged
merged 22 commits into from
Jun 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8906151
refactor: News Category directory 변경 (service -> entity)
yeonjy Jun 4, 2024
3f879b6
Merge branch 'Dev-backend' into feat/#136-category-statistics
yeonjy Jun 17, 2024
8eba20b
feat: QueryDsl 관련 설정
yeonjy Jun 17, 2024
34db6e9
feat: ReadNews 날짜별 읽은 뉴스 개수 조회 구현
yeonjy Jun 17, 2024
e4635f5
Merge branch 'fix/#141-backend-kakao-login' into feat/#136-category-s…
yeonjy Jun 17, 2024
6dbdbf8
chore: Querydsl 관련 설정
yeonjy Jun 17, 2024
671c70b
feat: 날짜별 뉴스 조회수 조회 api 구현
yeonjy Jun 17, 2024
eac9ae8
feat: QuerydslConfig
yeonjy Jun 17, 2024
15fdc6d
feat: getViewOfDates 로직 구현
yeonjy Jun 17, 2024
104eb4e
feat: QuerydslConfig 컨텍스트 등록
yeonjy Jun 17, 2024
152ccd9
test: StatisticsController 추가
yeonjy Jun 17, 2024
4448411
rename: test package 명 controller -> api
yeonjy Jun 17, 2024
921bfb0
style: 사용하지 않는 import 제거
yeonjy Jun 17, 2024
c3427ec
test: StatisticsServiceTest 구현
yeonjy Jun 17, 2024
c32c4fe
test: ReadNewsRepositoryTest 구현
yeonjy Jun 17, 2024
dbdc4d9
feat: statistics.dto에 response 패키지 추가
yeonjy Jun 17, 2024
b199b0f
feat: getCategoryStatistics API 구현
yeonjy Jun 17, 2024
a53117c
feat: getCountOfReadNewsByCategory querydsl 로직 구현
yeonjy Jun 17, 2024
ca64137
feat: getCategoryStatistics service 로직 구현
yeonjy Jun 17, 2024
f8b8136
test: 카테고리별 조회한 뉴스 개수 관련 테스트 구현
yeonjy Jun 17, 2024
e3217d2
refactor: 날짜별 읽은 뉴스 조회수 반환 로직에 로그인 유저 파라미터 추가
yeonjy Jun 17, 2024
cfd4c6b
fix: NewsCategory directory 변경 적용
yeonjy Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: getCategoryStatistics API 구현
yeonjy committed Jun 17, 2024
commit b199b0fa51bbc74cbc4f30eaef7b00f43d1bcc92
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.rollthedice.backend.domain.statistics.api;

import com.rollthedice.backend.domain.news.dto.response.NewsResponse;
import com.rollthedice.backend.domain.statistics.dto.DateViewStatisticsResponse;
import com.rollthedice.backend.domain.statistics.dto.response.CategoryStatisticsResponse;
import com.rollthedice.backend.domain.statistics.dto.response.DateViewStatisticsResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springframework.data.domain.Pageable;

import java.util.List;

@@ -21,4 +20,16 @@ public interface StatisticsApi {
description = "요청에 성공하였습니다."
)
List<DateViewStatisticsResponse> getViewsOfDates();

@Operation(
summary = "카테고리별 조회수 조회",
description = "카테고리별 조회수를 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"Statistics"}
)
@ApiResponse(
responseCode = "200",
description = "요청에 성공하였습니다."
)
List<CategoryStatisticsResponse> getCategoryStatistics();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.rollthedice.backend.domain.statistics.api;

import com.rollthedice.backend.domain.statistics.dto.DateViewStatisticsResponse;
import com.rollthedice.backend.domain.statistics.dto.response.CategoryStatisticsResponse;
import com.rollthedice.backend.domain.statistics.dto.response.DateViewStatisticsResponse;
import com.rollthedice.backend.domain.statistics.service.StatisticsService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
@@ -23,4 +24,11 @@ public class StatisticsController implements StatisticsApi {
public List<DateViewStatisticsResponse> getViewsOfDates() {
return statisticsService.getViewsOfDates();
}

@ResponseStatus(HttpStatus.OK)
@GetMapping("/categories")
@Override
public List<CategoryStatisticsResponse> getCategoryStatistics() {
return statisticsService.getCategoryStatistics();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.rollthedice.backend.domain.statistics.dto.response;

import lombok.*;

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CategoryStatisticsResponse {
private Long views;
private String category;
}