Skip to content
Merged
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: 3 additions & 1 deletion .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ jobs:
echo "COVERAGE=$percent" >> "$GITHUB_OUTPUT"

- name: Comment PR with Test and Coverage Result
if: always()
if: always() && github.event.pull_request.head.repo.full_name == github.repository
uses: marocchino/sticky-pull-request-comment@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
header: test-results
message: |
Expand Down
27 changes: 27 additions & 0 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ services:
AUCTION_HISTORY_DELAY_MS: ${AUCTION_HISTORY_DELAY_MS:-1000}
AUCTION_HISTORY_CRON: "${AUCTION_HISTORY_CRON:-0 0 * * * *}"
STATISTICS_PREVIOUS_DAY_CRON: "${STATISTICS_PREVIOUS_DAY_CRON:-0 0 * * * *}"
REDIS_HOST: redis
REDIS_PORT: ${REDIS_PORT:-6389}
REDIS_PASSWORD: ${REDIS_PASSWORD}

# === Elasticsearch Configuration ===
ELASTICSEARCH_ENABLED: ${ELASTICSEARCH_ENABLED:-true}
Expand Down Expand Up @@ -98,6 +101,8 @@ services:
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy

# === Health Check (Local - 표준) ===
healthcheck:
Expand Down Expand Up @@ -189,6 +194,27 @@ services:
reservations:
memory: 512m

# Redis
redis:
image: redis:8.4.0
container_name: open-api-batch-redis
restart: unless-stopped
env_file:
- .env.local
ports:
- "${REDIS_EXTERNAL_PORT:-6389}:${REDIS_PORT:-6389}"
command: ["redis-server", "--port", "${REDIS_PORT:-6389}", "--requirepass", "${REDIS_PASSWORD}"]
networks:
- app-network
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "-p", "${REDIS_PORT:-6389}", "ping"]
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

Passing the Redis password via -a on the command line will cause Redis CLI to emit a warning about the password being visible in process listings. While this is a health check and the exposure is limited, consider using REDISCLI_AUTH environment variable instead to avoid leaking the password in ps output.

Copilot uses AI. Check for mistakes.
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

# === Autoheal (Local - 표준) ===
# unhealthy 컨테이너 자동 재시작 서비스
autoheal:
Expand All @@ -214,6 +240,7 @@ services:
volumes:
mysql_data:
elasticsearch_data:
redis_data:
app-logs:
driver: local

Expand Down
5 changes: 0 additions & 5 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ services:
JWT_ACCESS_TOKEN_VALIDITY: ${JWT_ACCESS_TOKEN_VALIDITY}
JWT_REFRESH_TOKEN_VALIDITY: ${JWT_REFRESH_TOKEN_VALIDITY}

# === Redis Configuration ===
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_PASSWORD: ${REDIS_PASSWORD}

# === External API Configuration ===
NEXON_OPEN_API_KEY: ${NEXON_OPEN_API_KEY}
AUCTION_HISTORY_DELAY_MS: ${AUCTION_HISTORY_DELAY_MS}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package until.the.eternity.auctionhistory.application.scheduler;

import java.util.*;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -17,9 +19,6 @@
import until.the.eternity.common.annotation.BatchLog;
import until.the.eternity.common.enums.ItemCategory;

import java.util.*;
import java.util.stream.Collectors;

@Slf4j
@Component
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package until.the.eternity.auctionhistory.application.service;

import jakarta.persistence.EntityManager;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
Expand All @@ -17,8 +18,6 @@
import until.the.eternity.common.response.PageResponseDto;
import until.the.eternity.config.CacheNames;

import java.util.List;

@Service
@RequiredArgsConstructor
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package until.the.eternity.auctionhistory.application.service.fetcher;

import java.util.ArrayList;
import java.util.List;
import java.util.OptionalInt;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand All @@ -9,10 +12,6 @@
import until.the.eternity.auctionhistory.interfaces.external.dto.OpenApiAuctionHistoryResponse;
import until.the.eternity.common.enums.ItemCategory;

import java.util.ArrayList;
import java.util.List;
import java.util.OptionalInt;

@Slf4j
@Component
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package until.the.eternity.auctionhistory.application.service.persister;

import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand All @@ -10,8 +11,6 @@
import until.the.eternity.auctionhistory.interfaces.external.dto.OpenApiAuctionHistoryResponse;
import until.the.eternity.common.enums.ItemCategory;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
@Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package until.the.eternity.auctionhistory.domain.entity;

import jakarta.persistence.*;
import lombok.*;
import until.the.eternity.auctionitemoption.domain.entity.AuctionHistoryItemOption;

import java.time.Instant;
import java.util.List;
import lombok.*;
import until.the.eternity.auctionitemoption.domain.entity.AuctionHistoryItemOption;

@Entity
@Table(name = "auction_history")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package until.the.eternity.auctionhistory.domain.event;

import lombok.Getter;

import java.time.LocalDateTime;
import lombok.Getter;

/** 경매장 거래 내역 저장 완료 이벤트 AuctionHistoryScheduler가 거래 내역을 성공적으로 저장한 후 발행됩니다. */
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package until.the.eternity.auctionhistory.domain.mapper;

import java.util.List;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import until.the.eternity.auctionhistory.domain.entity.AuctionHistory;
import until.the.eternity.auctionhistory.interfaces.rest.dto.response.AuctionHistoryDetailResponse;
import until.the.eternity.auctionhistory.interfaces.rest.dto.response.ItemOptionResponse;
import until.the.eternity.auctionitemoption.domain.entity.AuctionHistoryItemOption;

import java.util.List;

/**
* AuctionHistory Entity to internal.responseDto transfer mapper class 데이터 흐름은 external.responseDto
* -> entity -> internal.responseDto 단방향으로 흐름
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package until.the.eternity.auctionhistory.domain.mapper;

import java.time.Instant;
import java.util.List;
import org.mapstruct.*;
import until.the.eternity.auctionhistory.domain.entity.AuctionHistory;
import until.the.eternity.auctionhistory.interfaces.external.dto.OpenApiAuctionHistoryResponse;
import until.the.eternity.common.enums.ItemCategory;

import java.time.Instant;
import java.util.List;

@Mapper(componentModel = "spring", uses = OpenApiItemOptionMapper.class)
public interface OpenApiAuctionHistoryMapper {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package until.the.eternity.auctionhistory.domain.repository;

import java.time.Instant;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import until.the.eternity.auctionhistory.domain.entity.AuctionHistory;
import until.the.eternity.auctionhistory.interfaces.rest.dto.request.AuctionHistorySearchRequest;
import until.the.eternity.common.enums.ItemCategory;

import java.time.Instant;
import java.util.List;
import java.util.Optional;
import java.util.Set;

/** 경매장 거래 내역 POJO Repository - Mock 또는 Stub 으로 대체해 단위 테스트 용이성 확보 */
public interface AuctionHistoryRepositoryPort {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package until.the.eternity.auctionhistory.domain.service;

import java.time.Instant;
import java.util.List;
import java.util.OptionalInt;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand All @@ -8,11 +12,6 @@
import until.the.eternity.auctionhistory.interfaces.external.dto.OpenApiAuctionHistoryResponse;
import until.the.eternity.common.enums.ItemCategory;

import java.time.Instant;
import java.util.List;
import java.util.OptionalInt;
import java.util.Set;

@Slf4j
@Component
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package until.the.eternity.auctionhistory.domain.service.fetcher;

import java.util.List;
import until.the.eternity.auctionhistory.interfaces.external.dto.OpenApiAuctionHistoryResponse;
import until.the.eternity.common.enums.ItemCategory;

import java.util.List;

public interface AuctionHistoryFetcherPort {
List<OpenApiAuctionHistoryResponse> fetch(ItemCategory category);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package until.the.eternity.auctionhistory.domain.service.persister;

import java.util.List;
import until.the.eternity.auctionhistory.domain.entity.AuctionHistory;
import until.the.eternity.auctionhistory.interfaces.external.dto.OpenApiAuctionHistoryResponse;
import until.the.eternity.common.enums.ItemCategory;

import java.util.List;

public interface AuctionHistoryPersisterPort {

List<AuctionHistory> filterOutExisting(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package until.the.eternity.auctionhistory.infrastructure.persistence;

import java.time.Instant;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import until.the.eternity.auctionhistory.domain.entity.AuctionHistory;

import java.time.Instant;
import java.util.List;
import java.util.Optional;

@Repository
public interface AuctionHistoryJpaRepository
extends JpaRepository<AuctionHistory, String>, JpaSpecificationExecutor<AuctionHistory> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import com.querydsl.core.types.dsl.NumberTemplate;
import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
Expand All @@ -20,12 +25,6 @@
import until.the.eternity.auctionhistory.interfaces.rest.dto.request.*;
import until.the.eternity.auctionitemoption.domain.entity.QAuctionHistoryItemOption;

import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;

@Component
@RequiredArgsConstructor
class AuctionHistoryQueryDslRepository {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package until.the.eternity.auctionhistory.infrastructure.persistence;

import jakarta.persistence.EntityManager;
import java.time.Instant;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
Expand All @@ -12,11 +16,6 @@
import until.the.eternity.auctionhistory.interfaces.rest.dto.request.AuctionHistorySearchRequest;
import until.the.eternity.common.enums.ItemCategory;

import java.time.Instant;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;

/** AuctionHistoryRepository Interface 구현체 */
@Repository
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package until.the.eternity.auctionhistory.interfaces.external.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

public record OpenApiAuctionHistoryListResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import until.the.eternity.auctionitemoption.domain.dto.external.OpenApiAuctionItemOptionResponse;

import java.time.Instant;
import java.util.List;
import until.the.eternity.auctionitemoption.domain.dto.external.OpenApiAuctionItemOptionResponse;

public record OpenApiAuctionHistoryResponse(
@JsonProperty("item_name") String itemName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Arrays;

/** 검색 기준 (이상/이하/같음) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Arrays;

/** 정렬 방향 (오름차순/내림차순) */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package until.the.eternity.auctionhistory.interfaces.rest.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;

import java.time.LocalDate;
import java.util.List;

Expand All @@ -28,6 +27,10 @@ public record AuctionHistorySearchRequest(
List<MetalwareSearchRequest> metalwareSearchRequests) {

public AuctionHistorySearchRequest {
if (isExactItemName == null) {
isExactItemName = true;
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

Same inconsistency as in AuctionRealtimeSearchRequest: the @Schema annotation on isExactItemName declares defaultValue = "false", but the compact constructor now sets the default to true when null. This is a breaking behavioral change (previously, Boolean.TRUE.equals(null) evaluated to false, matching the documented default). Either update the @Schema(defaultValue = ...) to "true", or change the default to false.

Suggested change
isExactItemName = true;
isExactItemName = false;

Copilot uses AI. Check for mistakes.
}

if (dateAuctionBuyRequest == null
|| ((dateAuctionBuyRequest.dateAuctionBuyFrom() == null
|| dateAuctionBuyRequest.dateAuctionBuyFrom().isBlank())
Expand Down
Loading