Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ services:
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
env_file:
- .env
- .env:
Copy link

Copilot AI Dec 26, 2025

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.

Suggested change
- .env:
- .env

Copilot uses AI. Check for mistakes.

Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

There's an unnecessary blank line after the env_file configuration. This empty line (line 14) should be removed to maintain consistent YAML formatting.

Suggested change

Copilot uses AI. Check for mistakes.
labels:
# Autoheal: unhealthy 상태 시 자동 재시작 활성화
autoheal: "true"
Expand Down Expand Up @@ -38,7 +39,6 @@ services:
NEXON_OPEN_API_KEY: ${NEXON_OPEN_API_KEY}
AUCTION_HISTORY_DELAY_MS: ${AUCTION_HISTORY_DELAY_MS}
AUCTION_HISTORY_CRON: "${AUCTION_HISTORY_CRON}"
AUCTION_HISTORY_MIN_PRICE_CRON: "${AUCTION_HISTORY_MIN_PRICE_CRON}"

# === Docker Configuration ===
DOCKER_USERNAME: ${DOCKER_USERNAME}
Expand Down
9 changes: 4 additions & 5 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
image: open-api-batch-server:local
container_name: spring-app-local
ports:
- "${SERVER_PORT:-8080}:${SERVER_PORT:-8080}"
- "${SERVER_PORT:-8093}:${SERVER_PORT:-8093}"
env_file:
- .env.local # 로컬 환경 변수 파일
labels:
Expand All @@ -23,7 +23,7 @@ services:
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-local}
LANG: C.UTF-8
LC_ALL: C.UTF-8
SERVER_PORT: ${SERVER_PORT:-8080}
SERVER_PORT: ${SERVER_PORT:-8093}

# === Database Configuration ===
# Docker 네트워크 내부 연결 설정 (고정값)
Expand All @@ -42,7 +42,6 @@ services:
NEXON_OPEN_API_KEY: ${NEXON_OPEN_API_KEY}
AUCTION_HISTORY_DELAY_MS: ${AUCTION_HISTORY_DELAY_MS:-1000}
AUCTION_HISTORY_CRON: "${AUCTION_HISTORY_CRON:-0 0 * * * *}"
AUCTION_HISTORY_MIN_PRICE_CRON: "${AUCTION_HISTORY_MIN_PRICE_CRON:-0 30 * * * *}"

# === JVM Configuration (로컬 개발용 - 메모리 사용량 감소) ===
JAVA_OPTS: >-
Expand Down Expand Up @@ -88,7 +87,7 @@ services:

# Health Check
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${SERVER_PORT:-8080}/actuator/health"]
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${SERVER_PORT:-8093}/actuator/health"]
interval: ${HEALTHCHECK_INTERVAL:-30s}
timeout: ${HEALTHCHECK_TIMEOUT:-10s}
retries: ${HEALTHCHECK_RETRIES:-3}
Expand All @@ -108,7 +107,7 @@ services:
env_file:
- .env.local # 환경 변수 파일 로드
ports:
- "${MYSQL_EXTERNAL_PORT:-3306}:3306" # 외부 접속용 포트 (호스트에서 접근 시)
- "${MYSQL_EXTERNAL_PORT:-3319}:3306" # 외부 접속용 포트 (호스트에서 접근 시)
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-password}
MYSQL_DATABASE: ${DB_SCHEMA:-devnogi}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class AuctionHistoryScheduler {
@Value("${openapi.auction-history.delay-ms}")
private long delayMs;

@Scheduled(cron = "${openapi.auction-history.cron}", zone = "Asia/Seoul")
@Scheduled(cron = "${openapi.auction-history.cron:0 0 * * * *}", zone = "Asia/Seoul")
public void fetchAndSaveAuctionHistoryAll() {
// ItemCategory를 topCategory별로 그룹화
Map<String, List<ItemCategory>> categoriesByTopCategory =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

The page calculation logic is incorrect. When page is null, it should default to 0 (since Spring's PageRequest uses 0-based indexing), but this code calculates "DEFAULT_PAGE - 1" which equals "1 - 1 = 0". However, when page is provided (e.g., page=1), it calculates "page - 1 = 0", which is correct. The issue is that DEFAULT_PAGE is 1, but the default resolved page should be 0. Consider changing DEFAULT_PAGE to 0, or simplify the logic to: "int resolvedPage = this.page != null ? this.page - 1 : 0;"

Copilot uses AI. Check for mistakes.
int resolvedSize = this.size != null ? this.size : DEFAULT_SIZE;
SortField resolvedSortBy = this.sortBy != null ? this.sortBy : DEFAULT_SORT_BY;
SortDirection resolvedDirection =
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/until/the/eternity/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
// API 엔드포인트는 공개
// TODO: API endpoint 정리 후 matcher 수정
// TODO: 권한 관련 기능 개발 완료 후 hasRole 추가
.requestMatchers("/api/**", "/auction-history/**")
.requestMatchers(
"/api/**", "/auction-history/**", "/statistics/**")
.permitAll()
// 나머지 요청은 인증 필요
.anyRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import until.the.eternity.common.enums.SortDirection;
import until.the.eternity.common.response.ApiResponse;
import until.the.eternity.iteminfo.application.service.ItemInfoService;
Expand Down

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);
}
}
Loading