Skip to content

Commit 4e56251

Browse files
authored
Merge pull request JECT-Study#141 from JECT-Study/release/1.2.0
release: 1.2.0
2 parents 0c18509 + 36af2f6 commit 4e56251

File tree

47 files changed

+732
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+732
-59
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ dependencies {
5656
implementation 'org.flywaydb:flyway-mysql'
5757
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
5858
implementation 'org.redisson:redisson-spring-boot-starter:3.37.0'
59+
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
5960

6061
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
6162
annotationProcessor "jakarta.annotation:jakarta.annotation-api"

compose-local.yaml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,48 @@ services:
2727
ports:
2828
- "6379:6379"
2929

30-
chzz-frontend:
31-
image: cloudoort/chzzmarket-frontend:1.0
32-
container_name: react-app
30+
# chzz-frontend:
31+
# image: cloudoort/chzzmarket-frontend:1.0
32+
# container_name: react-app
33+
# ports:
34+
# - "5173:5173"
35+
chzz-es:
36+
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.5
37+
container_name: chzz-es
38+
environment:
39+
- discovery.type=single-node # 단일 노드
40+
- xpack.security.enabled=false # 로컬 개발을 위해 SSL 설정을 비활성화
41+
- xpack.security.http.ssl.enabled=false
42+
- xpack.security.transport.ssl.enabled=false
43+
- bootstrap.memory_lock=true # 메모리 스왑 방지
44+
- "ES_JAVA_OPTS=-Xms1g -Xmx1g" # Java heap size 설정
45+
ulimits: # 메모리 락 한도 설정 (-1은 무제한)
46+
memlock:
47+
soft: -1
48+
hard: -1
49+
ports:
50+
- "9200:9200" # https
51+
- "9300:9300" # tcp
52+
volumes:
53+
- chzz-es-data:/usr/share/elasticsearch/data
54+
command:
55+
- /bin/bash
56+
- -c
57+
- |
58+
/usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-nori &&
59+
/usr/local/bin/docker-entrypoint.sh
60+
kibana:
61+
image: docker.elastic.co/kibana/kibana:8.15.5
62+
container_name: chzz-kibana
63+
restart: unless-stopped
64+
environment:
65+
- ELASTICSEARCH_HOSTS=http://chzz-es:9200 # Elasticsearch 호스트 연결
66+
- SERVER_NAME=kibana
67+
- XPACK_SECURITY_ENABLED=false # 보안 비활성화
3368
ports:
34-
- "5173:5173"
69+
- "5601:5601" # Kibana UI 포트
70+
depends_on:
71+
- chzz-es # Kibana가 Elasticsearch와 연결되도록 의존성 추가
3572

3673
# node-exporter:
3774
# image: prom/node-exporter:latest
@@ -81,3 +118,4 @@ services:
81118

82119
volumes:
83120
chzz-mysql-data:
121+
chzz-es-data:

src/main/java/org/chzz/market/common/config/SecurityConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception
6363
.requestMatchers("/api-docs", "/swagger-ui/**", "/api/v3/api-docs/**").permitAll()
6464
.requestMatchers(GET,
6565
"/api/v1/auctions",
66+
"/api/v1/auctions/search",
6667
"/api/v1/auctions/{auctionId:\\d+}",
6768
"/api/v1/auctions/categories",
6869
"/api/v1/notifications/subscribe",

src/main/java/org/chzz/market/domain/auction/controller/AuctionApi.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ ResponseEntity<Page<?>> getAuctionList(@LoginUser Long userId, @RequestParam(req
7373
@RequestParam(required = false) @Min(value = 1, message = "minutes는 1 이상의 값이어야 합니다.") Integer minutes,
7474
@ParameterObject @PageableDefault(sort = "newest") Pageable pageable);
7575

76+
@Operation(summary = "경매 검색", description = "경매를 검색합니다. [sort] newest(최신순), expensive(높은 가격순), cheap(낮은 가격순)")
77+
ResponseEntity<?> searchAuctionList(@LoginUser Long userId,
78+
@RequestParam String keyword,
79+
@RequestParam AuctionStatus status,
80+
@ParameterObject @PageableDefault(sort = "newest") Pageable pageable);
81+
7682
@Operation(summary = "경매 카테고리 조회", description = "경매 카테고리 목록을 조회합니다.")
7783
@GetMapping("/categories")
7884
ResponseEntity<List<CategoryResponse>> getCategoryList();
@@ -120,5 +126,9 @@ ResponseEntity<Void> registerAuction(@LoginUser Long userId,
120126
@Operation(summary = "경매 테스트 등록", description = "테스트 등록합니다.")
121127
@PostMapping("/test")
122128
ResponseEntity<Void> testEndAuction(@LoginUser Long userId,
123-
@RequestParam int seconds);
129+
@RequestParam int seconds,
130+
@RequestParam String name,
131+
@RequestParam String description,
132+
@RequestParam AuctionStatus status,
133+
@RequestParam Integer minPrice);
124134
}

src/main/java/org/chzz/market/domain/auction/controller/AuctionController.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.chzz.market.domain.auction.service.AuctionCategoryService;
2020
import org.chzz.market.domain.auction.service.AuctionLookupService;
2121
import org.chzz.market.domain.auction.service.AuctionMyService;
22+
import org.chzz.market.domain.auction.service.AuctionSearchService;
2223
import org.chzz.market.domain.auction.service.AuctionTestService;
2324
import org.springframework.data.domain.Page;
2425
import org.springframework.data.domain.Pageable;
@@ -40,6 +41,7 @@ public class AuctionController implements AuctionApi {
4041
private final AuctionCategoryService auctionCategoryService;
4142
private final AuctionTestService testService;
4243
private final AuctionMyService auctionMyService;
44+
private final AuctionSearchService auctionSearchService;
4345

4446
/**
4547
* 경매 목록 조회
@@ -56,6 +58,15 @@ public ResponseEntity<Page<?>> getAuctionList(@LoginUser Long userId,
5658
auctionLookupService.getAuctionList(userId, category, status, minutes, pageable));
5759
}
5860

61+
@Override
62+
@GetMapping("/search")
63+
public ResponseEntity<?> searchAuctionList(@LoginUser Long userId,
64+
@RequestParam String keyword,
65+
@RequestParam AuctionStatus status,
66+
@PageableDefault(sort = "newest") Pageable pageable) {
67+
return ResponseEntity.ok(auctionSearchService.search(userId, keyword, status, pageable));
68+
}
69+
5970
/**
6071
* 경매 카테고리 Enum 조회
6172
*/
@@ -140,8 +151,12 @@ public ResponseEntity<Void> registerAuction(@LoginUser Long userId,
140151
@Override
141152
@PostMapping("/test")
142153
public ResponseEntity<Void> testEndAuction(@LoginUser Long userId,
143-
@RequestParam("seconds") int seconds) {
144-
testService.test(userId, seconds);
154+
@RequestParam("seconds") int seconds,
155+
@RequestParam String name,
156+
@RequestParam String description,
157+
@RequestParam AuctionStatus status,
158+
@RequestParam Integer minPrice) {
159+
testService.test(userId, seconds, name, description, status, minPrice);
145160
return ResponseEntity.status(HttpStatus.CREATED).build();
146161
}
147162
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package org.chzz.market.domain.auction.dto;
2+
3+
public record AuctionBidDetail(Long auctionId, Long bidCount, Boolean isParticipated) {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package org.chzz.market.domain.auction.dto;
2+
3+
public record AuctionLikeDetail(Long auctionId, Long likeCount, Boolean isLiked) {
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.chzz.market.domain.auction.dto.event;
2+
3+
import org.chzz.market.domain.auction.entity.Auction;
4+
5+
public record AuctionDocumentDeleteEvent(Auction auction) {
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.chzz.market.domain.auction.dto.event;
2+
3+
import org.chzz.market.domain.auction.entity.Auction;
4+
5+
public record AuctionDocumentModifyEvent(Auction auction) {
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.chzz.market.domain.auction.dto.event;
2+
3+
import org.chzz.market.domain.auction.entity.Auction;
4+
5+
public record AuctionDocumentSaveEvent(Auction auction) {
6+
}

0 commit comments

Comments
 (0)