Skip to content

Commit

Permalink
Merge pull request #184 from Team-INSERT/feat/#183
Browse files Browse the repository at this point in the history
problem에 출처 속성 추가
  • Loading branch information
anys34 authored Oct 6, 2024
2 parents d64a433 + c385932 commit 90ed604
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class Problem extends BaseTimeEntity {

private String title;

private String source;

@Column(columnDefinition = "TEXT")
private String content;

Expand All @@ -34,9 +36,10 @@ public class Problem extends BaseTimeEntity {

private int timeLimit;

public Problem(String title, String content, String inputContent, String outputContent, int level, int memoryLimit, int timeLimit) {
public Problem(String title, String content, String source, String inputContent, String outputContent, int level, int memoryLimit, int timeLimit) {
this.title = title;
this.content = content;
this.source = source;
this.inputContent = inputContent;
this.outputContent = outputContent;
this.level = level;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class SaveProblemRequest {
@NotNull(message = "content가 비어있습니다.")
private String content;

@NotNull(message = "source가 비어있습니다.")
private String source;

@NotNull(message = "inputContent가 비어있습니다.")
private String inputContent;

Expand All @@ -47,7 +50,7 @@ public class SaveProblemRequest {

public Problem toProblem() {
return new Problem(
title, content, inputContent, outputContent, level, memoryLimit, timeLimit
title, content, source, inputContent, outputContent, level, memoryLimit, timeLimit
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ public class ListProblemResponse {
private Long id;
private String title;
private int level;
private String source;

public ListProblemResponse(Problem problem) {
this.id = problem.getId();
this.title = problem.getTitle();
this.level = problem.getLevel();
this.source = problem.getSource();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
public class ProblemResponse {
private String title;
private String content;
private String source;
private String inputContent;
private String outputContent;
private int level;
Expand All @@ -21,6 +22,7 @@ public class ProblemResponse {
public ProblemResponse(Problem problem, List<TestcaseResponse> testcases) {
this.title = problem.getTitle();
this.content = problem.getContent();
this.source = problem.getSource();
this.inputContent = problem.getInputContent();
this.outputContent = problem.getOutputContent();
this.level = problem.getLevel();
Expand Down

0 comments on commit 90ed604

Please sign in to comment.