diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RestController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RestController.java index 8f6069a..c865bfd 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RestController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RestController.java @@ -2,11 +2,14 @@ package com.lyms.platform.operate.web.controller; import java.util.List; +import com.lyms.platform.common.constants.ErrorCodeConstants; import com.lyms.platform.common.core.resolve.MessageResolver; import com.lyms.platform.common.result.BaseResponse; +import com.lyms.platform.common.utils.ExceptionUtils; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; +import org.springframework.http.converter.HttpMessageNotReadableException; import org.springframework.validation.BindException; import org.springframework.validation.BindingResult; import org.springframework.web.bind.MethodArgumentNotValidException; @@ -29,6 +32,18 @@ public class RestController { return createValidationResponse(e.getBindingResult()); } + @ExceptionHandler(HttpMessageNotReadableException.class) + @ResponseBody + @ResponseStatus(HttpStatus.BAD_REQUEST) + public BaseResponse handException(HttpMessageNotReadableException e){ + ExceptionUtils.catchException(e,e.getMessage()); + BaseResponse error = new BaseResponse(); + error.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); + error.setErrormsg("参数错误"); + return error; + } + + @ExceptionHandler(BindException.class) @ResponseStatus(HttpStatus.OK) @ResponseBody diff --git a/platform-operate-api/src/main/resources/spring/applicationContext_biz_patient.xml b/platform-operate-api/src/main/resources/spring/applicationContext_biz_patient.xml index 27055bb..3b84ba0 100644 --- a/platform-operate-api/src/main/resources/spring/applicationContext_biz_patient.xml +++ b/platform-operate-api/src/main/resources/spring/applicationContext_biz_patient.xml @@ -39,7 +39,7 @@ + class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" id="autoProxyCreator"> @@ -47,6 +47,22 @@ + + + + + + mysqlDalInterceptor + + + + + + + + diff --git a/platform-operate-api/src/main/webapp/WEB-INF/web.xml b/platform-operate-api/src/main/webapp/WEB-INF/web.xml index 6b6466e..16661fe 100644 --- a/platform-operate-api/src/main/webapp/WEB-INF/web.xml +++ b/platform-operate-api/src/main/webapp/WEB-INF/web.xml @@ -87,6 +87,18 @@ / + perfFilter + com.lyms.platform.common.perf.SimpleHttpPerfFilter + + fixName + .jsp,.vm,.js,.css + + + + perfFilter + /* + + HttpMethodFilter org.springframework.web.filter.HttpPutFormContentFilter