Skip to content

Commit

Permalink
chore: opensearch를 위한 db create
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Yeji committed Nov 2, 2024
1 parent 00edf74 commit 3efedd1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/live/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spring:
driver-class-name: org.mariadb.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
ddl-auto: create
database: mysql
database-platform: org.hibernate.dialect.MariaDBDialect
generate-ddl: true
Expand Down
2 changes: 1 addition & 1 deletion backend/member/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spring:
tomcat.initial-size: 3 # 적절한 수치로 조정
jpa:
hibernate:
ddl-auto: update
ddl-auto: create
database: mysql
database-platform: org.hibernate.dialect.MariaDBDialect
generate-ddl: true
Expand Down
2 changes: 1 addition & 1 deletion backend/order/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spring:
driver-class-name: org.mariadb.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
ddl-auto: create
database: mysql
database-platform: org.hibernate.dialect.MariaDBDialect
generate-ddl: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.samtuap.inong.domain.product.repository.PackageProductRepository;
import org.samtuap.inong.domain.seller.dto.FarmCategoryResponse;
import org.samtuap.inong.domain.seller.dto.SellerFarmInfoUpdateRequest;
import org.samtuap.inong.search.document.FarmDocument;
import org.samtuap.inong.search.service.FarmSearchService;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
Expand Down Expand Up @@ -191,8 +192,8 @@ public FarmCreateResponse createFarm(FarmCreateRequest request, Long sellerId) {
}

// elasticsearch✔️ : open search에 인덱싱
// FarmDocument farmDocument = FarmDocument.convertToDocument(farm);
// farmSearchService.indexFarmDocument(farmDocument);
FarmDocument farmDocument = FarmDocument.convertToDocument(farm);
farmSearchService.indexFarmDocument(farmDocument);

return FarmCreateResponse.fromEntity(farm);
}
Expand Down Expand Up @@ -229,8 +230,8 @@ public void updateFarmInfo(Long sellerId, SellerFarmInfoUpdateRequest infoUpdate
}

// elasticsearch✔️ : open search에 수정
// FarmDocument farmDocument = FarmDocument.convertToDocument(farm);
// farmSearchService.updateFarm(farmDocument);
FarmDocument farmDocument = FarmDocument.convertToDocument(farm);
farmSearchService.updateFarm(farmDocument);
}

public List<FarmCategoryResponse> getAllFarmCategories() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.samtuap.inong.domain.seller.jwt.domain.JwtToken;
import org.samtuap.inong.domain.seller.jwt.service.JwtService;
import org.samtuap.inong.domain.seller.repository.SellerRepository;
import org.samtuap.inong.search.service.FarmSearchService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import static org.samtuap.inong.common.exceptionType.SellerExceptionType.*;
Expand All @@ -35,6 +36,7 @@ public class SellerService {
private final JwtService jwtService;
private final PackageProductRepository packageProductRepository;
private final RedisTool redisUtil;
private final FarmSearchService farmSearchService;

@Transactional
public boolean verifyAuthCode(String email, String code) {
Expand Down Expand Up @@ -113,7 +115,7 @@ public void withDraw(Long sellerId, String password) {
// 농장 삭제 진행
farmRepository.delete(farm);
// elasticsearch✔️ : 삭제
// farmSearchService.deleteFarm(String.valueOf(farm.getId()));
farmSearchService.deleteFarm(String.valueOf(farm.getId()));
}

// 삭제되지 않은 패키지가 없으면 농장과 판매자 삭제 진행
Expand Down
2 changes: 1 addition & 1 deletion backend/product/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spring:

jpa:
hibernate:
ddl-auto: update
ddl-auto: create
database: mysql
database-platform: org.hibernate.dialect.MariaDBDialect
generate-ddl: true
Expand Down

0 comments on commit 3efedd1

Please sign in to comment.