Skip to content

Conversation

@dev-ant
Copy link
Contributor

@dev-ant dev-ant commented Jan 15, 2026

📋 상세 설명

  • 통계 API를 페이지네이션 기반 조회 → 조건 기반 검색 API로 전환

    • 기존의 단순 페이지네이션 목록 조회 방식에서 벗어나, 카테고리(item / sub / top) 및 날짜 범위 조건을 기반으로 한 검색 전용 API로 구조를 변경
    • 이 변경을 통해 클라이언트는 불필요한 전체 데이터 조회 없이 필요한 통계 데이터만 요청할 수 있으며, 향후 복합 조건 검색(예: 특정 카테고리 + 특정 기간 비교) 확장에도 유리한 API 구조를 확보
  • 통계 조회를 위한 Search Request DTO 및 날짜 유틸 도입

    • 일간/주간 통계 전반에 대해 전용 Search Request DTO를 도입하고, 날짜 범위 검증 및 주(week) 단위 변환을 담당하는 공통 유틸리티 클래스를 추가
      *날짜 검증 및 변환 로직을 컨트롤러/서비스에서 제거하고 공통 유틸로 분리함으로써, 중복 코드를 제거하고 날짜 계산 기준(주 시작일, 종료일 등)을 일관되게 유지할 수 있도록 개선
  • 통계 엔티티 및 조회 계층에 카테고리 필드 기반 구조 확장

    • temDailyStatistics, ItemWeeklyStatistics 엔티티에 **카테고리 관련 필드(item / sub / top)**를 추가하고, 이에 맞춰 Repository에 조건 기반 조회 쿼리 메서드를 신규 정의
    • 통계 데이터 자체에 카테고리 정보를 포함함으로써, 조회 시 별도의 조인이나 외부 매핑 없이도 통계 단위별 필터링이 가능해졌으며, 조회 성능과 쿼리 가독성 모두를 개선

📊 체크리스트

  • PR 제목이 형식에 맞나요 e.g. feat: PR을 등록한다
  • 코드가 테스트 되었나요
  • 문서는 업데이트 되었나요
  • 불필요한 코드를 제거했나요
  • 이슈와 라벨이 등록되었나요

📆 마감일

Close #{issue number}

@github-actions
Copy link

github-actions bot commented Jan 15, 2026

✅ 테스트 결과 for PR

Build: success

🧪 테스트 실행 with Gradle
📈 Coverage: -0.00%

📁 테스트 결과
📁 커버리지 보고서 (HTML)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements API endpoints to retrieve auction history statistics with filtering capabilities. The changes transform the statistics controllers from generic pagination-based list endpoints to specialized search APIs that filter data by categories and date ranges.

Changes:

  • Introduced utility classes for date range validation and week conversion
  • Added search request DTOs for all statistics endpoints (daily and weekly, across item/subcategory/top-category levels)
  • Updated repository interfaces with new query methods for filtered data retrieval
  • Refactored service and controller layers to support search by category and date range instead of generic pagination
  • Added category fields to ItemDailyStatistics and ItemWeeklyStatistics entities

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
WeekConverter.java Utility for converting date ranges to ISO 8601 year-week lists
DateRangeValidator.java Validates date ranges for daily (30 days) and weekly (120 days) queries
*Repository.java (6 files) Added query methods for filtering by category and date range
*SearchRequest.java (6 files) New DTOs for search requests with category and date parameters
*Controller.java (6 files) Replaced pagination endpoints with category-based search endpoints
ItemWeeklyStatistics.java Added itemTopCategory and itemSubCategory fields
ItemDailyStatistics.java Added itemTopCategory and itemSubCategory fields
*Service.java (6 files) Replaced findAll/findById methods with search methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
import until.the.eternity.statistics.domain.entity.weekly.TopCategoryWeeklyStatistics;
import until.the.eternity.statistics.util.WeekConverter;
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The WeekConverter import is unused in this file. Consider removing it to keep imports clean.

