diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index 9f2405b..bbac2c8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -28,15 +28,14 @@ import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import sun.misc.BASE64Encoder; - import javax.annotation.Resource; import javax.imageio.stream.FileImageInputStream; import java.io.ByteArrayOutputStream; import java.io.File; -import java.lang.reflect.Field; import java.util.*; import java.util.stream.Collectors; @@ -201,7 +200,7 @@ public class AppController extends BaseController @ApiOperation("添加患者") @Log(title = "App患者添加", businessType = BusinessType.INSERT) @PostMapping("/patient/add") - public AjaxResult addPatient(@RequestBody AppPatientReq appPatientReq) + public AjaxResult addPatient(@RequestBody @Validated AppPatientReq appPatientReq) { TPatient tPatient = new TPatient(); BeanUtils.copyProperties(appPatientReq, tPatient); @@ -249,7 +248,7 @@ public class AppController extends BaseController @ApiOperation("患者信息修改") @Log(title = "App患者修改", businessType = BusinessType.UPDATE) @PostMapping("/patient/modify") - public AjaxResult patientsWithModified(@RequestBody AppPatientReq appPatientReq) + public AjaxResult patientsWithModified(@RequestBody @Validated AppPatientReq appPatientReq) { TPatient tPatient = new TPatient(); BeanUtils.copyProperties(appPatientReq, tPatient);