|
|
@@ -1,5 +1,6 @@
|
|
|
package com.izouma.nineth.web;
|
|
|
import com.izouma.nineth.domain.MetaProblem;
|
|
|
+import com.izouma.nineth.dto.MetaRestResult;
|
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
|
import com.izouma.nineth.repo.MetaProblemRepo;
|
|
|
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/metaProblem")
|
|
|
@@ -56,9 +58,18 @@ public class MetaProblemController extends BaseController {
|
|
|
ExcelUtils.export(response, data);
|
|
|
}
|
|
|
|
|
|
-// @GetMapping("/findAll")
|
|
|
-// public List<MetaProblem> findAll(){
|
|
|
-// return
|
|
|
-// }
|
|
|
+ @GetMapping("/findAll")
|
|
|
+ public List<MetaProblem> findAll(){
|
|
|
+ return metaProblemRepo.findAllByDel(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getAnswer/{id}")
|
|
|
+ public MetaRestResult<MetaProblem> getAnswer(@PathVariable Long id) {
|
|
|
+ MetaProblem metaProblem = metaProblemRepo.findAllByIdAndDel(id, false);
|
|
|
+ if (Objects.isNull(metaProblem)) {
|
|
|
+ return MetaRestResult.returnError("不存在该id的题目");
|
|
|
+ }
|
|
|
+ return MetaRestResult.returnSuccess("查询成功",metaProblem);
|
|
|
+ }
|
|
|
}
|
|
|
|