Suggested change
import until.the.eternity.statistics.util.WeekConverter;

Copilot uses AI. Check for mistakes.
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
import until.the.eternity.statistics.domain.entity.weekly.SubcategoryWeeklyStatistics;
import until.the.eternity.statistics.util.WeekConverter;
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The WeekConverter import is unused in this file. Consider removing it to keep imports clean.

Suggested change
import until.the.eternity.statistics.util.WeekConverter;

Copilot uses AI. Check for mistakes.
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
import until.the.eternity.statistics.domain.entity.weekly.ItemWeeklyStatistics;
import until.the.eternity.statistics.util.WeekConverter;
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The WeekConverter import is unused in this file. Consider removing it to keep imports clean.

Suggested change
import until.the.eternity.statistics.util.WeekConverter;

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +31
public ResponseEntity<java.util.List<TopCategoryWeeklyStatisticsResponse>>
searchTopCategoryWeeklyStatistics(
@ParameterObject @ModelAttribute
@jakarta.validation.Valid
until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryWeeklyStatisticsSearchRequest
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The code uses fully qualified class names (java.util.List, jakarta.validation.Valid, until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryWeeklyStatisticsSearchRequest) instead of importing them. Add proper imports and use simple class names for better readability.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +31
public ResponseEntity<java.util.List<TopCategoryDailyStatisticsResponse>>
searchTopCategoryDailyStatistics(
@ParameterObject @ModelAttribute
@jakarta.validation.Valid
until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryDailyStatisticsSearchRequest
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The code uses fully qualified class names (java.util.List, jakarta.validation.Valid, until.the.eternity.statistics.interfaces.rest.dto.request.TopCategoryDailyStatisticsSearchRequest) instead of importing them. Add proper imports and use simple class names for better readability.

Copilot uses AI. Check for mistakes.
Page<TopCategoryDailyStatisticsResponse> dtoPage = page.map(mapper::toDto);
return PageResponseDto.of(dtoPage);
}
public java.util.List<TopCategoryDailyStatisticsResponse> search(
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.

Copilot uses AI. Check for mistakes.
Page<SubcategoryWeeklyStatisticsResponse> dtoPage = page.map(mapper::toDto);
return PageResponseDto.of(dtoPage);
}
public java.util.List<SubcategoryWeeklyStatisticsResponse> search(
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.

Copilot uses AI. Check for mistakes.
Page<SubcategoryDailyStatisticsResponse> dtoPage = page.map(mapper::toDto);
return PageResponseDto.of(dtoPage);
}
public java.util.List<SubcategoryDailyStatisticsResponse> search(
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.

Copilot uses AI. Check for mistakes.
Page<ItemWeeklyStatisticsResponse> dtoPage = page.map(mapper::toDto);
return PageResponseDto.of(dtoPage);
}
public java.util.List<ItemWeeklyStatisticsResponse> search(
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The new search method lacks test coverage. Add tests for the search method including validation and query scenarios.

Copilot uses AI. Check for mistakes.
Page<ItemDailyStatisticsResponse> dtoPage = page.map(mapper::toDto);
return PageResponseDto.of(dtoPage);
}
public java.util.List<ItemDailyStatisticsResponse> search(
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The new search method lacks test coverage. The existing tests only cover findAll and findById which have been removed. Add tests for the search method including validation and query scenarios.

Copilot uses AI. Check for mistakes.
@dev-ant dev-ant changed the title feat; auction history 통계 조회 api 구현 feat: 경매장 거래 내역 통계 조회 API 구현 Jan 15, 2026
@dev-ant dev-ant self-assigned this Jan 15, 2026
@dev-ant dev-ant added the ✨feature 새로운 기능 추가 label Jan 15, 2026
@dev-ant dev-ant merged commit 48a79ee into dev Jan 15, 2026
1 of 2 checks passed
@dev-ant dev-ant deleted the feat/auction-history-statics-search branch January 15, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨feature 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants