Commit 71cb2e24 authored by Mindfaker's avatar Mindfaker

fix

parent fb78763d
...@@ -62,7 +62,7 @@ public class StudentInfoService { ...@@ -62,7 +62,7 @@ public class StudentInfoService {
* @param studentInfo * @param studentInfo
* @return * @return
*/ */
public Object updateStudentInfo(StudentInfo studentInfo) { public String updateStudentInfo(StudentInfo studentInfo) {
StudentInfo studentInfo1 = selectStudentInfoByUniqueId(studentInfo.getStudentUniqueId()); StudentInfo studentInfo1 = selectStudentInfoByUniqueId(studentInfo.getStudentUniqueId());
if (studentInfo1 != null && !studentInfo1.getId().equals(studentInfo.getId())) { if (studentInfo1 != null && !studentInfo1.getId().equals(studentInfo.getId())) {
return "Fail 学号重复! 请重新输入学号"; return "Fail 学号重复! 请重新输入学号";
......
...@@ -33,14 +33,14 @@ public class StudentController { ...@@ -33,14 +33,14 @@ public class StudentController {
@PostMapping("add") @PostMapping("add")
public Object add(@RequestBody StudentInfo studentInfo) { public Object add(@RequestBody StudentInfo studentInfo) {
String status = studentInfoService.addStudentInfo(studentInfo); String status = studentInfoService.addStudentInfo(studentInfo);
return status.contains("OK") ? ResponseUtil.ok(status) : ResponseUtil.fail(503, status); return status.contains("OK") ? ResponseUtil.ok(status) : ResponseUtil.fail(301, status);
} }
@PostMapping("update") @PostMapping("update")
public Object update(@RequestBody StudentInfo studentInfo) { public Object update(@RequestBody StudentInfo studentInfo) {
studentInfoService.updateStudentInfo(studentInfo); String status = studentInfoService.updateStudentInfo(studentInfo);
return ResponseUtil.ok("OK"); return status.contains("OK") ? ResponseUtil.ok(status) : ResponseUtil.fail(301, status);
} }
@PostMapping("batchDeleted") @PostMapping("batchDeleted")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment