-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[REFACTOR] 코드를 수정할 때 입력한 코드를 저장하는 API 추가 및 스웨거 설명 추가
- Loading branch information
Showing
23 changed files
with
239 additions
and
81 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
16 changes: 0 additions & 16 deletions
16
src/main/java/swm_nm/morandi/domain/practice/dto/PracticeIdDto.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
src/main/java/swm_nm/morandi/domain/practice/dto/PracticeProblemCode.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 swm_nm.morandi.domain.practice.dto; | ||
|
||
import lombok.*; | ||
|
||
@Getter @Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class PracticeProblemCode { | ||
private String pythonCode; | ||
private String cppCode; | ||
private String javaCode; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/swm_nm/morandi/domain/practice/dto/PracticeProblemInfo.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,11 @@ | ||
package swm_nm.morandi.domain.practice.dto; | ||
|
||
import lombok.*; | ||
|
||
@Getter @Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class PracticeProblemInfo { | ||
private Long practiceProblemId; | ||
} |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/swm_nm/morandi/domain/practice/dto/PracticeStartResponseDto.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,24 @@ | ||
package swm_nm.morandi.domain.practice.dto; | ||
|
||
import lombok.*; | ||
import swm_nm.morandi.domain.testDuring.dto.PracticeProblemCodeDto; | ||
|
||
@Getter @Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class PracticeStartResponseDto { | ||
private Long practiceProblemId; | ||
private String pythonCode; | ||
private String javaCode; | ||
private String cppCode; | ||
public static PracticeStartResponseDto getPracticeStartResponseDto | ||
(Long practiceProblemId, PracticeProblemCodeDto practiceProblemCodeDto) { | ||
return PracticeStartResponseDto.builder() | ||
.practiceProblemId(practiceProblemId) | ||
.pythonCode(practiceProblemCodeDto.getPythonCode()) | ||
.javaCode(practiceProblemCodeDto.getJavaCode()) | ||
.cppCode(practiceProblemCodeDto.getCppCode()) | ||
.build(); | ||
} | ||
} |
5 changes: 0 additions & 5 deletions
5
src/main/java/swm_nm/morandi/domain/practice/dto/PracticeStatus.java
This file was deleted.
Oops, something went wrong.
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
28 changes: 28 additions & 0 deletions
28
src/main/java/swm_nm/morandi/domain/practice/service/PracticeCheckService.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,28 @@ | ||
package swm_nm.morandi.domain.practice.service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.stereotype.Service; | ||
import swm_nm.morandi.domain.practice.dto.PracticeProblemInfo; | ||
import swm_nm.morandi.domain.practice.entity.PracticeProblem; | ||
import swm_nm.morandi.domain.practice.repository.PracticeProblemRepository; | ||
import swm_nm.morandi.global.exception.MorandiException; | ||
import swm_nm.morandi.global.exception.errorcode.PracticeProblemErrorCode; | ||
import swm_nm.morandi.redis.utils.RedisKeyGenerator; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class PracticeCheckService { | ||
|
||
private final RedisKeyGenerator redisKeyGenerator; | ||
|
||
private final RedisTemplate<String, Object> redisTemplate; | ||
public PracticeProblemInfo getPracticeProblemInfo(Long bojProblemId) { | ||
String ongoingPracticeProblemKey = redisKeyGenerator.generateOngoingPracticeProblemKey(bojProblemId); | ||
PracticeProblemInfo practiceProblemInfo | ||
= (PracticeProblemInfo) redisTemplate.opsForValue().get(ongoingPracticeProblemKey); | ||
return practiceProblemInfo; | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
src/main/java/swm_nm/morandi/domain/testDuring/dto/PracticeProblemCodeDto.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,20 @@ | ||
package swm_nm.morandi.domain.testDuring.dto; | ||
|
||
import lombok.*; | ||
|
||
@Getter @Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class PracticeProblemCodeDto { | ||
private String pythonCode; | ||
private String cppCode; | ||
private String javaCode; | ||
public static PracticeProblemCodeDto getPracticeProblemCodeDto(TempCodeDto tempCodeDto) { | ||
return PracticeProblemCodeDto.builder() | ||
.pythonCode(tempCodeDto.getPythonCode()) | ||
.cppCode(tempCodeDto.getCppCode()) | ||
.javaCode(tempCodeDto.getJavaCode()) | ||
.build(); | ||
} | ||
} |
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
Oops, something went wrong.