👌 代码审查优化

This commit is contained in:
x ronger 2020-01-23 00:43:05 +08:00
parent 0edc3c7a79
commit 911c694433
7 changed files with 23 additions and 20 deletions

View File

@ -85,9 +85,10 @@ 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);
}else{

View File

@ -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<String> 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)){

View File

@ -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;
}

View File

@ -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++) {

View File

@ -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);
}

View File

@ -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=&lt=&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;
}

View File

@ -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++) {