ESG 프로젝트의 Scope 1, 2 온실가스 배출량 계산 및 관리를 위한 마이크로서비스입니다.
본 서비스는 다음과 같은 기능을 제공합니다:
- 고정연소: 사업장 내 보일러, 발전기 등의 연료 연소
- 이동연소: 차량, 건설기계 등의 연료 연소
- 전력 사용: 구매 전력 사용에 따른 간접 배출
- 스팀 사용: 구매 스팀 사용에 따른 간접 배출
- Framework: Spring Boot 3.5.0
- Language: Java 17
- Database: MySQL 8.0
- ORM: Spring Data JPA
- Build Tool: Gradle
- Service Discovery: Netflix Eureka
- Documentation: Swagger/OpenAPI
scope-service/
├── entity/ # 데이터베이스 엔티티
├── repository/ # 데이터 접근 계층
├── service/ # 비즈니스 로직
├── controller/ # REST API 엔드포인트
├── dto/ # 데이터 전송 객체
├── config/ # 설정 클래스
└── exception/ # 예외 처리
FuelType: 연료 타입 (경유, 휘발유, LNG 등)CalorificValue: 연료별 발열량EmissionFactor: 연료별 온실가스 배출계수
StationaryCombustion: Scope 1 고정연소 데이터MobileCombustion: Scope 1 이동연소 데이터ElectricityUsage: Scope 2 전력 사용 데이터SteamUsage: Scope 2 스팀 사용 데이터
배출량 = 연료사용량 × 발열량 × 배출계수 × GWP
- CO2: 직접 배출
- CH4: 배출량 × 25 (GWP)
- N2O: 배출량 × 298 (GWP)
배출량 = 전력사용량(kWh) × 배출계수(tCO2/MWh) ÷ 1000
POST /api/v1/scope/stationary-combustion- 데이터 등록GET /api/v1/scope/stationary-combustion- 목록 조회GET /api/v1/scope/stationary-combustion/year/{year}- 연도별 조회PUT /api/v1/scope/stationary-combustion/{id}- 수정DELETE /api/v1/scope/stationary-combustion/{id}- 삭제
POST /api/v1/scope/electricity-usage- 데이터 등록GET /api/v1/scope/electricity-usage- 목록 조회GET /api/v1/scope/electricity-usage/year/{year}- 연도별 조회PUT /api/v1/scope/electricity-usage/{id}- 수정DELETE /api/v1/scope/electricity-usage/{id}- 삭제
# MySQL 데이터베이스 생성
CREATE DATABASE esg_scope CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;# 빌드 및 실행
./gradlew clean build
./gradlew bootRun- Health Check: http://localhost:8080/actuator/health
- API 테스트: http://localhost:8080/api/v1/scope/stationary-combustion