Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
ea570b4
build.gradle수정
pilltong22 Jan 2, 2026
8bd8d37
@JsonIgnore 주석 해제
pilltong22 Jan 2, 2026
54e92af
재트리거
pilltong22 Jan 2, 2026
7684a03
plain jar 생성 비활성화 (bootJar만 생성)
pilltong22 Jan 2, 2026
3c1dc7c
Procfile 추가
pilltong22 Jan 2, 2026
018879e
fix: 프론트엔드 ALB 주소 CORS 허용
pilltong22 Jan 2, 2026
e74e7a1
Update CorsConfig.java
pilltong22 Jan 3, 2026
9d718b4
Merge branch 'develop'
pilltong22 Jan 4, 2026
b43463c
develop 머지
pilltong22 Jan 4, 2026
e20bf3a
재배포
pilltong22 Jan 5, 2026
ffd658e
Merge branch 'main' of https://github.com/Team-WERP/SERO-Backend
pilltong22 Jan 5, 2026
0d236a2
codeDeploy 설정, Agent 추가
pilltong22 Jan 5, 2026
292b617
Merge branch 'develop'
rosieisor Jan 5, 2026
3fd1e3a
test: CodeDeploy 권한 추가 후 재배포
pilltong22 Jan 5, 2026
ca017e6
문법 오류 수정
pilltong22 Jan 5, 2026
3fb5363
재배포
pilltong22 Jan 5, 2026
ec653dc
헬스체크 시간 증가
pilltong22 Jan 5, 2026
95e3bd0
Update start.sh
pilltong22 Jan 5, 2026
fa0b17c
Update health-check.sh
pilltong22 Jan 5, 2026
4dff69f
debug: ValidateService 임시 비활성화
pilltong22 Jan 5, 2026
6195604
재배포
pilltong22 Jan 5, 2026
b6864fa
SecurityConfig 파일 헬스체크용 경로 허용
pilltong22 Jan 5, 2026
83cc7d3
재배포
pilltong22 Jan 5, 2026
05ccf69
로드 밸런서 일시 해제
pilltong22 Jan 5, 2026
0a2c01f
재배포 트리거
pilltong22 Jan 5, 2026
68d6a2a
운영 도메인(sero-erp.cloud) CORS 허용 설정 추가
pilltong22 Jan 6, 2026
1f5b7ac
재배포 -elasticbeanstalk로 전환(백엔드)
pilltong22 Jan 6, 2026
68f3721
deploy.yml 수정
pilltong22 Jan 6, 2026
a0a2c06
deploy 재수정
pilltong22 Jan 6, 2026
d1b18df
또또 수정 deploy
pilltong22 Jan 6, 2026
e4dc4e5
포트 8080으로 변경
pilltong22 Jan 6, 2026
198be15
RDS_HOSTNAME -변경
pilltong22 Jan 6, 2026
0ff0954
재배포
pilltong22 Jan 6, 2026
39d6541
Fix: Nginx 설정 포함한 ZIP 배포 패키지로 변경
pilltong22 Jan 6, 2026
7f36378
재배포
pilltong22 Jan 6, 2026
ff96a70
재배포 (환경변수 새로 생성)
pilltong22 Jan 6, 2026
2e85c5d
버전명 수정
pilltong22 Jan 6, 2026
3eb9a61
dto에 imageUrl 추가
pilltong22 Jan 6, 2026
4636ea5
fix: 배포된 애플리케이션에서 s3 다운 안되는 문제
pilltong22 Jan 6, 2026
0cde783
DTO 재수정
pilltong22 Jan 6, 2026
543450c
feat: force redeploy to fix imageUrl issue
pilltong22 Jan 6, 2026
dc6e194
debug: add logging to diagnose imageUrl issue
pilltong22 Jan 6, 2026
a0a5576
재배포
pilltong22 Jan 6, 2026
6ee0ab0
debug: use System.out.println for debugging imageUrl
pilltong22 Jan 6, 2026
2d75f36
debug: add more field checks to diagnose ResultMap issue
pilltong22 Jan 6, 2026
2f7f00e
fix: add AS imageUrl alias in SQL query for explicit column mapping
pilltong22 Jan 6, 2026
b70c748
fix: add AS imageUrl alias to all SQL queries (findById, findByIdWith…
pilltong22 Jan 6, 2026
162c3e6
debug: enable MyBatis SQL logging to see actual query results
pilltong22 Jan 6, 2026
bcf6fa9
수정: ResultMap의 imageUrl 컬럼 매핑을 image_url에서 imageUrl로 변경하여 SQL AS 별칭과 …
pilltong22 Jan 6, 2026
0ca2e3e
fix: #192 - 결재 기안 상신 시, LazyInitializationException 에러 수정
rosieisor Jan 7, 2026
63ff139
Merge pull request #193 from Team-WERP/fix/192-approval
rosieisor Jan 7, 2026
39af9bd
Merge branch 'develop'
ghi512 Jan 7, 2026
331cfab
Merge branch 'main' of https://github.com/Team-WERP/SERO-Backend
ghi512 Jan 7, 2026
7e26d1b
fix: #194 - 공지사항 등록 시, LazyInitializationException 에러 수정
rosieisor Jan 7, 2026
a847b98
Merge pull request #195 from Team-WERP/fix/194-notice
rosieisor Jan 7, 2026
81d0ca1
Merge branch 'develop'
ghi512 Jan 7, 2026
3c2d35f
Merge branch 'develop'
HoodRyan Jan 7, 2026
41156ed
fix: #198 - Employee 조회 시 department LAZY 로딩 문제 해결 (fetch join 적용)
rosieisor Jan 7, 2026
3f6dfe4
Merge pull request #199 from Team-WERP/fix/198-employee-fetch-join
rosieisor Jan 7, 2026
31c5380
Merge branch 'develop'
HoodRyan Jan 7, 2026
e97f069
Merge branch 'develop'
YujinJeong1006 Jan 7, 2026
cae568e
fix: #204 - 쿠키 옵션 수정(sameSite를 Lax, secure를 false로 수정) join 적용
rosieisor Jan 7, 2026
7f9ab34
Merge pull request #205 from Team-WERP/fix/204-cookie
rosieisor Jan 7, 2026
c63db56
Merge branch 'develop'
ghi512 Jan 7, 2026
9567ac3
jwt 토큰 만료시간 수정 확인
pilltong22 Jan 7, 2026
b6a5153
Merge branch 'develop'
ghi512 Jan 7, 2026
1079fd2
Merge branch 'develop'
YujinJeong1006 Jan 8, 2026
0e3a3cd
Merge branch 'main' of https://github.com/Team-WERP/SERO-Backend
YujinJeong1006 Jan 8, 2026
2ed4cca
Merge branch 'develop'
YujinJeong1006 Jan 8, 2026
9eae23b
Merge branch 'develop'
YujinJeong1006 Jan 8, 2026
b66a056
Merge branch 'develop'
YujinJeong1006 Jan 8, 2026
4d6985f
chore: HTTPS 적용에 따른 CORS 설정 및 쿠키 옵션 수정
rosieisor Jan 8, 2026
c27a880
Merge branch 'main' of https://github.com/Team-WERP/SERO-Backend
rosieisor Jan 8, 2026
b0d8dbb
fix: CORS 설정 수정
rosieisor Jan 8, 2026
32a9b85
whitelist 추가 (다 허용)
pilltong22 Jan 8, 2026
2a6b297
CookieUtil.java수정
pilltong22 Jan 8, 2026
7c4a6c5
ci-cd test
pilltong22 Mar 16, 2026
d0d34d5
Merge branch 'main' into refact/new-ci-cd
pilltong22 Mar 16, 2026
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
Binary file added .DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions .ebextensions/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
files:
"/sbin/appstart" :
mode: "000755"
owner: webapp
group: webapp
content: |
#!/usr/bin/env bash
JAR_PATH=/var/app/current/application.jar

# run app
killall java
java -Dfile.encoding=UTF-8 -jar $JAR_PATH
54 changes: 54 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy to ECS

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Build JAR
run: ./gradlew build -x test

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v1

- name: Build Docker Image
run: docker build -t sero-backend .

- name: Tag Docker Image
run: |
docker tag sero-backend:latest \
${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/sero-backend:latest

- name: Push Docker Image
run: |
docker push \
${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/sero-backend:latest

- name: Deploy to ECS
run: |
aws ecs update-service \
--cluster sero-cluster-new \
--service sero-task-n-service-ksz4njy2 \
--force-new-deployment
59 changes: 59 additions & 0 deletions .platform/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 33282;

events {
use epoll;
worker_connections 1024;
multi_accept on;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

include conf.d/*.conf;

map $http_upgrade $connection_upgrade {
default "upgrade";
}

upstream springboot {
server 127.0.0.1:8080; // 8080번으로 돌고 있는 백엔드 서버를 인지해라!
keepalive 1024;
}

server {
listen 80 default_server;
listen [::]:80 default_server;

location / {
proxy_pass http://springboot;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; // 로그분석 (어디서 유입, 차단하고 싶은 사람)
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
}

access_log /var/log/nginx/access.log main;

client_header_timeout 60;
client_body_timeout 60;
keepalive_timeout 60;
gzip off;

# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/healthd.conf;
}
}
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM eclipse-temurin:17-jre

WORKDIR /app

COPY build/libs/*.jar app.jar

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "app.jar"]
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: java -jar application.jar
34 changes: 34 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/ec2-user/app/
overwrite: yes

permissions:
- object: /
pattern: "**"
owner: ec2-user
group: ec2-user

hooks:
BeforeInstall:
- location: scripts/stop.sh
timeout: 60
runas: ec2-user

AfterInstall:
- location: scripts/set-permissions.sh
timeout: 60
runas: ec2-user

ApplicationStart:
- location: scripts/start.sh
timeout: 120
runas: ec2-user

# ValidateService 임시 비활성화 (디버깅용)
# ValidateService:
# - location: scripts/health-check.sh
# timeout: 180
# runas: ec2-user
17 changes: 14 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ repositories {
dependencies {
/* Spring boot */
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

/* Mybatis */
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.5'

./gradlew clean build -x test
/* JPA */
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

Expand All @@ -39,8 +40,8 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'

/* Database */
// runtimeOnly 'com.mysql:mysql-connector-j'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
runtimeOnly 'com.mysql:mysql-connector-j'
// runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'

/* Swagger OpenAPI */
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.14'
Expand Down Expand Up @@ -76,4 +77,14 @@ dependencies {

tasks.named('test') {
useJUnitPlatform()
}

// plain jar 생성 비활성화 (bootJar만 생성)
jar {
enabled = false
}

// bootJar 파일명을 application.jar로 설정
bootJar {
archiveFileName = 'application.jar'
}
Empty file modified gradlew
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
}
rootProject.name = 'sero'
Binary file added src/.DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions src/main/java/com/werp/sero/HealthCheckController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.werp.sero;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HealthCheckController {

@GetMapping("/")
public ResponseEntity<String> health() {
return ResponseEntity.ok("OK");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ApprovalCommandController {

@Operation(summary = "결재 상신")
@PostMapping(consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
public ResponseEntity<ApprovalResponseDTO> submitForApproval(@CurrentUser final Employee employee,
public ResponseEntity<ApprovalResponseDTO> submitForApproval(@CurrentUser Employee employee,
@Valid @RequestPart(name = "requestDTO") final ApprovalCreateRequestDTO requestDTO,
@RequestPart(name = "files", required = false) final List<MultipartFile> files) {
return ResponseEntity.ok(approvalCommandService.submitForApproval(employee, requestDTO, files));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.List;

public interface ApprovalCommandService {
ApprovalResponseDTO submitForApproval(final Employee employee, final ApprovalCreateRequestDTO requestDTO,
ApprovalResponseDTO submitForApproval(Employee employee, final ApprovalCreateRequestDTO requestDTO,
final List<MultipartFile> files);

void approve(final Employee employee, final int approvalId, final ApprovalDecisionRequestDTO requestDTO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class ApprovalCommandServiceImpl implements ApprovalCommandService {

@Transactional
@Override
public ApprovalResponseDTO submitForApproval(final Employee employee, final ApprovalCreateRequestDTO requestDTO,
public ApprovalResponseDTO submitForApproval(Employee employee, final ApprovalCreateRequestDTO requestDTO,
final List<MultipartFile> files) {
validateDuplicateApproval(requestDTO.getRefCode());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public BusinessException(final ErrorCode errorCode) {
public BusinessException(final ErrorCode errorCode, final String message) {
super(message);
this.errorCode = errorCode;


}


Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/werp/sero/config/AsyncConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
@EnableAsync
@Configuration
public class AsyncConfig {

}
13 changes: 12 additions & 1 deletion src/main/java/com/werp/sero/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@

import java.util.List;

//
@Configuration
public class CorsConfig {
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();

configuration.setAllowedOrigins(List.of("http://localhost:5173"));
configuration.setAllowedOrigins(List.of(
"http://localhost:5173",
"https://localhost:5173",
"http://sero-f-alb-2092902385.ap-northeast-2.elb.amazonaws.com",
"https://sero-f-alb-2092902385.ap-northeast-2.elb.amazonaws.com",
"https://sero-erp.cloud",
"http://sero-erp.cloud",
"http://api.sero-erp.cloud",
"https://api.sero-erp.cloud"
));

configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
configuration.setAllowedHeaders(List.of("*"));
configuration.setAllowCredentials(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.werp.sero.employee.command.domain.aggregate;

import com.fasterxml.jackson.annotation.JsonIgnore; // [추가] JSON 변환 시 순환참조 방지
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -9,6 +10,7 @@
@NoArgsConstructor
@Entity
public class Employee {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
Expand Down Expand Up @@ -43,7 +45,7 @@ public class Employee {
@Column(name = "created_at", nullable = false)
private String createdAt;

@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "dept_id")
private Department department;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import com.werp.sero.employee.command.domain.aggregate.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Optional;

public interface EmployeeRepository extends JpaRepository<Employee, Integer> {
Optional<Employee> findByEmailAndStatus(final String email, final String status);
@Query("SELECT e FROM Employee e LEFT JOIN FETCH e.department WHERE e.email = :email AND e.status = :status")
Optional<Employee> findByEmailAndStatusWithFetchJoin(final String email, final String status);

List<Employee> findByIdIn(final List<Integer> employeeIds);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class MaterialListResponseDTO {
private String status;
private String baseUnit;
private Long unitPrice;
private String imageUrl;
private int safetyStock;
private Integer cycleTime;
private Integer rawMaterialCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.werp.sero.material.query.dto.MaterialListResponseDTO;
import com.werp.sero.material.query.dto.MaterialWithBomResponseDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand All @@ -17,6 +18,7 @@
/**
* 자재 Query Service 구현체 (조회 전용)
*/
@Slf4j
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
Expand Down Expand Up @@ -45,7 +47,22 @@ public List<MaterialListResponseDTO> getMaterialList(
}

// 3. 자재 목록 조회
return materialMapper.findByCondition(type, status, keyword);
System.out.println("===== DEBUG: Before MyBatis query =====");
List<MaterialListResponseDTO> results = materialMapper.findByCondition(type, status, keyword);
System.out.println("===== DEBUG: After MyBatis query =====");

// DEBUG: imageUrl 확인
if (!results.isEmpty()) {
System.out.println("===== DEBUG: Material imageUrl check =====");
System.out.println("First material ID: " + results.get(0).getId());
System.out.println("First material name: " + results.get(0).getName());
System.out.println("First material imageUrl: " + results.get(0).getImageUrl());
System.out.println("First material spec: " + results.get(0).getSpec());
System.out.println("First material baseUnit: " + results.get(0).getBaseUnit());
System.out.println("==========================================");
}

return results;
}

@Override
Expand Down
Loading