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
5 changes: 5 additions & 0 deletions src/main/java/ditda/backend/BackendApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ditda.backend;

import java.util.TimeZone;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
Expand All @@ -15,6 +17,9 @@
public class BackendApplication {

public static void main(String[] args) {

TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));

SpringApplication.run(BackendApplication.class, args);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ditda.backend.domain.auth.service;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

import org.springframework.context.ApplicationEventPublisher;
Expand All @@ -28,7 +27,6 @@
public class DesignerAuthService {

private static final String DEFAULT_PROFILE_IMAGE = "profile/default.png";
private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final DesignerRepository designerRepository;
private final UserService userService;
Expand Down Expand Up @@ -82,7 +80,7 @@ public AuthResult signup(DesignerSignupRequest request, List<String> portfolioKe
user.getName(),
user.getEmail(),
!portfolioKeys.isEmpty(),
LocalDateTime.now(ZONE_KST)
LocalDateTime.now()
));

return new AuthResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

import org.springframework.context.ApplicationEventPublisher;
Expand All @@ -29,8 +28,6 @@
@RequiredArgsConstructor
public class DesignerApplicationFacade {

private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final CommissionService commissionService;
private final DesignerService designerService;
private final ApplicationService applicationService;
Expand Down Expand Up @@ -123,7 +120,7 @@ private void publishMatchedEvent(Commission commission, List<CommissionApplicati
commission.getDesignerCount(),
selected.size(),
commission.getFirstDraftDeadline(),
LocalDateTime.now(ZONE_KST),
LocalDateTime.now(),
toDesignerMatchInfos(selected)
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public record CommissionCreateResponse(
@Schema(description = "최대 수정 횟수", example = "3")
int maxRevision,

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
LocalDateTime createdAt
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;
import java.util.Set;

Expand All @@ -23,7 +22,6 @@
public class CommissionDeadlineService {

private static final int MAIL_DISPATCH_HOUR = 9;
private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final CommissionRepository commissionRepository;
private final ApplicationDeadlineProcessor applicationDeadlineProcessor;
Expand All @@ -32,7 +30,7 @@ public class CommissionDeadlineService {

public void processApplicationDeadlines() {

LocalDate today = LocalDate.now(ZONE_KST);
LocalDate today = LocalDate.now();

// 메일 전송 시간
LocalDateTime mailScheduledAt = today.atTime(MAIL_DISPATCH_HOUR, 0);
Expand All @@ -56,7 +54,7 @@ public void processApplicationDeadlines() {

public void processFirstDraftDeadlines() {

LocalDate today = LocalDate.now(ZONE_KST);
LocalDate today = LocalDate.now();

// 메일 전송 시간
LocalDateTime mailScheduledAt = today.atTime(MAIL_DISPATCH_HOUR, 0);
Expand All @@ -80,7 +78,7 @@ public void processFirstDraftDeadlines() {

public void processFinalDeadlines() {

LocalDate today = LocalDate.now(ZONE_KST);
LocalDate today = LocalDate.now();

// 메일 전송 시간
LocalDateTime mailScheduledAt = today.atTime(MAIL_DISPATCH_HOUR, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public record DraftSelectResponse(
@Schema(description = "남은 수정 횟수", example = "3")
int remainingRevisionCount,

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
LocalDateTime selectedAt

) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public record DraftSubmitResponse(
Long draftId,

@Schema(description = "제출 시각", example = "2026-05-15 12:30:00")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
LocalDateTime submittedAt
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ditda.backend.domain.commission.draft.facade;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

import org.springframework.context.ApplicationEventPublisher;
Expand All @@ -27,8 +26,6 @@
@RequiredArgsConstructor
public class DesignerDraftFacade {

private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final CommissionService commissionService;
private final DesignerDraftService designerDraftService;
private final DesignerDraftFileService designerDraftFileService;
Expand Down Expand Up @@ -111,7 +108,7 @@ private void publishAllFirstDraftsSubmittedEvent(Long commissionId) {
commission.getInstructor().getUser().getEmail(),
commission.getInstructor().getName(),
(int)submittedCount,
LocalDateTime.now(ZONE_KST)
LocalDateTime.now()
));

log.info("모든 1차 시안 제출 완료. commissionId={}, submittedCount={}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ditda.backend.domain.commission.draft.facade;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

import org.springframework.context.ApplicationEventPublisher;
Expand Down Expand Up @@ -31,8 +30,6 @@
@RequiredArgsConstructor
public class InstructorDraftFacade {

private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final InstructorCommissionService instructorCommissionService;
private final InstructorDraftService instructorDraftService;
private final DraftQueryService draftQueryService;
Expand Down Expand Up @@ -71,7 +68,7 @@ public DraftSelectResponse selectDraft(Long instructorId, Long commissionId, Lon
applyDesignerSelection(commission, applications, selected, now);

// 이벤트 발행
LocalDateTime mailScheduledAt = LocalDateTime.now(ZONE_KST);
LocalDateTime mailScheduledAt = LocalDateTime.now();
publishRejectedPayoutEvent(commission, rejected, mailScheduledAt);
publishDraftSelectedEvent(commission, selected, rejected, mailScheduledAt);

Expand Down Expand Up @@ -193,7 +190,7 @@ public void finalizeDraft(Long instructorId, Long commissionId, Long draftId) {
Designer assigned = latestDraft.getCommissionApplication().getDesigner();
assigned.gainCommissionCompletedReward();

LocalDateTime mailScheduledAt = LocalDateTime.now(ZONE_KST);
LocalDateTime mailScheduledAt = LocalDateTime.now();

publishPayoutRequestedEvent(commission, assigned, mailScheduledAt);
publishCommissionCompletedEvent(commission, assigned, mailScheduledAt);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ditda.backend.domain.commission.revision.facade;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

import org.springframework.context.ApplicationEventPublisher;
Expand Down Expand Up @@ -38,8 +37,6 @@
@Slf4j
public class DesignerRevisionFacade {

private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final DesignerCommissionService designerCommissionService;
private final DraftQueryService draftQueryService;
private final RevisionQueryService revisionQueryService;
Expand Down Expand Up @@ -160,7 +157,7 @@ private void publishRevisionSubmittedEvent(Commission commission, int currentRev
commission.getInstructor().getUser().getEmail(),
commission.getInstructor().getName(),
currentRevisionCount,
LocalDateTime.now(ZONE_KST)
LocalDateTime.now()
));
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ditda.backend.domain.commission.revision.facade;

import java.time.LocalDateTime;
import java.time.ZoneId;

import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;
Expand All @@ -28,8 +27,6 @@
@Transactional(readOnly = true)
public class InstructorRevisionFacade {

private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final InstructorCommissionService instructorCommissionService;
private final RevisionQueryService revisionQueryService;
private final InstructorRevisionService instructorRevisionService;
Expand Down Expand Up @@ -128,7 +125,7 @@ private void publishRevisionRequestedEvent(Commission commission, int currentRev
designerUser.getEmail(),
designerUser.getName(),
currentRevisionCount,
LocalDateTime.now(ZONE_KST)
LocalDateTime.now()
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public record DepositNotifyResponse(
PaymentStatus status,

@Schema(description = "입금 통보 시각", example = "2026-05-26 15:30:00")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
LocalDateTime depositNotifiedAt
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ditda.backend.domain.payment.service;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
Expand All @@ -27,8 +26,6 @@
@RequiredArgsConstructor
public class PaymentService {

private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final PaymentRepository paymentRepository;
private final ApplicationEventPublisher eventPublisher;
private final TermService termService;
Expand Down Expand Up @@ -80,7 +77,7 @@ public DepositNotifyResponse notifyDeposit(Long instructorId, Long commissionId)
payment.getDepositorName(),
payment.getAmount(),
payment.getDepositNotifiedAt(),
LocalDateTime.now(ZONE_KST)
LocalDateTime.now()
));

return DepositNotifyResponse.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ApiResponse<T> {
@JsonProperty("error")
private final Object error;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private final LocalDateTime timestamp;

// result가 있는 성공 응답
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ditda.backend.global.notification;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

import org.springframework.data.domain.Limit;
Expand All @@ -17,14 +16,13 @@
public class NotificationOutboxScheduler {

private static final int BATCH_SIZE = 100;
private static final ZoneId ZONE_KST = ZoneId.of("Asia/Seoul");

private final NotificationOutboxRepository outboxRepository;
private final EmailSender emailSender;

@Scheduled(cron = "0 */10 * * * *", zone = "Asia/Seoul")
public void dispatchPendingNotifications() {
LocalDateTime now = LocalDateTime.now(ZONE_KST);
LocalDateTime now = LocalDateTime.now();

List<NotificationOutbox> pendingAlerts = outboxRepository.findPendingScheduled(
OutboxStatus.PENDING,
Expand Down