|
1 | 1 | package org.clokey.domain.coordinate.service; |
2 | 2 |
|
3 | 3 | import java.time.LocalDate; |
| 4 | +import java.time.ZoneId; |
4 | 5 | import java.time.format.DateTimeFormatter; |
5 | 6 | import java.util.*; |
6 | 7 | import java.util.function.Function; |
|
45 | 46 | @Transactional(readOnly = true) |
46 | 47 | public class CoordinateServiceImpl implements CoordinateService { |
47 | 48 |
|
| 49 | + private static final ZoneId KST = ZoneId.of("Asia/Seoul"); |
| 50 | + |
48 | 51 | private final MemberUtil memberUtil; |
49 | 52 |
|
50 | 53 | private final CoordinateRepository coordinateRepository; |
@@ -89,7 +92,7 @@ public CoordinateCreateResponse createDailyCoordinate(DailyCoordinateCreateReque |
89 | 92 | validateExceedingCoordinationClothesLimit(request.payloads()); |
90 | 93 | validateDuplicatedClothes(clothes); |
91 | 94 | validateAllClothesOwnership(currentMember, clothes); |
92 | | - validateDailyCoordinateExist(currentMember.getId(), LocalDate.now()); |
| 95 | + validateDailyCoordinateExist(currentMember.getId(), LocalDate.now(KST)); |
93 | 96 |
|
94 | 97 | Coordinate coordinate = |
95 | 98 | Coordinate.createDailyCoordinate(request.coordinateImageUrl(), currentMember); |
@@ -522,7 +525,7 @@ private Coordinate getCoordinateById(Long coordinateId) { |
522 | 525 |
|
523 | 526 | private Coordinate getTodayDailyCoordinate(Member member) { |
524 | 527 | return coordinateRepository |
525 | | - .findDailyCoordinateByDateAndMemberId(LocalDate.now(), member.getId()) |
| 528 | + .findDailyCoordinateByDateAndMemberId(LocalDate.now(KST), member.getId()) |
526 | 529 | .orElseThrow( |
527 | 530 | () -> |
528 | 531 | new BaseCustomException( |
|
0 commit comments