Skip to content

Commit

Permalink
[SVR-79] 어드민 ZonedDateTime로 수정 (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
0703kyj authored Jan 6, 2025
1 parent 7d22ca1 commit dc1b057
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.List;

public record CustomPageResponse<T>(
List<T> content ,
List<T> content,
int pageNumber,
int pageSize,
boolean first,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
import com.uket.app.admin.api.dto.LiveEnterUserDto;
import com.uket.domain.ticket.enums.TicketStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public record LiveEnterUserResponse(
@Schema(description = "입장 시간")
LocalDateTime enterTime,
ZonedDateTime enterTime,

@Schema(description = "입금자명")
@Mask(type = MaskingType.NAME)
String name,

@Schema(description = "티켓 날짜")
LocalDateTime ticketDate,
ZonedDateTime ticketDate,

@Schema(description = "전화번호")
@Mask(type = MaskingType.PHONE)
Expand All @@ -26,12 +27,13 @@ public record LiveEnterUserResponse(
@Schema(description = "티켓 상태")
TicketStatus ticketStatus
) {
private static final String zoneId = "Asia/Seoul";

public static LiveEnterUserResponse from(LiveEnterUserDto liveEnterUserDto) {
return new LiveEnterUserResponse(
liveEnterUserDto.enterTime(),
liveEnterUserDto.enterTime().atZone(ZoneId.of(zoneId)),
liveEnterUserDto.name(),
liveEnterUserDto.ticketDate(),
liveEnterUserDto.ticketDate().atZone(ZoneId.of(zoneId)),
liveEnterUserDto.phoneNumber(),
liveEnterUserDto.ticketStatus()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.uket.app.admin.api.enums.MaskingType;
import com.uket.app.admin.api.aop.Mask;
import com.uket.domain.ticket.dto.CheckTicketDto;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import lombok.Builder;

import java.time.LocalDateTime;
Expand All @@ -16,21 +18,22 @@ public record TicketResponse(
String depositorName,
@Mask(type = MaskingType.PHONE)
String telephone,
LocalDateTime showTime,
LocalDateTime orderDate,
LocalDateTime updatedDate,
ZonedDateTime showTime,
ZonedDateTime orderDate,
ZonedDateTime updatedDate,
String ticketStatus,
String userType
) {
private static final String zoneId = "Asia/Seoul";

public static TicketResponse from(CheckTicketDto checkTicketDto) {
return TicketResponse.builder()
.ticketId(checkTicketDto.ticketId())
.depositorName(checkTicketDto.userName())
.telephone(checkTicketDto.phoneNumber())
.showTime(checkTicketDto.showStartDate())
.orderDate(checkTicketDto.createdAt())
.updatedDate(checkTicketDto.updatedAt())
.showTime(checkTicketDto.showStartDate().atZone(ZoneId.of(zoneId)))
.orderDate(checkTicketDto.createdAt().atZone(ZoneId.of(zoneId)))
.updatedDate(checkTicketDto.updatedAt().atZone(ZoneId.of(zoneId)))
.ticketStatus(checkTicketDto.ticketStatus())
.userType(checkTicketDto.userType())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.uket.domain.form.dto.FormAnswerDto;
import com.uket.domain.ticket.dto.CheckTicketDto;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import lombok.Builder;

Expand All @@ -19,22 +21,23 @@ public record TicketingResponse(
String depositorName,
@Mask(type = MaskingType.PHONE)
String telephone,
LocalDateTime showTime,
LocalDateTime orderDate,
LocalDateTime updatedDate,
ZonedDateTime showTime,
ZonedDateTime orderDate,
ZonedDateTime updatedDate,
String ticketStatus,
String userType,
List<FormAnswerDto> formAnswers
) {
private static final String zoneId = "Asia/Seoul";

public static TicketingResponse from(CheckTicketingDto checkTicketingDto) {
return TicketingResponse.builder()
.ticketId(checkTicketingDto.ticket().ticketId())
.depositorName(checkTicketingDto.ticket().userName())
.telephone(checkTicketingDto.ticket().phoneNumber())
.showTime(checkTicketingDto.ticket().showStartDate())
.orderDate(checkTicketingDto.ticket().createdAt())
.updatedDate(checkTicketingDto.ticket().updatedAt())
.showTime(checkTicketingDto.ticket().showStartDate().atZone(ZoneId.of(zoneId)))
.orderDate(checkTicketingDto.ticket().createdAt().atZone(ZoneId.of(zoneId)))
.updatedDate(checkTicketingDto.ticket().updatedAt().atZone(ZoneId.of(zoneId)))
.ticketStatus(checkTicketingDto.ticket().ticketStatus())
.userType(checkTicketingDto.ticket().userType())
.formAnswers(checkTicketingDto.formAnswers())
Expand Down

0 comments on commit dc1b057

Please sign in to comment.