|
|
@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
@ -46,7 +47,7 @@ public class StudentController implements StudentControllerApi{ |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@PostMapping("/addStudent") |
|
|
|
@PostMapping("/addStudent") |
|
|
|
public R addStudent(@RequestBody StudentVo studentVo){ |
|
|
|
public R addStudent(@RequestBody @Valid StudentVo studentVo){ |
|
|
|
studentVo.setSchoolId(ConstantUtils.Keda_schoolId); |
|
|
|
studentVo.setSchoolId(ConstantUtils.Keda_schoolId); |
|
|
|
String account = studentVo.getAccount(); |
|
|
|
String account = studentVo.getAccount(); |
|
|
|
String phone = studentVo.getPhone(); |
|
|
|
String phone = studentVo.getPhone(); |
|
|
@ -130,7 +131,7 @@ public class StudentController implements StudentControllerApi{ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
@PutMapping("/updateStudent") |
|
|
|
@PutMapping("/updateStudent") |
|
|
|
public R updateStudent(@RequestBody StudentVo studentVo) { |
|
|
|
public R updateStudent(@RequestBody @Valid StudentVo studentVo) { |
|
|
|
studentVo.setSchoolId(ConstantUtils.Keda_schoolId);//设定学校id
|
|
|
|
studentVo.setSchoolId(ConstantUtils.Keda_schoolId);//设定学校id
|
|
|
|
|
|
|
|
|
|
|
|
Integer studentId = studentVo.getStudentId(); |
|
|
|
Integer studentId = studentVo.getStudentId(); |
|
|
|