From 9e092bc790ddae117d3daf54728916711b2254f3 Mon Sep 17 00:00:00 2001 From: Parker Date: Sun, 20 Dec 2020 21:02:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81ReView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/opsli/api/msg/ValidationMsg.java | 4 +- .../org/opsli/api/utils/ValidationUtil.java | 9 ++- .../opsli/common/api/TokenThreadLocal.java | 2 +- .../java/org/opsli/common/enums/DictType.java | 2 +- .../org/opsli/common/enums/SystemInfo.java | 2 +- .../java/org/opsli/common/msg/CommonMsg.java | 4 +- .../java/org/opsli/common/utils/ZipUtils.java | 10 ++-- .../java/org/opsli/core/conf/ShiroConfig.java | 2 +- .../org/opsli/core/general/StartPrint.java | 24 ++++---- .../ApplicationFailedEventListener.java | 4 +- ...ava => ApplicationReadyEventListener.java} | 4 +- .../main/java/org/opsli/core/msg/CoreMsg.java | 4 +- .../main/java/org/opsli/core/msg/JwtMsg.java | 4 +- .../java/org/opsli/core/msg/TokenMsg.java | 4 +- .../java/org/opsli/core/persistence/Page.java | 13 ---- .../querybuilder/GenQueryBuilder.java | 3 +- .../querybuilder/WebQueryBuilder.java | 59 ++++++++++--------- .../opsli/core/utils/SpringContextHolder.java | 10 ++-- .../org/opsli/core/utils/UserTokenUtil.java | 2 +- .../org/opsli/core/waf/filter/WafFilter.java | 1 - .../org/opsli/modulars/system/SystemMsg.java | 4 +- .../opsli/plugins/cache/msg/EhCacheMsg.java | 4 +- .../plugins/excel/listener/ExcelListener.java | 2 +- .../org/opsli/plugins/excel/msg/ExcelMsg.java | 4 +- .../org/opsli/plugins/mail/msg/MailMsg.java | 4 +- 25 files changed, 87 insertions(+), 98 deletions(-) rename opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/{ApplicationReadyEventListene.java => ApplicationReadyEventListener.java} (84%) diff --git a/opsli-api/src/main/java/org/opsli/api/msg/ValidationMsg.java b/opsli-api/src/main/java/org/opsli/api/msg/ValidationMsg.java index 54cc7bb..ef727c1 100644 --- a/opsli-api/src/main/java/org/opsli/api/msg/ValidationMsg.java +++ b/opsli-api/src/main/java/org/opsli/api/msg/ValidationMsg.java @@ -70,9 +70,9 @@ public enum ValidationMsg implements BaseMsg { ; private static final String PREFIX = "参数验证错误: "; - private int code; + private final int code; + private final String message; private String fieldName; - private String message; ValidationMsg(int code, String message){ this.code = code; diff --git a/opsli-api/src/main/java/org/opsli/api/utils/ValidationUtil.java b/opsli-api/src/main/java/org/opsli/api/utils/ValidationUtil.java index c5adc65..deef850 100644 --- a/opsli-api/src/main/java/org/opsli/api/utils/ValidationUtil.java +++ b/opsli-api/src/main/java/org/opsli/api/utils/ValidationUtil.java @@ -56,11 +56,10 @@ public final class ValidationUtil { } Field[] fields = ReflectUtil.getFields(obj.getClass()); - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; + for (Field field : fields) { // 获得 统一验证 注解 ValidationArgs validationArgs = field.getAnnotation(ValidationArgs.class); - if(validationArgs != null){ + if (validationArgs != null) { ValiArgsType[] types = validationArgs.value(); Object fieldValue = ReflectUtil.getFieldValue(obj, field); ValidationUtil.check(field, types, fieldValue); @@ -68,7 +67,7 @@ public final class ValidationUtil { // 获得 最大长度 注解 ValidationArgsLenMax validationArgsMax = field.getAnnotation(ValidationArgsLenMax.class); - if(validationArgsMax != null){ + if (validationArgsMax != null) { int maxLength = validationArgsMax.value(); Object fieldValue = ReflectUtil.getFieldValue(obj, field); ValidationUtil.checkMax(field, maxLength, fieldValue); @@ -76,7 +75,7 @@ public final class ValidationUtil { // 获得 最小长度 注解 ValidationArgsLenMin validationArgsMin = field.getAnnotation(ValidationArgsLenMin.class); - if(validationArgsMin != null){ + if (validationArgsMin != null) { int minLength = validationArgsMin.value(); Object fieldValue = ReflectUtil.getFieldValue(obj, field); ValidationUtil.checkMin(field, minLength, fieldValue); diff --git a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/api/TokenThreadLocal.java b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/api/TokenThreadLocal.java index 15c2cea..5a188df 100644 --- a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/api/TokenThreadLocal.java +++ b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/api/TokenThreadLocal.java @@ -40,6 +40,6 @@ public class TokenThreadLocal { public static void remove() { try { TOKEN_DATA.remove(); - }catch (Exception e){} + }catch (Exception ignored){} } } diff --git a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/DictType.java b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/DictType.java index 978caee..24eb802 100644 --- a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/DictType.java +++ b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/DictType.java @@ -14,7 +14,7 @@ public enum DictType { ; - private String code; + private final String code; DictType(String code){ this.code = code; diff --git a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/SystemInfo.java b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/SystemInfo.java index 877e479..9b52fb6 100644 --- a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/SystemInfo.java +++ b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/enums/SystemInfo.java @@ -29,7 +29,7 @@ public enum SystemInfo { /** 实例 */ INSTANCE; - private String systemID; + private final String systemID; SystemInfo(){ // 生成系统ID diff --git a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/msg/CommonMsg.java b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/msg/CommonMsg.java index d1a13fc..5147225 100644 --- a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/msg/CommonMsg.java +++ b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/msg/CommonMsg.java @@ -34,8 +34,8 @@ public enum CommonMsg implements BaseMsg { ; - private int code; - private String message; + private final int code; + private final String message; CommonMsg(int code, String message){ this.code = code; diff --git a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/utils/ZipUtils.java b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/utils/ZipUtils.java index a929315..3a846bc 100644 --- a/opsli-base-support/opsli-common/src/main/java/org/opsli/common/utils/ZipUtils.java +++ b/opsli-base-support/opsli-common/src/main/java/org/opsli/common/utils/ZipUtils.java @@ -91,16 +91,14 @@ public class ZipUtils { public static void main(String[] args) throws Exception { List> list = new ArrayList<>(); OutputStream outputStream = new FileOutputStream(new File("/Users/system/Documents/脚本/opsli/test.zip")); - Map m1 = new HashMap(){{put("path","/f1/f2/f3/");put("name","1.txt");put("data","abcdefg");}}; - Map m2 = new HashMap(){{put("path","/f1/f2/f3/f4/");put("name","2.txt");put("data","abcdefg");}}; - Map m3 = new HashMap(){{put("path","");put("name","3.txt");put("data","abcdefg");}}; + Map m1 = new HashMap(){{put("path","/f1/f2/f3/");put("name","1.txt");put("data","abcdefg");}}; + Map m2 = new HashMap(){{put("path","/f1/f2/f3/f4/");put("name","2.txt");put("data","abcdefg");}}; + Map m3 = new HashMap(){{put("path","");put("name","3.txt");put("data","abcdefg");}}; list.add(m1); list.add(m2); list.add(m3); toZip(list, outputStream); - if (outputStream != null) { - outputStream.close(); - } + outputStream.close(); } } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/conf/ShiroConfig.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/conf/ShiroConfig.java index 556ceb2..514cb7d 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/conf/ShiroConfig.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/conf/ShiroConfig.java @@ -66,7 +66,7 @@ public class ShiroConfig { /** * filer - * @param securityManager + * @param securityManager 安全管理器 * @return */ @Bean("shiroFilter") diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/general/StartPrint.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/general/StartPrint.java index c1566a1..14a4341 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/general/StartPrint.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/general/StartPrint.java @@ -60,13 +60,13 @@ public class StartPrint { // 睡一秒打印 ThreadUtil.sleep(1, TimeUnit.SECONDS); String basePath = getBasePath(); - StringBuilder printStr = new StringBuilder(); - printStr.append("\n----------------------------------------------------------\n") - .append("OPSLI 快速开发平台 框架启动成功! 相关URLs:\n") - .append("项目地址: \t\thttp://" + basePath + "/\n") - .append("Doc文档: \t\thttp://" + basePath + "/doc.html\n") - .append("----------------------------------------------------------\n"); - Console.log(printStr.toString()); + String printStr = + "\n----------------------------------------------------------\n" + + "OPSLI 快速开发平台 框架启动成功! 相关URLs:\n" + + "项目地址: \t\thttp://" + basePath + "/\n" + + "Doc文档: \t\thttp://" + basePath + "/doc.html\n" + + "----------------------------------------------------------\n"; + Console.log(printStr); } /** @@ -76,11 +76,11 @@ public class StartPrint { public void errorPrint(){ // 睡一秒打印 ThreadUtil.sleep(1, TimeUnit.SECONDS); - StringBuilder printStr = new StringBuilder(); - printStr.append("\n----------------------------------------------------------\n") - .append("OPSLI 快速开发平台 框架启动失败! 请检查相关配置!\n") - .append("----------------------------------------------------------\n"); - Console.log(printStr.toString()); + String printStr = + "\n----------------------------------------------------------\n" + + "OPSLI 快速开发平台 框架启动失败! 请检查相关配置!\n" + + "----------------------------------------------------------\n"; + Console.log(printStr); } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationFailedEventListener.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationFailedEventListener.java index 53a4745..e155e19 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationFailedEventListener.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationFailedEventListener.java @@ -15,8 +15,10 @@ import org.springframework.stereotype.Component; @Component @Slf4j public class ApplicationFailedEventListener implements ApplicationListener { + @Override public void onApplicationEvent(ApplicationFailedEvent event) { StartPrint.INSTANCE.errorPrint(); } -} \ No newline at end of file + +} diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationReadyEventListene.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationReadyEventListener.java similarity index 84% rename from opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationReadyEventListene.java rename to opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationReadyEventListener.java index 3a7a831..fd6535a 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationReadyEventListene.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/listener/ApplicationReadyEventListener.java @@ -14,10 +14,12 @@ import org.springframework.stereotype.Component; */ @Component @Slf4j -public class ApplicationReadyEventListene implements ApplicationListener { +public class ApplicationReadyEventListener implements ApplicationListener { + @Override public void onApplicationEvent(ApplicationReadyEvent event) { event.getApplicationContext(); StartPrint.INSTANCE.successPrint(); } + } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/CoreMsg.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/CoreMsg.java index 7f70891..cae5aea 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/CoreMsg.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/CoreMsg.java @@ -68,8 +68,8 @@ public enum CoreMsg implements BaseMsg { ; - private int code; - private String message; + private final int code; + private final String message; CoreMsg(int code,String message){ this.code = code; diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/JwtMsg.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/JwtMsg.java index ae4cd4e..4c0b729 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/JwtMsg.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/JwtMsg.java @@ -34,8 +34,8 @@ public enum JwtMsg implements BaseMsg { ; - private int code; - private String message; + private final int code; + private final String message; JwtMsg(int code, String message){ this.code = code; diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/TokenMsg.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/TokenMsg.java index b4ab31d..f0b0f7e 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/TokenMsg.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/msg/TokenMsg.java @@ -53,8 +53,8 @@ public enum TokenMsg implements BaseMsg { EXCEPTION_NOT_AUTH(12202, "无权访问该方法"), ; - private int code; - private String message; + private final int code; + private final String message; TokenMsg(int code, String message){ this.code = code; diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java index a1b0a6c..399a5e6 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/Page.java @@ -70,19 +70,6 @@ public class Page extends PageSeriali this.queryWrapper = queryWrapper; } - /** - * 分页 构造函数 - * @param pageNo 页 - * @param pageSize 分页大小 - */ - public Page(int pageNo, int pageSize, String orderBy) { - super(); - this.pageNo = pageNo; - this.pageSize = pageSize; - } - - - /** * 分页函数 */ diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/GenQueryBuilder.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/GenQueryBuilder.java index 06c5190..9f8b363 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/GenQueryBuilder.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/GenQueryBuilder.java @@ -37,8 +37,7 @@ public class GenQueryBuilder implements QueryBuilder { @Override public QueryWrapper build() { - QueryWrapper queryWrapper = new QueryWrapper<>(); - return queryWrapper; + return new QueryWrapper<>(); } } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/WebQueryBuilder.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/WebQueryBuilder.java index 036b6d3..a37b7bc 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/WebQueryBuilder.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/persistence/querybuilder/WebQueryBuilder.java @@ -47,11 +47,11 @@ public class WebQueryBuilder implements QueryBuilder{ private static final String ORDER_DESC = "DESC"; /** 参数 */ - private Map parameterMap; + private final Map parameterMap; /** Entity Clazz */ - private Class entityClazz; + private final Class entityClazz; /** 默认排序字段 */ - private String defaultOrderField; + private final String defaultOrderField; /** * 构造函数 只是生产 查询器 @@ -152,27 +152,33 @@ public class WebQueryBuilder implements QueryBuilder{ } // 转换驼峰 为 数据库下划线字段 key = HumpUtil.humpToUnderline(key); - if (EQ.equals(handle)) { - // 全值匹配 - queryWrapper.eq(key,value); - } else if (LIKE.equals(handle)) { - // 模糊匹配 - queryWrapper.like(key,value); - } else if (BEGIN.equals(handle)) { - // 大于等于 - queryWrapper.ge(key,value); - } else if (END.equals(handle)) { - // 小于等于 - queryWrapper.le(key,value); - } else if (ORDER.equals(handle)) { - // 排序 - if(ORDER_ASC.equals(value)){ - queryWrapper.orderByAsc(key); - } else if(ORDER_DESC.equals(value)){ - queryWrapper.orderByDesc(key); - } else{ - queryWrapper.orderByAsc(key); - } + switch (handle) { + case EQ: + // 全值匹配 + queryWrapper.eq(key, value); + break; + case LIKE: + // 模糊匹配 + queryWrapper.like(key, value); + break; + case BEGIN: + // 大于等于 + queryWrapper.ge(key, value); + break; + case END: + // 小于等于 + queryWrapper.le(key, value); + break; + case ORDER: + // 排序 + if (ORDER_ASC.equals(value)) { + queryWrapper.orderByAsc(key); + } else if (ORDER_DESC.equals(value)) { + queryWrapper.orderByDesc(key); + } else { + queryWrapper.orderByAsc(key); + } + break; } } @@ -208,9 +214,8 @@ public class WebQueryBuilder implements QueryBuilder{ return true; } else if (END.equals(handle)) { return true; - } else if (ORDER.equals(handle)) { - return true; + } else { + return ORDER.equals(handle); } - return false; } } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/SpringContextHolder.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/SpringContextHolder.java index 1f5efc3..8d629fb 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/SpringContextHolder.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/SpringContextHolder.java @@ -1,8 +1,7 @@ package org.opsli.core.utils; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.Validate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.DisposableBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -17,12 +16,11 @@ import org.springframework.stereotype.Component; */ @Component @Lazy(false) +@Slf4j public class SpringContextHolder implements ApplicationContextAware, DisposableBean { private static ApplicationContext applicationContext = null; - private static Logger logger = LoggerFactory.getLogger(SpringContextHolder.class); - /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. @@ -45,8 +43,8 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB * 清除SpringContextHolder中的ApplicationContext为Null. */ public static void clearHolder() { - if (logger.isDebugEnabled()){ - logger.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext); + if (log.isDebugEnabled()){ + log.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext); } applicationContext = null; } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/UserTokenUtil.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/UserTokenUtil.java index 82bff86..24c1a4f 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/UserTokenUtil.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/utils/UserTokenUtil.java @@ -159,7 +159,7 @@ public class UserTokenUtil { String userId = ""; try { userId = JwtUtil.getClaim(token, SignConstants.USER_ID); - }catch (Exception e){} + }catch (Exception ignored){} return userId; } diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/waf/filter/WafFilter.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/waf/filter/WafFilter.java index 1ef9673..b74ecc0 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/waf/filter/WafFilter.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/waf/filter/WafFilter.java @@ -16,7 +16,6 @@ package org.opsli.core.waf.filter; -import org.opsli.common.exception.TokenException; import org.opsli.core.waf.servlet.WafHttpServletRequestWrapper; import javax.servlet.*; diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java index ac8dd10..0947cfa 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java @@ -78,8 +78,8 @@ public enum SystemMsg implements BaseMsg { ; - private int code; - private String message; + private final int code; + private final String message; SystemMsg(int code, String message){ this.code = code; diff --git a/opsli-plugins/opsli-plugins-ehcache/src/main/java/org/opsli/plugins/cache/msg/EhCacheMsg.java b/opsli-plugins/opsli-plugins-ehcache/src/main/java/org/opsli/plugins/cache/msg/EhCacheMsg.java index e1e7641..0dfe922 100644 --- a/opsli-plugins/opsli-plugins-ehcache/src/main/java/org/opsli/plugins/cache/msg/EhCacheMsg.java +++ b/opsli-plugins/opsli-plugins-ehcache/src/main/java/org/opsli/plugins/cache/msg/EhCacheMsg.java @@ -37,8 +37,8 @@ public enum EhCacheMsg implements BaseMsg { ; - private int code; - private String message; + private final int code; + private final String message; EhCacheMsg(int code, String message){ this.code = code; diff --git a/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/listener/ExcelListener.java b/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/listener/ExcelListener.java index a87ee40..ed3a5c3 100644 --- a/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/listener/ExcelListener.java +++ b/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/listener/ExcelListener.java @@ -32,7 +32,7 @@ public class ExcelListener extends AnalysisEventListener { private static final String SERIAL_VERSION_UID = "serialVersionUID"; - private List dataList = new ArrayList<>(); + private final List dataList = new ArrayList<>(); /** * 通过 AnalysisContext 对象还可以获取当前 sheet,当前行等数据 diff --git a/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/msg/ExcelMsg.java b/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/msg/ExcelMsg.java index d1972ba..90c2a15 100644 --- a/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/msg/ExcelMsg.java +++ b/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/msg/ExcelMsg.java @@ -32,8 +32,8 @@ public enum ExcelMsg implements BaseMsg { ; - private int code; - private String message; + private final int code; + private final String message; ExcelMsg(int code, String message){ this.code = code; diff --git a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/msg/MailMsg.java b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/msg/MailMsg.java index 83e7b25..62119b9 100644 --- a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/msg/MailMsg.java +++ b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/msg/MailMsg.java @@ -31,8 +31,8 @@ public enum MailMsg implements BaseMsg { ; - private int code; - private String message; + private final int code; + private final String message; MailMsg(int code,String message){ this.code = code;