From 89ac7f9b30215669a15fb4fec39d698cb1892c6d Mon Sep 17 00:00:00 2001 From: E1ED922C1E9526DD63272D7EC5C6CB77 <E1ED922C1E9526DD63272D7EC5C6CB77@i-search.com.cn> Date: 星期日, 27 九月 2020 11:43:00 +0800 Subject: [PATCH] 初始化 --- src/main/java/com/hx/common/BaseController.java | 19 +++---------------- 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/hx/common/CommonInit.java b/src/main/java/com/hx/common/BaseController.java similarity index 86% rename from src/main/java/com/hx/common/CommonInit.java rename to src/main/java/com/hx/common/BaseController.java index 5caaf8f..5c5a168 100644 --- a/src/main/java/com/hx/common/CommonInit.java +++ b/src/main/java/com/hx/common/BaseController.java @@ -2,8 +2,6 @@ import com.hx.exception.ParamException; import com.hx.exception.ServiceException; -import com.hx.mybatisTool.SqlParam; -import com.hx.mybatisTool.SqlSentence; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; @@ -16,8 +14,6 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.HashMap; -import java.util.Map; /**鍏叡鍒濆鍖� @@ -25,13 +21,9 @@ * @Date 2020-06-11 */ -public class CommonInit { +public class BaseController { /*璇蜂笉瑕佸0鏄庡彉閲忥紝浼氬鑷翠笉瀹夊叏锛屽洜涓鸿繖涓槸鍗曞垪*/ - - protected HttpServletRequest request = null; - protected HttpSession session = null; - //鍙渶瑕佸姞涓婁笅闈㈣繖娈靛嵆鍙紝娉ㄦ剰涓嶈兘蹇樿娉ㄨВ @InitBinder @@ -44,14 +36,12 @@ public HttpServletRequest getRequest() { //鑾峰彇鍙傛暟瀵硅薄 ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - request = attributes.getRequest(); - return request; + return attributes.getRequest(); } public HttpSession getSession() { //鑾峰彇鍙傛暟瀵硅薄 - session = getRequest() .getSession(); - return session; + return getRequest() .getSession(); } /** @@ -73,8 +63,6 @@ getRequest().setAttribute(attrName, attrObject); } - - /** * 鎶涘嚭鏈嶅姟寮傚父 * @param msg 閿欒淇℃伅 @@ -92,6 +80,5 @@ { throw new ParamException(msg); } - } -- Gitblit v1.8.0