-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/9oormthon-univ/2024_DANPOON…
- Loading branch information
Showing
6 changed files
with
81 additions
and
1 deletion.
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/jojoidu/book/easy/practice/dto/ProblemListResDto.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.jojoidu.book.easy.practice.dto; | ||
|
||
import java.util.List; | ||
|
||
import com.jojoidu.book.easy.practice.entity.SolveResult; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ProblemListResDto { | ||
@Schema(description = "해결한 문제 목록") | ||
List<ProblemResDto> problems; | ||
|
||
public static ProblemListResDto from(List<SolveResult> problems) { | ||
return new ProblemListResDto(problems.stream().map(ProblemResDto::new).toList()); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/jojoidu/book/easy/practice/dto/ProblemResDto.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,27 @@ | ||
package com.jojoidu.book.easy.practice.dto; | ||
|
||
import java.time.LocalDate; | ||
|
||
import com.jojoidu.book.easy.practice.entity.SolveResult; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public class ProblemResDto { | ||
@Schema(description = "문제 ID", example = "1") | ||
private Long problemId; | ||
@Schema(description = "문제 이름", example = "문제입니다.") | ||
private String problem; | ||
@Schema(description = "문제 완료 날짜", example = "2021-08-01") | ||
private LocalDate solvedDate; | ||
|
||
public ProblemResDto(SolveResult solveResult) { | ||
this.problemId = solveResult.getProblem().getId(); | ||
this.problem = solveResult.getProblem().getProblem(); | ||
this.solvedDate = solveResult.getSolvedDate().toLocalDate(); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/jojoidu/book/easy/practice/repository/SolveResultRepository.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,12 @@ | ||
package com.jojoidu.book.easy.practice.repository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.jojoidu.book.easy.practice.entity.SolveResult; | ||
|
||
public interface SolveResultRepository extends JpaRepository<SolveResult, Long>{ | ||
Optional<List<SolveResult>> findByUserId(Long userId); | ||
} |
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