Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import ceos.backend.domain.recruitment.domain.Recruitment;
import ceos.backend.domain.recruitment.helper.RecruitmentHelper;
import ceos.backend.domain.recruitment.validator.RecruitmentValidator;
import ceos.backend.global.common.annotation.TransactionLog;
import ceos.backend.global.common.dto.PageInfo;
import ceos.backend.global.common.entity.Part;
import ceos.backend.global.util.InterviewDateTimeConvertor;
Expand Down Expand Up @@ -258,6 +259,7 @@ public GetInterviewAvailability getInterviewAvailability(Long applicationId) {


@Transactional
@TransactionLog
public void updateDocumentPassStatus(Long applicationId, UpdatePassStatus updatePassStatus) {
recruitmentValidator.validateBetweenStartDateDocAndResultDateDoc(); // 기간 검증
applicationValidator.validateExistingApplicant(applicationId); // 유저 검증
Expand All @@ -267,6 +269,7 @@ public void updateDocumentPassStatus(Long applicationId, UpdatePassStatus update
}

@Transactional
@TransactionLog
public void updateFinalPassStatus(Long applicationId, UpdatePassStatus updatePassStatus) {
recruitmentValidator.validateBetweenResultDateDocAndResultDateFinal(); // 기간 검증
applicationValidator.validateExistingApplicant(applicationId); // 유저 검증
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public class Recruitment extends BaseEntity {

@NotNull private LocalDate demodayDate;

private LocalDate startMTDate;

private LocalDate endMTDate;

private LocalDateTime applicationExcelCreatedAt;

// 생성자
Expand All @@ -75,6 +79,8 @@ private Recruitment(
LocalDate ideathonDate,
LocalDate hackathonDate,
LocalDate demodayDate,
LocalDate startMTDate,
LocalDate endMTDate,
LocalDateTime applicationExcelCreatedAt) {
this.generation = generation;
this.prodStudyUrl = prodStudyUrl;
Expand All @@ -91,6 +97,8 @@ private Recruitment(
this.ideathonDate = ideathonDate;
this.hackathonDate = hackathonDate;
this.demodayDate = demodayDate;
this.startMTDate = startMTDate;
this.endMTDate = endMTDate;
this.applicationExcelCreatedAt = applicationExcelCreatedAt;
}

Expand All @@ -110,6 +118,8 @@ public void updateRecruitment(RecruitmentDTO recruitmentDTO) {
this.ideathonDate = recruitmentDTO.getIdeathonDate();
this.hackathonDate = recruitmentDTO.getHackathonDate();
this.demodayDate = recruitmentDTO.getDemodayDate();
this.startMTDate = recruitmentDTO.getStartMTDate();
this.endMTDate = recruitmentDTO.getEndMTDate();
}

public void updateApplicationExcelCreatedAt(LocalDateTime createdAt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class RecruitmentDTO {
private LocalDate ideathonDate;
private LocalDate hackathonDate;
private LocalDate demodayDate;
private LocalDate startMTDate;
private LocalDate endMTDate;

@Builder
public RecruitmentDTO(
Expand All @@ -41,7 +43,9 @@ public RecruitmentDTO(
LocalDate otDate,
LocalDate ideathonDate,
LocalDate hackathonDate,
LocalDate demodayDate) {
LocalDate demodayDate,
LocalDate startMTDate,
LocalDate endMTDate) {
this.generation = generation;
this.prodStudyUrl = prodStudyUrl;
this.designStudyUrl = designStudyUrl;
Expand All @@ -57,6 +61,8 @@ public RecruitmentDTO(
this.ideathonDate = ideathonDate;
this.hackathonDate = hackathonDate;
this.demodayDate = demodayDate;
this.startMTDate = startMTDate;
this.endMTDate = endMTDate;
}

public static RecruitmentDTO from(Recruitment recruitment) {
Expand All @@ -76,6 +82,8 @@ public static RecruitmentDTO from(Recruitment recruitment) {
.ideathonDate(recruitment.getIdeathonDate())
.hackathonDate(recruitment.getHackathonDate())
.demodayDate(recruitment.getDemodayDate())
.startMTDate(recruitment.getStartMTDate())
.endMTDate(recruitment.getEndMTDate())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class UserRecruitmentDTO {
private LocalDate ideathonDate;
private LocalDate hackathonDate;
private LocalDate demodayDate;
private LocalDate startMTDate;
private LocalDate endMTDate;

@Builder
public UserRecruitmentDTO(
Expand All @@ -39,7 +41,9 @@ public UserRecruitmentDTO(
LocalDate otDate,
LocalDate ideathonDate,
LocalDate hackathonDate,
LocalDate demodayDate) {
LocalDate demodayDate,
LocalDate startMTDate,
LocalDate endMTDate) {
this.generation = generation;
this.prodStudyUrl = prodStudyUrl;
this.designStudyUrl = designStudyUrl;
Expand All @@ -54,6 +58,8 @@ public UserRecruitmentDTO(
this.ideathonDate = ideathonDate;
this.hackathonDate = hackathonDate;
this.demodayDate = demodayDate;
this.startMTDate = startMTDate;
this.endMTDate = endMTDate;
}

public static UserRecruitmentDTO from(Recruitment recruitment) {
Expand All @@ -72,6 +78,8 @@ public static UserRecruitmentDTO from(Recruitment recruitment) {
.ideathonDate(recruitment.getIdeathonDate())
.hackathonDate(recruitment.getHackathonDate())
.demodayDate(recruitment.getDemodayDate())
.startMTDate(recruitment.getStartMTDate())
.endMTDate(recruitment.getEndMTDate())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ceos.backend.global.common.annotation;

import java.lang.annotation.*;


@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface TransactionLog {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package ceos.backend.global.common.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import org.springframework.transaction.support.TransactionSynchronizationManager;


@Slf4j
@Aspect
@Component
public class TransactionLoggingAspect {

@Around("@annotation(ceos.backend.global.common.annotation.TransactionLog)")
public Object logTxMethod(ProceedingJoinPoint joinPoint) throws Throwable {
String methodName = joinPoint.getSignature().toShortString();

log.info("[TX START] {}", methodName);
String txName = TransactionSynchronizationManager.getCurrentTransactionName();
log.info("[TX NAME] = {}", txName);


try {
Object result = joinPoint.proceed();
log.info("[TX COMMIT] {}", methodName);
return result;
} catch (Exception e) {
log.warn("[TX ROLLBACK] {} - Exception: {}", methodName, e.getMessage());
throw e;
}
}
}
4 changes: 2 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spring:
properties:
hibernate:
# show_sql: true
# format_sql: true
format_sql: true
default_batch_fetch_size: 1000
data:
- secret
Expand All @@ -25,4 +25,4 @@ springdoc:

logging.level:
org.hibernate.SQL: debug
# org.hibernate.orm.jdbc.bind: trace
org.hibernate.orm.jdbc.bind: trace