-
Notifications
You must be signed in to change notification settings - Fork 1
feat: auction history 통계 테이블 생성 및 API 구현 #80
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
base: dev
Are you sure you want to change the base?
Changes from all commits
fbe6da7
daa0f5b
24d67bc
8521e5f
66afcda
4f944a1
275a7c5
0e5036d
434baec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -10,7 +10,8 @@ services: | |||
| ports: | ||||
| - "${SERVER_PORT}:${SERVER_PORT}" | ||||
| env_file: | ||||
| - .env | ||||
| - .env: | ||||
|
|
||||
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ public record PageRequestDto( | |
| private static final SortDirection DEFAULT_DIRECTION = SortDirection.DESC; | ||
|
|
||
| public Pageable toPageable() { | ||
| int resolvedPage = this.page != null ? this.page - 1 : DEFAULT_PAGE; | ||
| int resolvedPage = this.page != null ? this.page - 1 : DEFAULT_PAGE - 1; | ||
|
||
| int resolvedSize = this.size != null ? this.size : DEFAULT_SIZE; | ||
| SortField resolvedSortBy = this.sortBy != null ? this.sortBy : DEFAULT_SORT_BY; | ||
| SortDirection resolvedDirection = | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package until.the.eternity.statistics.application.service; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.data.domain.Page; | ||
| import org.springframework.data.domain.Pageable; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
| import until.the.eternity.common.response.PageResponseDto; | ||
| import until.the.eternity.statistics.domain.entity.daily.ItemDailyStatistics; | ||
| import until.the.eternity.statistics.domain.mapper.ItemDailyStatisticsMapper; | ||
| import until.the.eternity.statistics.interfaces.rest.dto.response.ItemDailyStatisticsResponse; | ||
| import until.the.eternity.statistics.repository.daily.ItemDailyStatisticsRepository; | ||
|
|
||
| @Slf4j | ||
| @Service | ||
| @RequiredArgsConstructor | ||
| public class ItemDailyStatisticsService { | ||
|
|
||
| private final ItemDailyStatisticsRepository repository; | ||
| private final ItemDailyStatisticsMapper mapper; | ||
|
|
||
| /** 아이템별 일간 통계 전체 조회 (페이징) */ | ||
| @Transactional(readOnly = true) | ||
| public PageResponseDto<ItemDailyStatisticsResponse> findAll(Pageable pageable) { | ||
| Page<ItemDailyStatistics> page = repository.findAll(pageable); | ||
| Page<ItemDailyStatisticsResponse> dtoPage = page.map(mapper::toDto); | ||
| return PageResponseDto.of(dtoPage); | ||
| } | ||
|
|
||
| /** 아이템별 일간 통계 ID로 단건 조회 */ | ||
| @Transactional(readOnly = true) | ||
| public ItemDailyStatisticsResponse findById(Long id) { | ||
| ItemDailyStatistics entity = | ||
| repository | ||
| .findById(id) | ||
| .orElseThrow( | ||
| () -> | ||
| new IllegalArgumentException( | ||
| "ItemDailyStatistics not found: " + id)); | ||
| return mapper.toDto(entity); | ||
| } | ||
| } |
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's a syntax error in the env_file configuration. It should be "- .env" (a list item), not "- .env:" (with a colon). The colon at the end makes this invalid YAML syntax and will cause Docker Compose to fail when parsing this file.