샘플코드 추가
This commit is contained in:
@@ -152,7 +152,10 @@ api-app # 메인 실행 모듈
|
||||
│ │ │ ├── DabeeoDetectionApiApplication.java
|
||||
│ │ │
|
||||
│ │ │ ├── config # 설정 파일
|
||||
│ │ │ ├── core # core service (Repository 비즈니스 서비스)
|
||||
│ │ │ ├── db
|
||||
│ │ │ │ ├── core # core service (Repository 비즈니스 서비스)
|
||||
│ │ │ │ └── repository # Repository (DB 인터페이스/구현)
|
||||
│ │ │ ├── core
|
||||
│ │ │ ├── domain # 도메인
|
||||
│ │ │ │ ├── imagery # 영상 데이터 관리
|
||||
│ │ │ │ ├── labeling # 라벨링 툴
|
||||
@@ -161,10 +164,7 @@ api-app # 메인 실행 모듈
|
||||
│ │ │ │ ├── inference # 추론관리
|
||||
│ │ │ │ ├── system # 시스템관리
|
||||
│ │ │ │ └── log # 로그관리
|
||||
│ │ │
|
||||
│ │ │ ├── entity # 공용 JPA 엔티티 (DB 공통 사용)
|
||||
│ │ │ │
|
||||
│ │ │ └── repository # 공용 Repository (DB 공통 인터페이스/구현)
|
||||
│ │ │
|
||||
│ │ └── resources # 설정 및 리소스 파일
|
||||
│ │ ├── application.yml
|
||||
@@ -174,7 +174,6 @@ api-app # 메인 실행 모듈
|
||||
│ └── build.gradle
|
||||
│
|
||||
├── infrastructure-db-postgres # Postgres 전용 설정/확장
|
||||
│ ├── repository # Repository impl 구현
|
||||
│ └── build.gradle
|
||||
│
|
||||
├── build.gradle
|
||||
@@ -215,20 +214,19 @@ DB 관련 로직은 별도의 모듈(infrastructure-db-postgres)로 분리되어
|
||||
|
||||
---
|
||||
|
||||
### 🔄 처리 흐름
|
||||
### 🔄 Database 교체
|
||||
|
||||
Controller → Service → Repository → DB
|
||||
- `api-app/build.gradle`에서 DB 모듈 의존성 변경
|
||||
(`infrastructure-db-postgres` → `infrastructure-db-oracle`)
|
||||
|
||||
---
|
||||
- `application.yml` 또는 DB별 설정 파일(`application-postgres.yml`, `application-oracle.yml`)에서
|
||||
데이터베이스 연결 정보 변경
|
||||
|
||||
### 💡 설계 포인트
|
||||
- 실행 시 profile을 통해 DB 선택
|
||||
|
||||
- API 모듈은 DB 기술에 직접 의존하지 않음
|
||||
- DB 관련 코드는 별도 모듈에서 관리
|
||||
- DB 변경 시 API 코드 수정 최소화
|
||||
```bash
|
||||
# PostgreSQL
|
||||
--spring.profiles.active=postgres
|
||||
|
||||
---
|
||||
|
||||
## 🔥 한 줄 요약
|
||||
|
||||
DB 기술 변경에 유연하게 대응하기 위해 persistence 레이어를 모듈로 분리했습니다.
|
||||
# Oracle
|
||||
--spring.profiles.active=oracle
|
||||
|
||||
Reference in New Issue
Block a user