Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
0ae8325
📦️ Chore: build gradle 수정
HaechangLee Apr 24, 2025
a6d02ef
✨ Feat: Openai Embedding 함수 추가
HaechangLee Apr 24, 2025
8b48c6d
🐛 Bug: application.yml openai api key 추가
HaechangLee Apr 24, 2025
a33906a
♻️ Refactor: 주의사항 유형 enum 삭제
thelightway24 Apr 24, 2025
d5681ba
✨ Feat: Embedding 공통 인터페이스 개발
HaechangLee Apr 24, 2025
7385df5
✨ Feat: Embedding 공통 인터페이스 개발
thelightway24 Apr 24, 2025
4b461a8
✨ Feat: API 데이터 정제 추가
thelightway24 Apr 24, 2025
647a349
Merge branch 'dev' into feature/#1-API-데이터-정제
thelightway24 Apr 24, 2025
012c872
✨ Feat: API 데이터 정제
thelightway24 Apr 24, 2025
385b0fe
✨ Feat: 전체 요청수 계산 클래스 생성
HaechangLee Apr 24, 2025
5f5b94a
📦 Chore: 테스트 서버 배포 추가
thelightway24 Apr 24, 2025
9eee333
🐛 Fix: 컴파일 오류 수정
thelightway24 Apr 24, 2025
d5ca2ff
🐛 Fix: API URI 환경 변수 오류 수정 (#12)
thelightway24 Apr 24, 2025
6426d9f
✨ Feat: 이미지 전체 저장
thelightway24 Apr 24, 2025
c7b08b0
✨ Feat: Embed 모델 2개(KM-BERT,KR-SBERT) 추가
thelightway24 Apr 25, 2025
469913d
✨ Feat: 임베딩 모델 적용
thelightway24 Apr 25, 2025
8da3a97
✨ Feature/#21 엘라스틱 서치 색인 추가 (#33)
thelightway24 Apr 28, 2025
8fa865c
✨ Feature/#35 증상 인덱싱 저장 로직 구현 (#36)
chanbyoung Apr 28, 2025
f26f44d
♻️ Refactor: 색인포트 통합 (#37)
HaechangLee Apr 28, 2025
284a3c4
✨ Feature/#40 임베딩 모델 선택 기능 (#41)
LEELISE Apr 28, 2025
4d46af6
📦 Chore: 테스트 코드 삭제 및 배포 코드로 수정
thelightway24 Apr 28, 2025
747a55f
🐛 Fix: 응답 객체에서 items 추출 실패해도 진행되도록 수정 및 로그 기록
thelightway24 Apr 28, 2025
a1b5e07
📦 Chore: 불필요한 로그 삭제
thelightway24 Apr 28, 2025
eecc5a6
📦 컨트롤러 일부 수정
thelightway24 Apr 28, 2025
ea7e929
🐛 Fix: 트랜잭션 삭제
thelightway24 Apr 28, 2025
5cbb4db
🐛 Fix: 메모리 오류 수정
thelightway24 Apr 28, 2025
11b2813
📦️ Chore: esIndex명 반환하도록 수정
HaechangLee Apr 29, 2025
240c1f8
📦️ Chore: 임베딩 색인시 인덱스명 반환
HaechangLee Apr 29, 2025
001e795
🐛 Bug: es인덱싱 이미지url null 값처리
HaechangLee Apr 29, 2025
6b8fc3c
🐛 Bug: es인덱싱 이미지url null 값처리
HaechangLee Apr 29, 2025
20a0755
🐛 Bug: pageable 인자 0 부터 시작하도록 변경
HaechangLee Apr 29, 2025
2253796
🐛 Bug: pageable 인자 0 부터 시작하도록 변경
HaechangLee Apr 29, 2025
214dd2f
♻️ Refactor: 임베딩 DB 접근 port 변경 (#48)
thelightway24 Apr 29, 2025
d334d2c
📦️ Chore: gptEmbeddingLoadingAdapter 로깅 추가 (#50)
HaechangLee Apr 29, 2025
6f0cb8e
♻️ Refactor: 임베딩 모델 변경 (#51)
thelightway24 Apr 29, 2025
a15090e
🐛 Bug: 페이지 정렬방식 변경 (#53)
HaechangLee Apr 29, 2025
8548019
🐛 Fix: 약품 효능 파싱 문제 수정 (#55)
thelightway24 Apr 29, 2025
927b9b7
✨Feature: 한약 구분 및 허가 만료 일자 추가 (#57)
thelightway24 Apr 30, 2025
89bc6e5
🐛 Fix: DrugDetailEntity 객체의 필드 isHerbal의 기본값을 false로 설정하였으나 @Builder…
LEELISE Apr 30, 2025
234792a
🐛 Fix: JPA Entity 수정 (#59)
thelightway24 Apr 30, 2025
dcbcb3d
🐛 Fix: #58 jpa entity null 오류 (#60)
thelightway24 Apr 30, 2025
cf54051
✨ Feature: #52 약품명 색인로직 추가 및 키워드 테이블 통합 (#61)
chanbyoung May 1, 2025
9ac1a27
🐛Fix: 메소드 호출 오류 수정 (#62)
thelightway24 May 1, 2025
82e7387
✨ Feat: 임베딩 모델 선택 기능
LEELISE May 2, 2025
aa20e77
♻️ Refactor: 임베딩 어뎁터 동작 수정 (#65)
HaechangLee May 2, 2025
fcd117c
♻️ Refactor: 임베딩 저장/로딩 포트통합 (#67)
HaechangLee May 2, 2025
53db068
✨ Feature: #68 스프링 배치 작업 (#69)
thelightway24 May 3, 2025
5471177
✨ Feature: #70 코드 통합 (#71)
thelightway24 May 5, 2025
04de952
📦 Chore: 증상 사전 빌드 시 추가 (#73)
thelightway24 May 5, 2025
f4ee624
Feature/#72 증상 사전 추가 (#74)
thelightway24 May 5, 2025
30b802a
🐛 Fix: 인덱스 청크 사이즈 수정 (#76)
thelightway24 May 5, 2025
b177515
🐛 Fix: 이미지 url ES필드 타입 수정
thelightway24 May 5, 2025
efd462a
🐛 Fix: 색인을 위한 어댑터 이름 영문 소문자로 변경 (#79)
thelightway24 May 5, 2025
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
9 changes: 7 additions & 2 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Copy Dictionary
run: |
mkdir -p src/main/resources
echo '${{ secrets.DICTIONARY }}' > src/main/resources/unique_symptoms.json

- name: Build Spring Boot (JAR)
run: ./gradlew bootJar -Penv=test

Expand All @@ -38,7 +43,7 @@ jobs:

- name: Wait for test server to be healthy
run: |
echo "🔍 Checking https://yakplus-test.techlog.dev/actuator/health ..."
echo "🔍 Checking https://yakplus-batch.techlog.dev/actuator/health ..."
curl --silent --fail \
--retry 5 --retry-connrefused --retry-delay 5 \
https://yakplus-test.techlog.dev/actuator/health
https://yakplus-batch.techlog.dev/actuator/health
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ configurations {

repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}

dependencies {
Expand All @@ -46,6 +48,16 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.17.10'

// OpenAi
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter:1.0.0-M5'


// Spring-Batch
implementation 'org.springframework.boot:spring-boot-starter-batch'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0'

// build.gradle
if (project.hasProperty('env') && project.env == 'test') {
dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.likelion.backendplus4.yakplus;

import com.likelion.backendplus4.yakplus.common.configuration.LogbackConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class YakplusApplication {
public static void main(String[] args) {
LogbackConfig logbackConfig = new LogbackConfig();
logbackConfig.configure();
SpringApplication.run(YakplusApplication.class, args);
}
public static void main(String[] args) {
SpringApplication.run(YakplusApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.likelion.backendplus4.yakplus.common.configuration;

import lombok.RequiredArgsConstructor;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.job.builder.JobBuilder;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* 공통 배치 Job 설정을 위한 클래스입니다.
* <p>
* 이 클래스는 의약품 정보를 수집하는 배치 Job을 정의합니다.
* <p>
* @field jobName Job 이름
* @since 2025-05-02
*/
@Configuration
@RequiredArgsConstructor
public class AllJobConfig {

private final String jobName = "drugScrapJob";

/**
* 의약품 정보를 수집하는 Batch Job 정의
*
* @param jobRepository JobRepository 인스턴스
* @param totalPageCheckStep 전체 페이지 수 확인 Step
* @param drugDetailStep 상세 정보 수집 Step
* @return 구성된 Job 인스턴스
* @author 함예정
* @since 2025-05-02
*/
@Bean
public Job drugScrapJob(JobRepository jobRepository,
Step totalPageCheckStep,
Step drugDetailStep,
Step imageTotalPageCheckStep,
Step imageMasterStep,
Step switchModelStepToOpenAi,
Step openAiEmbedStep,
Step switchModelStepToKmBert,
Step kmBertEmbedStep,
Step switchModelStepToKrSBert,
Step krSBertEmbedStep) {
return new JobBuilder(jobName, jobRepository)
.start(totalPageCheckStep)
.next(drugDetailStep)
.next(imageTotalPageCheckStep)
.next(imageMasterStep)
.next(switchModelStepToOpenAi)
.next(openAiEmbedStep)
.next(switchModelStepToKmBert)
.next(kmBertEmbedStep)
.next(switchModelStepToKrSBert)
.next(krSBertEmbedStep)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.likelion.backendplus4.yakplus.drug.infrastructure.config;
package com.likelion.backendplus4.yakplus.common.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -7,11 +7,17 @@
/**
* Api 요청을 보내기 위한 RestTemplate 빈 생성
*
* @since 2025-04-15
* @author 함예정
*/
@Configuration
public class ApiRestTemplateConfig {

/**
* RestTemplate 빈을 생성합니다.
*
* @return RestTemplate
* @since 2025-04-15
* @author 함예정
*/
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.likelion.backendplus4.yakplus.common.configuration;

import com.likelion.backendplus4.yakplus.common.logging.trace.decorator.MdcTaskDecorator;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
* 의약품 상세정보 수집을 위한 Spring Batch 설정 클래스
*/
@Configuration
@RequiredArgsConstructor
public class BatchExecutorConfig {
private final MdcTaskDecorator mdcTaskDecorator;
private final String normalExecutorName = "normalExecutor";
private final String singleItemExecutorName = "singleItemExecutor";

/**
* 일반적인 작업처리를 위한 ThreadPool 기반 TaskExecutor 설정
*
* @return TaskExecutor 인스턴스
* @author 함예정
* @since 2025-05-02
*/
@Bean(normalExecutorName)
public TaskExecutor taskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(5);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(10);
executor.setTaskDecorator(mdcTaskDecorator);
executor.setThreadNamePrefix("normalExecutor-");
executor.initialize();
return executor;
}

/**
* 단일 아이템 단위로 처리하는 작업을 위한
* ThreadPool 기반 TaskExecutor 설정
*
* @return TaskExecutor 인스턴스
* @author 함예정
* @since 2025-05-02
*/
@Bean(singleItemExecutorName)
public TaskExecutor taskExecutorMoreThreads() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(20);
executor.setTaskDecorator(mdcTaskDecorator);
executor.setThreadNamePrefix("singleItemExecutor-");
executor.initialize();
return executor;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import jakarta.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import java.nio.file.Files;
Expand All @@ -25,11 +26,16 @@
*/
@Configuration
public class LogbackConfig {
private static final String LOG_DIRECTORY = "logs";
private static final String LOG_FILE_NAME = "like-lion.log";
private static final String LOG_PATTERN = "%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n";
private static final int MAX_HISTORY = 30;
private static final String TOTAL_SIZE_CAP = "1GB";
@Value("${log.rolling.directory}")
private String LOG_DIRECTORY;
@Value("${log.rolling.file-name}")
private String LOG_FILE_NAME;
@Value("${log.rolling.pattern}")
private String LOG_PATTERN;
@Value("${log.rolling.max-history}")
private int MAX_HISTORY;
@Value("${log.rolling.total-size-cap}")
private String TOTAL_SIZE_CAP;

/**
* 로깅 설정을 초기화하는 메서드
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.likelion.backendplus4.yakplus.common.configuration;

import org.springframework.ai.openai.api.OpenAiApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenaiConfig {
@Value("${spring.ai.openai.api-key}")
private String apiKey;

@Bean
public OpenAiApi openaiApi() {
return new OpenAiApi(apiKey);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.likelion.backendplus4.yakplus.common.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;

@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.info(new Info()
.title("YakPlus API")
.description("YakPlus 프로젝트의 API 문서입니다.")
.version("1.0.0"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.likelion.backendplus4.yakplus.common.interceptor.LogInterceptor;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand Down
Loading