wangyu пре 6 година
родитељ
комит
bb3ada5ad3

+ 2 - 1
icss-service/src/main/java/com/diagbot/web/DeptInfoController.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
 import java.util.List;
 
 /**
@@ -37,7 +38,7 @@ public class DeptInfoController {
                     "hospitalCode:医院编号,必填<br>")
     @PostMapping("/getPatientInfo")
     @SysLogger("getPatientInfo")
-    public RespDTO<List<DeptInfoDTO>> getPatientInfo(@RequestBody DeptInfoVO deptInfoVO) {
+    public RespDTO<List<DeptInfoDTO>> getPatientInfo(@Valid @RequestBody DeptInfoVO deptInfoVO) {
         return deptInfoFacade.getDeptInfo(deptInfoVO);
     }
 }

+ 2 - 1
icss-service/src/main/java/com/diagbot/web/DoctorInfoController.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
 import java.util.List;
 
 /**
@@ -38,7 +39,7 @@ public class DoctorInfoController {
                     "doctorCode: 医生编号,必填<br>")
     @PostMapping("/getPatientInfo")
     @SysLogger("getPatientInfo")
-    public RespDTO<List<DoctorInfoDTO>> getPatientInfo(@RequestBody DoctorInfoVO doctorInfoVo) {
+    public RespDTO<List<DoctorInfoDTO>> getPatientInfo(@Valid @RequestBody DoctorInfoVO doctorInfoVo) {
         return doctorInfoFacade.getDoctorInfo(doctorInfoVo);
     }
 }

+ 9 - 12
icss-service/src/main/java/com/diagbot/web/PatientInfoController.java

@@ -1,16 +1,6 @@
 package com.diagbot.web;
 
 
-import java.util.List;
-
-import javax.validation.Valid;
-
-import org.springframework.beans.factory.annotation.Autowired;
-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 com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
@@ -18,9 +8,16 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.PatientInfoFacade;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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.validation.Valid;
+import java.util.List;
 
 /**
  * <p>
@@ -42,7 +39,7 @@ public class PatientInfoController {
                     "hospitalCode:医院编号,必填<br>")
     @PostMapping("/getPatientInfo")
     @SysLogger("getPatientInfo")
-    public RespDTO<List<PatientInfoDTO>> getPatientInfo(@RequestBody PatientInfoVO patientInfoVO) {
+    public RespDTO<List<PatientInfoDTO>> getPatientInfo(@Valid @RequestBody PatientInfoVO patientInfoVO) {
         return patientInfoFacade.getPatientInfo(patientInfoVO);
     }