Skip to content

Commit d912783

Browse files
authored
Merge pull request #224 from CEOS-Developers/dev
version update : dev to main
2 parents 7d0b5bf + 55c6dee commit d912783

7 files changed

Lines changed: 77 additions & 4 deletions

File tree

src/main/java/ceos/backend/domain/application/service/ApplicationService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import ceos.backend.domain.recruitment.domain.Recruitment;
2929
import ceos.backend.domain.recruitment.helper.RecruitmentHelper;
3030
import ceos.backend.domain.recruitment.validator.RecruitmentValidator;
31+
import ceos.backend.global.common.annotation.TransactionLog;
3132
import ceos.backend.global.common.dto.PageInfo;
3233
import ceos.backend.global.common.entity.Part;
3334
import ceos.backend.global.util.InterviewDateTimeConvertor;
@@ -258,6 +259,7 @@ public GetInterviewAvailability getInterviewAvailability(Long applicationId) {
258259

259260

260261
@Transactional
262+
@TransactionLog
261263
public void updateDocumentPassStatus(Long applicationId, UpdatePassStatus updatePassStatus) {
262264
recruitmentValidator.validateBetweenStartDateDocAndResultDateDoc(); // 기간 검증
263265
applicationValidator.validateExistingApplicant(applicationId); // 유저 검증
@@ -267,6 +269,7 @@ public void updateDocumentPassStatus(Long applicationId, UpdatePassStatus update
267269
}
268270

269271
@Transactional
272+
@TransactionLog
270273
public void updateFinalPassStatus(Long applicationId, UpdatePassStatus updatePassStatus) {
271274
recruitmentValidator.validateBetweenResultDateDocAndResultDateFinal(); // 기간 검증
272275
applicationValidator.validateExistingApplicant(applicationId); // 유저 검증

src/main/java/ceos/backend/domain/recruitment/domain/Recruitment.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ public class Recruitment extends BaseEntity {
5555

5656
@NotNull private LocalDate demodayDate;
5757

58+
private LocalDate startMTDate;
59+
60+
private LocalDate endMTDate;
61+
5862
private LocalDateTime applicationExcelCreatedAt;
5963

6064
// 생성자
@@ -75,6 +79,8 @@ private Recruitment(
7579
LocalDate ideathonDate,
7680
LocalDate hackathonDate,
7781
LocalDate demodayDate,
82+
LocalDate startMTDate,
83+
LocalDate endMTDate,
7884
LocalDateTime applicationExcelCreatedAt) {
7985
this.generation = generation;
8086
this.prodStudyUrl = prodStudyUrl;
@@ -91,6 +97,8 @@ private Recruitment(
9197
this.ideathonDate = ideathonDate;
9298
this.hackathonDate = hackathonDate;
9399
this.demodayDate = demodayDate;
100+
this.startMTDate = startMTDate;
101+
this.endMTDate = endMTDate;
94102
this.applicationExcelCreatedAt = applicationExcelCreatedAt;
95103
}
96104

@@ -110,6 +118,8 @@ public void updateRecruitment(RecruitmentDTO recruitmentDTO) {
110118
this.ideathonDate = recruitmentDTO.getIdeathonDate();
111119
this.hackathonDate = recruitmentDTO.getHackathonDate();
112120
this.demodayDate = recruitmentDTO.getDemodayDate();
121+
this.startMTDate = recruitmentDTO.getStartMTDate();
122+
this.endMTDate = recruitmentDTO.getEndMTDate();
113123
}
114124

115125
public void updateApplicationExcelCreatedAt(LocalDateTime createdAt) {

src/main/java/ceos/backend/domain/recruitment/dto/RecruitmentDTO.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public class RecruitmentDTO {
2424
private LocalDate ideathonDate;
2525
private LocalDate hackathonDate;
2626
private LocalDate demodayDate;
27+
private LocalDate startMTDate;
28+
private LocalDate endMTDate;
2729

2830
@Builder
2931
public RecruitmentDTO(
@@ -41,7 +43,9 @@ public RecruitmentDTO(
4143
LocalDate otDate,
4244
LocalDate ideathonDate,
4345
LocalDate hackathonDate,
44-
LocalDate demodayDate) {
46+
LocalDate demodayDate,
47+
LocalDate startMTDate,
48+
LocalDate endMTDate) {
4549
this.generation = generation;
4650
this.prodStudyUrl = prodStudyUrl;
4751
this.designStudyUrl = designStudyUrl;
@@ -57,6 +61,8 @@ public RecruitmentDTO(
5761
this.ideathonDate = ideathonDate;
5862
this.hackathonDate = hackathonDate;
5963
this.demodayDate = demodayDate;
64+
this.startMTDate = startMTDate;
65+
this.endMTDate = endMTDate;
6066
}
6167

6268
public static RecruitmentDTO from(Recruitment recruitment) {
@@ -76,6 +82,8 @@ public static RecruitmentDTO from(Recruitment recruitment) {
7682
.ideathonDate(recruitment.getIdeathonDate())
7783
.hackathonDate(recruitment.getHackathonDate())
7884
.demodayDate(recruitment.getDemodayDate())
85+
.startMTDate(recruitment.getStartMTDate())
86+
.endMTDate(recruitment.getEndMTDate())
7987
.build();
8088
}
8189
}

src/main/java/ceos/backend/domain/recruitment/dto/UserRecruitmentDTO.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public class UserRecruitmentDTO {
2323
private LocalDate ideathonDate;
2424
private LocalDate hackathonDate;
2525
private LocalDate demodayDate;
26+
private LocalDate startMTDate;
27+
private LocalDate endMTDate;
2628

2729
@Builder
2830
public UserRecruitmentDTO(
@@ -39,7 +41,9 @@ public UserRecruitmentDTO(
3941
LocalDate otDate,
4042
LocalDate ideathonDate,
4143
LocalDate hackathonDate,
42-
LocalDate demodayDate) {
44+
LocalDate demodayDate,
45+
LocalDate startMTDate,
46+
LocalDate endMTDate) {
4347
this.generation = generation;
4448
this.prodStudyUrl = prodStudyUrl;
4549
this.designStudyUrl = designStudyUrl;
@@ -54,6 +58,8 @@ public UserRecruitmentDTO(
5458
this.ideathonDate = ideathonDate;
5559
this.hackathonDate = hackathonDate;
5660
this.demodayDate = demodayDate;
61+
this.startMTDate = startMTDate;
62+
this.endMTDate = endMTDate;
5763
}
5864

5965
public static UserRecruitmentDTO from(Recruitment recruitment) {
@@ -72,6 +78,8 @@ public static UserRecruitmentDTO from(Recruitment recruitment) {
7278
.ideathonDate(recruitment.getIdeathonDate())
7379
.hackathonDate(recruitment.getHackathonDate())
7480
.demodayDate(recruitment.getDemodayDate())
81+
.startMTDate(recruitment.getStartMTDate())
82+
.endMTDate(recruitment.getEndMTDate())
7583
.build();
7684
}
7785
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package ceos.backend.global.common.annotation;
2+
3+
import java.lang.annotation.*;
4+
5+
6+
@Target(ElementType.METHOD)
7+
@Retention(RetentionPolicy.RUNTIME)
8+
@Documented
9+
public @interface TransactionLog {
10+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package ceos.backend.global.common.aop;
2+
3+
import lombok.extern.slf4j.Slf4j;
4+
import org.aspectj.lang.ProceedingJoinPoint;
5+
import org.aspectj.lang.annotation.Around;
6+
import org.aspectj.lang.annotation.Aspect;
7+
import org.springframework.stereotype.Component;
8+
import org.springframework.transaction.support.TransactionSynchronizationManager;
9+
10+
11+
@Slf4j
12+
@Aspect
13+
@Component
14+
public class TransactionLoggingAspect {
15+
16+
@Around("@annotation(ceos.backend.global.common.annotation.TransactionLog)")
17+
public Object logTxMethod(ProceedingJoinPoint joinPoint) throws Throwable {
18+
String methodName = joinPoint.getSignature().toShortString();
19+
20+
log.info("[TX START] {}", methodName);
21+
String txName = TransactionSynchronizationManager.getCurrentTransactionName();
22+
log.info("[TX NAME] = {}", txName);
23+
24+
25+
try {
26+
Object result = joinPoint.proceed();
27+
log.info("[TX COMMIT] {}", methodName);
28+
return result;
29+
} catch (Exception e) {
30+
log.warn("[TX ROLLBACK] {} - Exception: {}", methodName, e.getMessage());
31+
throw e;
32+
}
33+
}
34+
}

src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spring:
1010
properties:
1111
hibernate:
1212
# show_sql: true
13-
# format_sql: true
13+
format_sql: true
1414
default_batch_fetch_size: 1000
1515
data:
1616
- secret
@@ -25,4 +25,4 @@ springdoc:
2525

2626
logging.level:
2727
org.hibernate.SQL: debug
28-
# org.hibernate.orm.jdbc.bind: trace
28+
org.hibernate.orm.jdbc.bind: trace

0 commit comments

Comments
 (0)