👌 代码审查优化
This commit is contained in:
parent
0edc3c7a79
commit
911c694433
@ -85,9 +85,10 @@ public class BaseShiroFilterFactoryBean extends ShiroFilterFactoryBean {
|
|||||||
int idx = 0;
|
int idx = 0;
|
||||||
if(( idx = str.indexOf(".")) > 0){
|
if(( idx = str.indexOf(".")) > 0){
|
||||||
str = str.substring(idx);
|
str = str.substring(idx);
|
||||||
if(ignoreExt.contains(str.toLowerCase()))
|
if(ignoreExt.contains(str.toLowerCase())) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(flag){
|
if(flag){
|
||||||
super.doFilterInternal(servletRequest, servletResponse, chain);
|
super.doFilterInternal(servletRequest, servletResponse, chain);
|
||||||
}else{
|
}else{
|
||||||
|
@ -115,6 +115,7 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
* @param key
|
* @param key
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String get(String key) {
|
public String get(String key) {
|
||||||
|
|
||||||
if (StringUtils.isBlank(key)) {
|
if (StringUtils.isBlank(key)) {
|
||||||
@ -168,6 +169,7 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
* @param expireTime 缓存 内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期
|
* @param expireTime 缓存 内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String set(String key, Object obj, int expireTime) {
|
public String set(String key, Object obj, int expireTime) {
|
||||||
String value = RedisService.BLANK_CONTENT;
|
String value = RedisService.BLANK_CONTENT;
|
||||||
if (obj != null) {
|
if (obj != null) {
|
||||||
@ -188,6 +190,7 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
* @param expireTime 缓存 内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期
|
* @param expireTime 缓存 内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String set(String key, String value, int expireTime) {
|
public String set(String key, String value, int expireTime) {
|
||||||
if (StringUtils.isBlank(key)) {
|
if (StringUtils.isBlank(key)) {
|
||||||
logger.warn("Params key is blank!");
|
logger.warn("Params key is blank!");
|
||||||
@ -400,6 +403,7 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
* @param keys
|
* @param keys
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Long delete(String... keys) {
|
public Long delete(String... keys) {
|
||||||
if (keys == null || keys.length == 0) {
|
if (keys == null || keys.length == 0) {
|
||||||
logger.warn("Params keys is null or 0 length!");
|
logger.warn("Params keys is null or 0 length!");
|
||||||
@ -419,6 +423,7 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
* @param key
|
* @param key
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean exists(String key) {
|
public boolean exists(String key) {
|
||||||
if (StringUtils.isBlank(key)) {
|
if (StringUtils.isBlank(key)) {
|
||||||
//不接受空值
|
//不接受空值
|
||||||
@ -484,6 +489,7 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
* @param pattern 如 ke6*abc等
|
* @param pattern 如 ke6*abc等
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Set<String> keys(String pattern) {
|
public Set<String> keys(String pattern) {
|
||||||
|
|
||||||
if (StringUtils.isBlank(pattern)) {
|
if (StringUtils.isBlank(pattern)) {
|
||||||
@ -566,6 +572,7 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
return set(cacheName,map,expireTime);
|
return set(cacheName,map,expireTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object get(String cacheName, String key){
|
public Object get(String cacheName, String key){
|
||||||
String result = get(cacheName);
|
String result = get(cacheName);
|
||||||
if (StringUtils.isNotBlank(result)){
|
if (StringUtils.isNotBlank(result)){
|
||||||
|
@ -2,6 +2,9 @@ package com.rymcu.vertical.dto;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ronger
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class MenuDTO {
|
public class MenuDTO {
|
||||||
|
|
||||||
@ -13,15 +16,15 @@ public class MenuDTO {
|
|||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private Long sort = 50L;
|
private Long sort;
|
||||||
|
|
||||||
private String href;
|
private String href;
|
||||||
|
|
||||||
private String menuType = "0";
|
private String menuType;
|
||||||
|
|
||||||
private String permission;
|
private String permission;
|
||||||
|
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
private String status = "0";
|
private String status;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,9 @@ public class oConvertUtils {
|
|||||||
|
|
||||||
private static String code2code(String strIn, String sourceCode, String targetCode) {
|
private static String code2code(String strIn, String sourceCode, String targetCode) {
|
||||||
String strOut = null;
|
String strOut = null;
|
||||||
if (strIn == null || (strIn.trim()).equals(""))
|
if (strIn == null || (strIn.trim()).equals("")) {
|
||||||
return strIn;
|
return strIn;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
byte[] b = strIn.getBytes(sourceCode);
|
byte[] b = strIn.getBytes(sourceCode);
|
||||||
for (int i = 0; i < b.length; i++) {
|
for (int i = 0; i < b.length; i++) {
|
||||||
|
@ -25,6 +25,7 @@ public class Html2TextUtil extends HTMLEditorKit.ParserCallback {
|
|||||||
delegator.parse(reader, this, Boolean.TRUE);
|
delegator.parse(reader, this, Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void handleText(char[] text, int pos) {
|
public void handleText(char[] text, int pos) {
|
||||||
s.append(text);
|
s.append(text);
|
||||||
}
|
}
|
||||||
|
@ -73,20 +73,9 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setApplicationContext(ApplicationContext applicationContext) {
|
public void setApplicationContext(ApplicationContext applicationContext) {
|
||||||
// logger.debug("注入ApplicationContext到SpringContextHolder:{}", applicationContext);
|
logger.debug("注入ApplicationContext到SpringContextHolder:{}", applicationContext);
|
||||||
// if (SpringContextHolder.applicationContext != null) {
|
if (SpringContextHolder.applicationContext != null) {
|
||||||
// logger.info("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext);
|
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);
|
|
||||||
}
|
}
|
||||||
SpringContextHolder.applicationContext = applicationContext;
|
SpringContextHolder.applicationContext = applicationContext;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,9 @@ public class oConvertUtils {
|
|||||||
|
|
||||||
private static String code2code(String strIn, String sourceCode, String targetCode) {
|
private static String code2code(String strIn, String sourceCode, String targetCode) {
|
||||||
String strOut = null;
|
String strOut = null;
|
||||||
if (strIn == null || (strIn.trim()).equals(""))
|
if (strIn == null || (strIn.trim()).equals("")) {
|
||||||
return strIn;
|
return strIn;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
byte[] b = strIn.getBytes(sourceCode);
|
byte[] b = strIn.getBytes(sourceCode);
|
||||||
for (int i = 0; i < b.length; i++) {
|
for (int i = 0; i < b.length; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user