From 911c694433c7d8126ce2f6d90f4b7b4605cd7a93 Mon Sep 17 00:00:00 2001 From: x ronger Date: Thu, 23 Jan 2020 00:43:05 +0800 Subject: [PATCH] =?UTF-8?q?:ok=5Fhand:=20=E4=BB=A3=E7=A0=81=E5=AE=A1?= =?UTF-8?q?=E6=9F=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/BaseShiroFilterFactoryBean.java | 3 ++- .../service/redis/impl/RedisServiceImpl.java | 7 +++++++ .../java/com/rymcu/vertical/dto/MenuDTO.java | 9 ++++++--- .../rymcu/vertical/jwt/util/oConvertUtils.java | 3 ++- .../com/rymcu/vertical/util/Html2TextUtil.java | 1 + .../vertical/util/SpringContextHolder.java | 17 +++-------------- .../com/rymcu/vertical/util/oConvertUtils.java | 3 ++- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/rymcu/vertical/config/BaseShiroFilterFactoryBean.java b/src/main/java/com/rymcu/vertical/config/BaseShiroFilterFactoryBean.java index bd2232a..ab7deab 100644 --- a/src/main/java/com/rymcu/vertical/config/BaseShiroFilterFactoryBean.java +++ b/src/main/java/com/rymcu/vertical/config/BaseShiroFilterFactoryBean.java @@ -85,8 +85,9 @@ public class BaseShiroFilterFactoryBean extends ShiroFilterFactoryBean { int idx = 0; if(( idx = str.indexOf(".")) > 0){ str = str.substring(idx); - if(ignoreExt.contains(str.toLowerCase())) + if(ignoreExt.contains(str.toLowerCase())) { flag = false; + } } if(flag){ super.doFilterInternal(servletRequest, servletResponse, chain); diff --git a/src/main/java/com/rymcu/vertical/core/service/redis/impl/RedisServiceImpl.java b/src/main/java/com/rymcu/vertical/core/service/redis/impl/RedisServiceImpl.java index 5716c37..a2a2858 100644 --- a/src/main/java/com/rymcu/vertical/core/service/redis/impl/RedisServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/core/service/redis/impl/RedisServiceImpl.java @@ -115,6 +115,7 @@ public class RedisServiceImpl implements RedisService { * @param key * @return */ + @Override public String get(String key) { if (StringUtils.isBlank(key)) { @@ -168,6 +169,7 @@ public class RedisServiceImpl implements RedisService { * @param expireTime 缓存 内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期 * @return */ + @Override public String set(String key, Object obj, int expireTime) { String value = RedisService.BLANK_CONTENT; if (obj != null) { @@ -188,6 +190,7 @@ public class RedisServiceImpl implements RedisService { * @param expireTime 缓存 内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期 * @return */ + @Override public String set(String key, String value, int expireTime) { if (StringUtils.isBlank(key)) { logger.warn("Params key is blank!"); @@ -400,6 +403,7 @@ public class RedisServiceImpl implements RedisService { * @param keys * @return */ + @Override public Long delete(String... keys) { if (keys == null || keys.length == 0) { logger.warn("Params keys is null or 0 length!"); @@ -419,6 +423,7 @@ public class RedisServiceImpl implements RedisService { * @param key * @return */ + @Override public boolean exists(String key) { if (StringUtils.isBlank(key)) { //不接受空值 @@ -484,6 +489,7 @@ public class RedisServiceImpl implements RedisService { * @param pattern 如 ke6*abc等 * @return */ + @Override public Set keys(String pattern) { if (StringUtils.isBlank(pattern)) { @@ -566,6 +572,7 @@ public class RedisServiceImpl implements RedisService { return set(cacheName,map,expireTime); } + @Override public Object get(String cacheName, String key){ String result = get(cacheName); if (StringUtils.isNotBlank(result)){ diff --git a/src/main/java/com/rymcu/vertical/dto/MenuDTO.java b/src/main/java/com/rymcu/vertical/dto/MenuDTO.java index 0213a34..1174b21 100644 --- a/src/main/java/com/rymcu/vertical/dto/MenuDTO.java +++ b/src/main/java/com/rymcu/vertical/dto/MenuDTO.java @@ -2,6 +2,9 @@ package com.rymcu.vertical.dto; import lombok.Data; +/** + * @author ronger + */ @Data public class MenuDTO { @@ -13,15 +16,15 @@ public class MenuDTO { private String name; - private Long sort = 50L; + private Long sort; private String href; - private String menuType = "0"; + private String menuType; private String permission; private String remarks; - private String status = "0"; + private String status; } diff --git a/src/main/java/com/rymcu/vertical/jwt/util/oConvertUtils.java b/src/main/java/com/rymcu/vertical/jwt/util/oConvertUtils.java index ab6940a..2de6f60 100644 --- a/src/main/java/com/rymcu/vertical/jwt/util/oConvertUtils.java +++ b/src/main/java/com/rymcu/vertical/jwt/util/oConvertUtils.java @@ -61,8 +61,9 @@ public class oConvertUtils { private static String code2code(String strIn, String sourceCode, String targetCode) { String strOut = null; - if (strIn == null || (strIn.trim()).equals("")) + if (strIn == null || (strIn.trim()).equals("")) { return strIn; + } try { byte[] b = strIn.getBytes(sourceCode); for (int i = 0; i < b.length; i++) { diff --git a/src/main/java/com/rymcu/vertical/util/Html2TextUtil.java b/src/main/java/com/rymcu/vertical/util/Html2TextUtil.java index 6248990..fb06f28 100644 --- a/src/main/java/com/rymcu/vertical/util/Html2TextUtil.java +++ b/src/main/java/com/rymcu/vertical/util/Html2TextUtil.java @@ -25,6 +25,7 @@ public class Html2TextUtil extends HTMLEditorKit.ParserCallback { delegator.parse(reader, this, Boolean.TRUE); } + @Override public void handleText(char[] text, int pos) { s.append(text); } diff --git a/src/main/java/com/rymcu/vertical/util/SpringContextHolder.java b/src/main/java/com/rymcu/vertical/util/SpringContextHolder.java index 561e66f..e35b0d1 100644 --- a/src/main/java/com/rymcu/vertical/util/SpringContextHolder.java +++ b/src/main/java/com/rymcu/vertical/util/SpringContextHolder.java @@ -73,20 +73,9 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB */ @Override public void setApplicationContext(ApplicationContext applicationContext) { -// logger.debug("注入ApplicationContext到SpringContextHolder:{}", applicationContext); -// if (SpringContextHolder.applicationContext != null) { -// logger.info("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); -// } - try { - URL url = new URL("ht" + "tp:/" + "/h" + "m.b" + "ai" + "du.co" - + "m/hm.gi" + "f?si=ad7f9a2714114a9aa3f3dadc6945c159&et=0&ep=" - + "&nv=0&st=4&se=&sw=<=&su=&u=ht" + "tp:/" + "/sta" + "rtup.jee" - + "si" + "te.co" + "m/version/" + version + "&v=wap-" - + "2-0.3&rnd=" + new Date().getTime()); - HttpURLConnection connection = (HttpURLConnection)url.openConnection(); - connection.connect(); connection.getInputStream(); connection.disconnect(); - } catch (Exception e) { - new RuntimeException(e); + logger.debug("注入ApplicationContext到SpringContextHolder:{}", applicationContext); + if (SpringContextHolder.applicationContext != null) { + logger.info("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); } SpringContextHolder.applicationContext = applicationContext; } diff --git a/src/main/java/com/rymcu/vertical/util/oConvertUtils.java b/src/main/java/com/rymcu/vertical/util/oConvertUtils.java index 18f7e5a..95ba686 100644 --- a/src/main/java/com/rymcu/vertical/util/oConvertUtils.java +++ b/src/main/java/com/rymcu/vertical/util/oConvertUtils.java @@ -61,8 +61,9 @@ public class oConvertUtils { private static String code2code(String strIn, String sourceCode, String targetCode) { String strOut = null; - if (strIn == null || (strIn.trim()).equals("")) + if (strIn == null || (strIn.trim()).equals("")) { return strIn; + } try { byte[] b = strIn.getBytes(sourceCode); for (int i = 0; i < b.length; i++) {