-
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.
- Loading branch information
hz wang
committed
May 4, 2023
1 parent
158e3b8
commit 7b3a885
Showing
39 changed files
with
4,152 additions
and
2,567 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
pastecode-system/src/main/java/com/mewhz/paste/PasteCodeApplication.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
29 changes: 29 additions & 0 deletions
29
pastecode-system/src/main/java/com/mewhz/paste/constant/RunConstant.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.mewhz.paste.constant; | ||
|
||
/** | ||
* @author mewhz | ||
*/ | ||
public interface RunConstant { | ||
|
||
String RUN_DIRECTORY = "e:/runCode/code/"; | ||
|
||
String CLEAR_FILE_NAME = "e:/runCode/code/clear.bat"; | ||
|
||
String JAVA_TYPE = "java"; | ||
|
||
String CPP_TYPE = "cpp"; | ||
|
||
String PYTHON_TYPE = "python"; | ||
|
||
String JAVA_CODE_FILE = "Main.java"; | ||
|
||
String CPP_CODE_FILE = "main.cpp"; | ||
|
||
String PYTHON_CODE_FILE = "main.py"; | ||
|
||
String OUT_FILE_SUFFIX = "-output.txt"; | ||
|
||
String INT_FILE_SUFFIX = "-input.txt"; | ||
|
||
String ERROR_FILE_SUFFIX = "-error.txt"; | ||
} |
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
31 changes: 31 additions & 0 deletions
31
pastecode-system/src/main/java/com/mewhz/paste/controller/RunController.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,31 @@ | ||
package com.mewhz.paste.controller; | ||
|
||
import com.mewhz.paste.model.entity.Code; | ||
import com.mewhz.paste.model.entity.Run; | ||
import com.mewhz.paste.model.vo.CodeRunVO; | ||
import com.mewhz.paste.model.vo.ResultVO; | ||
import com.mewhz.paste.model.vo.RunResultVO; | ||
import com.mewhz.paste.service.RunService; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.annotation.Resource; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author mewhz | ||
*/ | ||
@RestController | ||
@RequestMapping("/run") | ||
public class RunController { | ||
|
||
@Resource | ||
private RunService runService; | ||
|
||
@PostMapping("/") | ||
public ResultVO<RunResultVO> receivedCode(@RequestBody CodeRunVO codeRunVO) { | ||
return ResultVO.ok(runService.receivedCode(codeRunVO)); | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
pastecode-system/src/main/java/com/mewhz/paste/mapper/RunMapper.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.mewhz.paste.mapper; | ||
|
||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import com.mewhz.paste.model.entity.Run; | ||
import org.springframework.stereotype.Repository; | ||
|
||
/** | ||
* @author mewhz | ||
*/ | ||
@Repository | ||
public interface RunMapper extends BaseMapper<Run> { | ||
} |
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
pastecode-system/src/main/java/com/mewhz/paste/model/entity/Run.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 com.mewhz.paste.model.entity; | ||
|
||
import com.baomidou.mybatisplus.annotation.IdType; | ||
import com.baomidou.mybatisplus.annotation.TableId; | ||
import com.baomidou.mybatisplus.annotation.TableName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
/** | ||
* @author mewhz | ||
*/ | ||
@Data | ||
@ToString | ||
@TableName("run") | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class Run { | ||
|
||
@TableId(value = "run_id", type = IdType.AUTO) | ||
private Integer runId; | ||
private Integer codeId; | ||
private String runInput; | ||
private String runOutput; | ||
private String runError; | ||
private String runCreateDate; | ||
} |
19 changes: 19 additions & 0 deletions
19
pastecode-system/src/main/java/com/mewhz/paste/model/vo/CodeRunInfoVO.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,19 @@ | ||
package com.mewhz.paste.model.vo; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
/** | ||
* @author mewhz | ||
*/ | ||
//@Data | ||
//@ToString | ||
//@NoArgsConstructor | ||
//@AllArgsConstructor | ||
//public class CodeRunInfoVO { | ||
// | ||
// | ||
// | ||
//} |
22 changes: 22 additions & 0 deletions
22
pastecode-system/src/main/java/com/mewhz/paste/model/vo/CodeRunVO.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.mewhz.paste.model.vo; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
/** | ||
* @author mewhz | ||
*/ | ||
@Data | ||
@ToString | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class CodeRunVO { | ||
|
||
private String codeText; | ||
private String codeType; | ||
private Integer codeAuthorId; | ||
|
||
private String runInput; | ||
} |
19 changes: 19 additions & 0 deletions
19
pastecode-system/src/main/java/com/mewhz/paste/model/vo/RunResultVO.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,19 @@ | ||
package com.mewhz.paste.model.vo; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
/** | ||
* @author mewhz | ||
*/ | ||
@Data | ||
@ToString | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class RunResultVO { | ||
|
||
private String runOutput; | ||
private String runError; | ||
} |
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.