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 @@ -29,12 +29,12 @@ public record ProblemCreateRequest(
Difficulty difficulty,

@NotNull(message = "메모리 제한을 설정해야 합니다.")
@Schema(description = "메모리 제한", example = "30000")
@Schema(description = "메모리 제한(KB)", example = "30000")
Long memoryLimit,

@NotNull(message = "시간 제한을 설정해야 합니다.")
@Schema(description = "시간 제한", example = "1000.0")
Double timeLimit,
@Schema(description = "시간 제한(ms)", example = "1000")
Long timeLimit,

@NotNull(message = "출처를 명시해야 합니다.")
@Schema(description = "출처", example = "ORIGINAL")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public record ProblemUpdateRequest(
@Schema(description = "난이도", example = "BRONZE")
Difficulty difficulty,

@Schema(description = "메모리 제한", example = "30000")
@Schema(description = "메모리 제한(KB)", example = "30000")
Long memoryLimit,

@Schema(description = "시간 제한", example = "1000.0")
Double timeLimit,
@Schema(description = "시간 제한(ms)", example = "1000")
Long timeLimit,

@Schema(description = "출처", example = "ORIGINAL")
Reference reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public record ProblemDetailResponse(
@Schema(description = "난이도", example = "BRONZE")
String difficulty,

@Schema(description = "메모리 제한", example = "30000")
@Schema(description = "메모리 제한(KB)", example = "30000")
Long memoryLimit,

@Schema(description = "시간 제한", example = "1000.0")
Double timeLimit,
@Schema(description = "시간 제한(ms)", example = "1000")
Long timeLimit,

@Schema(description = "출처", example = "ORIGINAL")
Reference reference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class Problem extends BaseEntity {
private Long memoryLimit;

@Column(nullable = false)
private Double timeLimit;
private Long timeLimit;

@Enumerated(EnumType.STRING)
@Column(nullable = false)
Expand All @@ -72,7 +72,7 @@ public class Problem extends BaseEntity {

@Builder
public Problem(User creator, Category category, String title, String description, int score, String difficulty,
Long memoryLimit, Double timeLimit, Reference reference) {
Long memoryLimit, Long timeLimit, Reference reference) {
this.creator = creator;
this.category = category;
this.title = title;
Expand All @@ -87,7 +87,7 @@ public Problem(User creator, Category category, String title, String description

// 여러개를 하나의 객체로 만드는 것
public static Problem of(User creator, Category category, String title, String description, int score, String difficulty,
Long memoryLimit, Double timeLimit, Reference reference) {
Long memoryLimit, Long timeLimit, Reference reference) {

return Problem.builder()
.creator(creator)
Expand All @@ -104,7 +104,7 @@ public static Problem of(User creator, Category category, String title, String d

// 문제 수정 로직
public void update(User creator, Category category, String title, String description, Difficulty difficulty,
Long memoryLimit, Double timeLimit, Reference reference) {
Long memoryLimit, Long timeLimit, Reference reference) {

if (creator != null) this.creator = creator;
if (category != null) this.category = category;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

@Getter
public enum Difficulty {
BRONZE("브론즈", 20),
SILVER("실버", 40),
GOLD("골드", 60),
PLATINUM("플래티넘", 80),
DIAMOND("다이아", 100);
LV1("1", 10),
LV2("2", 20),
LV3("3", 40),
LV4("4", 80),
LV5("5", 160),
LV6("6", 320),
LV7("7", 640);

private final String difficulty;

Expand Down