-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
159 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/com/moabam/api/domain/item/repository/BugHistoryDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.moabam.api.domain.item.repository; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import com.moabam.api.domain.bug.BugActionType; | ||
import com.moabam.api.domain.bug.BugType; | ||
import com.moabam.api.domain.payment.Payment; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record BugHistoryDto( | ||
Long id, | ||
BugType bugType, | ||
BugActionType actionType, | ||
int quantity, | ||
LocalDateTime createdAt, | ||
Payment payment | ||
|
||
) { | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/moabam/api/dto/bug/BugHistoryItemResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.moabam.api.dto.bug; | ||
|
||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.*; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record BugHistoryItemResponse( | ||
Long id, | ||
String bugType, | ||
String actionType, | ||
int quantity, | ||
String date, | ||
@JsonInclude(NON_NULL) PaymentResponse payment | ||
|
||
) { | ||
|
||
@Builder | ||
public record PaymentResponse( | ||
Long id, | ||
String orderName, | ||
int discountAmount, | ||
int totalAmount | ||
) { | ||
|
||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/moabam/api/dto/bug/BugHistoryResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.moabam.api.dto.bug; | ||
|
||
import java.util.List; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record BugHistoryResponse( | ||
|
||
List<BugHistoryItemResponse> history | ||
) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/com/moabam/global/common/util/DateUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.moabam.global.common.util; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public final class DateUtils { | ||
|
||
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
|
||
public static String format(LocalDateTime dateTime) { | ||
return dateTime.format(formatter); | ||
} | ||
} |