|
|
@@ -0,0 +1,44 @@
|
|
|
+package com.chuanghai.repair.controller;
|
|
|
+
|
|
|
+import com.chuanghai.repair.entity.RepairsStudent;
|
|
|
+import com.chuanghai.repair.service.RepairsStudentService;
|
|
|
+import com.chuanghai.repair.utils.CreateTokenUtil;
|
|
|
+import com.chuanghai.repair.utils.ReturnValueUtil;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.ArrayList;
|
|
|
+
|
|
|
+@Api(tags = "学生信息管理")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/student")
|
|
|
+public class StudentController {
|
|
|
+
|
|
|
+ @Resource(name = "repairsStudentService")
|
|
|
+ private RepairsStudentService repairsStudentService;
|
|
|
+
|
|
|
+ @ApiOperation("修改学生信息")
|
|
|
+ @PostMapping(value = "/updateStudent")
|
|
|
+ public ReturnValueUtil updateStudent(HttpServletRequest request,
|
|
|
+ RepairsStudent repairsStudent) {
|
|
|
+ Boolean flag = Boolean.FALSE;
|
|
|
+ try {
|
|
|
+ String cardNumber = CreateTokenUtil.getHeadersInfo(request);
|
|
|
+ if (repairsStudent != null) {
|
|
|
+ repairsStudent.setStudentId(cardNumber);
|
|
|
+ ArrayList<RepairsStudent> studentArrayList = new ArrayList<>();
|
|
|
+ studentArrayList.add(repairsStudent);
|
|
|
+ repairsStudentService.updateStudent(studentArrayList);
|
|
|
+ flag = Boolean.TRUE;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return ReturnValueUtil.returnBoolean(flag);
|
|
|
+ }
|
|
|
+}
|