From 26fc652d33fb82a75d6ec7771ca50ee414b21723 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期二, 11 一月 2022 16:58:47 +0800 Subject: [PATCH] update 统一代码间隔符 --- ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/IServicePlus.java | 160 +- ruoyi-framework/src/main/java/com/ruoyi/framework/handler/CreateAndUpdateMetaObjectHandler.java | 108 ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/CaptchaProperties.java | 24 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java | 70 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java | 74 ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java | 94 ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java | 2 ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java | 67 ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java | 132 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java | 108 ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/BaseMapperPlus.java | 14 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java | 248 +- ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java | 76 ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java | 8 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java | 186 +- ruoyi-common/src/main/java/com/ruoyi/common/utils/ValidatorUtils.java | 4 ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java | 2 ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java | 24 ruoyi-framework/src/main/java/com/ruoyi/framework/config/JacksonConfig.java | 36 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java | 196 +- ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOss.java | 50 ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java | 48 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java | 148 +- ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java | 26 ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java | 118 ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java | 6 ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java | 62 ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java | 66 ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelDictConvert.java | 80 ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java | 48 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java | 140 ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/ServicePlusImpl.java | 268 +- ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java | 16 ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java | 120 ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java | 19 ruoyi-framework/src/main/java/com/ruoyi/framework/jackson/BigNumberSerializer.java | 42 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java | 7 ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java | 84 ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java | 44 ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java | 36 ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestDemo.java | 10 ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java | 604 ++++---- ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java | 41 ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/MonitorAdminApplication.java | 8 ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java | 80 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java | 36 ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java | 38 ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/RedissonProperties.java | 336 ++-- ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/methods/InsertAll.java | 146 +- ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java | 4 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java | 2 51 files changed, 2,184 insertions(+), 2,182 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java b/ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java index 9c0f26f..ec2d682 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/captcha/UnsignedMathGenerator.java @@ -13,73 +13,73 @@ */ public class UnsignedMathGenerator implements CodeGenerator { - private static final long serialVersionUID = -5514819971774091076L; + private static final long serialVersionUID = -5514819971774091076L; - private static final String operators = "+-*"; + private static final String operators = "+-*"; - /** - * 鍙備笌璁$畻鏁板瓧鏈�澶ч暱搴� - */ - private final int numberLength; + /** + * 鍙備笌璁$畻鏁板瓧鏈�澶ч暱搴� + */ + private final int numberLength; - /** - * 鏋勯�� - */ - public UnsignedMathGenerator() { - this(2); - } + /** + * 鏋勯�� + */ + public UnsignedMathGenerator() { + this(2); + } - /** - * 鏋勯�� - * - * @param numberLength 鍙備笌璁$畻鏈�澶ф暟瀛椾綅鏁� - */ - public UnsignedMathGenerator(int numberLength) { - this.numberLength = numberLength; - } + /** + * 鏋勯�� + * + * @param numberLength 鍙備笌璁$畻鏈�澶ф暟瀛椾綅鏁� + */ + public UnsignedMathGenerator(int numberLength) { + this.numberLength = numberLength; + } - @Override - public String generate() { - final int limit = getLimit(); - int min = RandomUtil.randomInt(limit); - int max = RandomUtil.randomInt(min, limit); - String number1 = Integer.toString(max); - String number2 = Integer.toString(min); - number1 = StringUtils.rightPad(number1, this.numberLength, CharUtil.SPACE); - number2 = StringUtils.rightPad(number2, this.numberLength, CharUtil.SPACE); + @Override + public String generate() { + final int limit = getLimit(); + int min = RandomUtil.randomInt(limit); + int max = RandomUtil.randomInt(min, limit); + String number1 = Integer.toString(max); + String number2 = Integer.toString(min); + number1 = StringUtils.rightPad(number1, this.numberLength, CharUtil.SPACE); + number2 = StringUtils.rightPad(number2, this.numberLength, CharUtil.SPACE); - return number1 + RandomUtil.randomChar(operators) + number2 + '='; - } + return number1 + RandomUtil.randomChar(operators) + number2 + '='; + } - @Override - public boolean verify(String code, String userInputCode) { - int result; - try { - result = Integer.parseInt(userInputCode); - } catch (NumberFormatException e) { - // 鐢ㄦ埛杈撳叆闈炴暟瀛� - return false; - } + @Override + public boolean verify(String code, String userInputCode) { + int result; + try { + result = Integer.parseInt(userInputCode); + } catch (NumberFormatException e) { + // 鐢ㄦ埛杈撳叆闈炴暟瀛� + return false; + } - final int calculateResult = (int) Calculator.conversion(code); - return result == calculateResult; - } + final int calculateResult = (int) Calculator.conversion(code); + return result == calculateResult; + } - /** - * 鑾峰彇楠岃瘉鐮侀暱搴� - * - * @return 楠岃瘉鐮侀暱搴� - */ - public int getLength() { - return this.numberLength * 2 + 2; - } + /** + * 鑾峰彇楠岃瘉鐮侀暱搴� + * + * @return 楠岃瘉鐮侀暱搴� + */ + public int getLength() { + return this.numberLength * 2 + 2; + } - /** - * 鏍规嵁闀垮害鑾峰彇鍙備笌璁$畻鏁板瓧鏈�澶у�� - * - * @return 鏈�澶у�� - */ - private int getLimit() { - return Integer.parseInt("1" + StringUtils.repeat('0', this.numberLength)); - } + /** + * 鏍规嵁闀垮害鑾峰彇鍙備笌璁$畻鏁板瓧鏈�澶у�� + * + * @return 鏈�澶у�� + */ + private int getLimit() { + return Integer.parseInt("1" + StringUtils.repeat('0', this.numberLength)); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java index df1f95a..690b479 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelBigNumberConvert.java @@ -20,32 +20,32 @@ @Slf4j public class ExcelBigNumberConvert implements Converter<Long> { - @Override - public Class<Long> supportJavaTypeKey() { - return Long.class; - } + @Override + public Class<Long> supportJavaTypeKey() { + return Long.class; + } - @Override - public CellDataTypeEnum supportExcelTypeKey() { - return CellDataTypeEnum.STRING; - } + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } - @Override - public Long convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { - return Convert.toLong(cellData.getData()); - } + @Override + public Long convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + return Convert.toLong(cellData.getData()); + } - @Override - public CellData<Object> convertToExcelData(Long object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { - if (ObjectUtil.isNotNull(object)) { - String str = Convert.toStr(object); - if (str.length() > 15) { - return new CellData<>(str); - } - } - CellData<Object> cellData = new CellData<>(new BigDecimal(object)); - cellData.setType(CellDataTypeEnum.NUMBER); - return cellData; - } + @Override + public CellData<Object> convertToExcelData(Long object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (ObjectUtil.isNotNull(object)) { + String str = Convert.toStr(object); + if (str.length() > 15) { + return new CellData<>(str); + } + } + CellData<Object> cellData = new CellData<>(new BigDecimal(object)); + cellData.setType(CellDataTypeEnum.NUMBER); + return cellData; + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelDictConvert.java b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelDictConvert.java index 7c4d631..cf612c9 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelDictConvert.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/convert/ExcelDictConvert.java @@ -24,48 +24,48 @@ @Slf4j public class ExcelDictConvert implements Converter<Object> { - @Override - public Class<Object> supportJavaTypeKey() { - return Object.class; - } + @Override + public Class<Object> supportJavaTypeKey() { + return Object.class; + } - @Override - public CellDataTypeEnum supportExcelTypeKey() { - return null; - } + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return null; + } - @Override - public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { - ExcelDictFormat anno = getAnnotation(contentProperty.getField()); - String type = anno.dictType(); - String label = cellData.getStringValue(); - String value; - if (StringUtils.isBlank(type)) { - value = ExcelUtil.reverseByExp(label, anno.readConverterExp(), anno.separator()); - } else { - value = SpringUtils.getBean(DictService.class).getDictValue(type, label, anno.separator()); - } - return Convert.convert(contentProperty.getField().getType(), value); - } + @Override + public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + ExcelDictFormat anno = getAnnotation(contentProperty.getField()); + String type = anno.dictType(); + String label = cellData.getStringValue(); + String value; + if (StringUtils.isBlank(type)) { + value = ExcelUtil.reverseByExp(label, anno.readConverterExp(), anno.separator()); + } else { + value = SpringUtils.getBean(DictService.class).getDictValue(type, label, anno.separator()); + } + return Convert.convert(contentProperty.getField().getType(), value); + } - @Override - public CellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { - if (StringUtils.isNull(object)) { - return new CellData<>(""); - } - ExcelDictFormat anno = getAnnotation(contentProperty.getField()); - String type = anno.dictType(); - String value = Convert.toStr(object); - String label; - if (StringUtils.isBlank(type)) { - label = ExcelUtil.convertByExp(value, anno.readConverterExp(), anno.separator()); - } else { - label = SpringUtils.getBean(DictService.class).getDictLabel(type, value, anno.separator()); - } - return new CellData<>(label); - } + @Override + public CellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { + if (StringUtils.isNull(object)) { + return new CellData<>(""); + } + ExcelDictFormat anno = getAnnotation(contentProperty.getField()); + String type = anno.dictType(); + String value = Convert.toStr(object); + String label; + if (StringUtils.isBlank(type)) { + label = ExcelUtil.convertByExp(value, anno.readConverterExp(), anno.separator()); + } else { + label = SpringUtils.getBean(DictService.class).getDictLabel(type, value, anno.separator()); + } + return new CellData<>(label); + } - private ExcelDictFormat getAnnotation(Field field) { - return AnnotationUtil.getAnnotation(field, ExcelDictFormat.class); - } + private ExcelDictFormat getAnnotation(Field field) { + return AnnotationUtil.getAnnotation(field, ExcelDictFormat.class); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java index 7c388c5..158da5f 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java @@ -20,115 +20,115 @@ @ApiModel("璇锋眰鍝嶅簲瀵硅薄") public class AjaxResult<T> { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 鐘舵�佺爜 - */ - @ApiModelProperty("娑堟伅鐘舵�佺爜") - private int code; + /** + * 鐘舵�佺爜 + */ + @ApiModelProperty("娑堟伅鐘舵�佺爜") + private int code; - /** - * 杩斿洖鍐呭 - */ - @ApiModelProperty("娑堟伅鍐呭") - private String msg; + /** + * 杩斿洖鍐呭 + */ + @ApiModelProperty("娑堟伅鍐呭") + private String msg; - /** - * 鏁版嵁瀵硅薄 - */ - @ApiModelProperty("鏁版嵁瀵硅薄") - private T data; + /** + * 鏁版嵁瀵硅薄 + */ + @ApiModelProperty("鏁版嵁瀵硅薄") + private T data; - /** - * 鍒濆鍖栦竴涓柊鍒涘缓鐨� AjaxResult 瀵硅薄 - * - * @param code 鐘舵�佺爜 - * @param msg 杩斿洖鍐呭 - */ - public AjaxResult(int code, String msg) { - this.code = code; - this.msg = msg; - } + /** + * 鍒濆鍖栦竴涓柊鍒涘缓鐨� AjaxResult 瀵硅薄 + * + * @param code 鐘舵�佺爜 + * @param msg 杩斿洖鍐呭 + */ + public AjaxResult(int code, String msg) { + this.code = code; + this.msg = msg; + } - /** - * 杩斿洖鎴愬姛娑堟伅 - * - * @return 鎴愬姛娑堟伅 - */ - public static AjaxResult<Void> success() { - return AjaxResult.success("鎿嶄綔鎴愬姛"); - } + /** + * 杩斿洖鎴愬姛娑堟伅 + * + * @return 鎴愬姛娑堟伅 + */ + public static AjaxResult<Void> success() { + return AjaxResult.success("鎿嶄綔鎴愬姛"); + } - /** - * 杩斿洖鎴愬姛鏁版嵁 - * - * @return 鎴愬姛娑堟伅 - */ - public static <T> AjaxResult<T> success(T data) { - return AjaxResult.success("鎿嶄綔鎴愬姛", data); - } + /** + * 杩斿洖鎴愬姛鏁版嵁 + * + * @return 鎴愬姛娑堟伅 + */ + public static <T> AjaxResult<T> success(T data) { + return AjaxResult.success("鎿嶄綔鎴愬姛", data); + } - /** - * 杩斿洖鎴愬姛娑堟伅 - * - * @param msg 杩斿洖鍐呭 - * @return 鎴愬姛娑堟伅 - */ - public static AjaxResult<Void> success(String msg) { - return AjaxResult.success(msg, null); - } + /** + * 杩斿洖鎴愬姛娑堟伅 + * + * @param msg 杩斿洖鍐呭 + * @return 鎴愬姛娑堟伅 + */ + public static AjaxResult<Void> success(String msg) { + return AjaxResult.success(msg, null); + } - /** - * 杩斿洖鎴愬姛娑堟伅 - * - * @param msg 杩斿洖鍐呭 - * @param data 鏁版嵁瀵硅薄 - * @return 鎴愬姛娑堟伅 - */ - public static <T> AjaxResult<T> success(String msg, T data) { - return new AjaxResult<>(HttpStatus.HTTP_OK, msg, data); - } + /** + * 杩斿洖鎴愬姛娑堟伅 + * + * @param msg 杩斿洖鍐呭 + * @param data 鏁版嵁瀵硅薄 + * @return 鎴愬姛娑堟伅 + */ + public static <T> AjaxResult<T> success(String msg, T data) { + return new AjaxResult<>(HttpStatus.HTTP_OK, msg, data); + } - /** - * 杩斿洖閿欒娑堟伅 - * - * @return - */ - public static AjaxResult<Void> error() { - return AjaxResult.error("鎿嶄綔澶辫触"); - } + /** + * 杩斿洖閿欒娑堟伅 + * + * @return + */ + public static AjaxResult<Void> error() { + return AjaxResult.error("鎿嶄綔澶辫触"); + } - /** - * 杩斿洖閿欒娑堟伅 - * - * @param msg 杩斿洖鍐呭 - * @return 璀﹀憡娑堟伅 - */ - public static AjaxResult<Void> error(String msg) { - return AjaxResult.error(msg, null); - } + /** + * 杩斿洖閿欒娑堟伅 + * + * @param msg 杩斿洖鍐呭 + * @return 璀﹀憡娑堟伅 + */ + public static AjaxResult<Void> error(String msg) { + return AjaxResult.error(msg, null); + } - /** - * 杩斿洖閿欒娑堟伅 - * - * @param msg 杩斿洖鍐呭 - * @param data 鏁版嵁瀵硅薄 - * @return 璀﹀憡娑堟伅 - */ - public static <T> AjaxResult<T> error(String msg, T data) { - return new AjaxResult<>(HttpStatus.HTTP_INTERNAL_ERROR, msg, data); - } + /** + * 杩斿洖閿欒娑堟伅 + * + * @param msg 杩斿洖鍐呭 + * @param data 鏁版嵁瀵硅薄 + * @return 璀﹀憡娑堟伅 + */ + public static <T> AjaxResult<T> error(String msg, T data) { + return new AjaxResult<>(HttpStatus.HTTP_INTERNAL_ERROR, msg, data); + } - /** - * 杩斿洖閿欒娑堟伅 - * - * @param code 鐘舵�佺爜 - * @param msg 杩斿洖鍐呭 - * @return 璀﹀憡娑堟伅 - */ - public static AjaxResult<Void> error(int code, String msg) { - return new AjaxResult<>(code, msg, null); - } + /** + * 杩斿洖閿欒娑堟伅 + * + * @param code 鐘舵�佺爜 + * @param msg 杩斿洖鍐呭 + * @return 璀﹀憡娑堟伅 + */ + public static AjaxResult<Void> error(int code, String msg) { + return new AjaxResult<>(code, msg, null); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index b218070..9c7857a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -21,48 +21,48 @@ @Accessors(chain = true) public class BaseEntity implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 鎼滅储鍊� - */ - @ApiModelProperty(value = "鎼滅储鍊�") - @TableField(exist = false) - private String searchValue; + /** + * 鎼滅储鍊� + */ + @ApiModelProperty(value = "鎼滅储鍊�") + @TableField(exist = false) + private String searchValue; - /** - * 鍒涘缓鑰� - */ - @ApiModelProperty(value = "鍒涘缓鑰�") - @TableField(fill = FieldFill.INSERT) - private String createBy; + /** + * 鍒涘缓鑰� + */ + @ApiModelProperty(value = "鍒涘缓鑰�") + @TableField(fill = FieldFill.INSERT) + private String createBy; - /** - * 鍒涘缓鏃堕棿 - */ - @ApiModelProperty(value = "鍒涘缓鏃堕棿") - @TableField(fill = FieldFill.INSERT) - private Date createTime; + /** + * 鍒涘缓鏃堕棿 + */ + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + private Date createTime; - /** - * 鏇存柊鑰� - */ - @ApiModelProperty(value = "鏇存柊鑰�") - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updateBy; + /** + * 鏇存柊鑰� + */ + @ApiModelProperty(value = "鏇存柊鑰�") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; - /** - * 鏇存柊鏃堕棿 - */ - @ApiModelProperty(value = "鏇存柊鏃堕棿") - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; + /** + * 鏇存柊鏃堕棿 + */ + @ApiModelProperty(value = "鏇存柊鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; - /** - * 璇锋眰鍙傛暟 - */ - @ApiModelProperty(value = "璇锋眰鍙傛暟") - @TableField(exist = false) - private Map<String, Object> params = new HashMap<>(); + /** + * 璇锋眰鍙傛暟 + */ + @ApiModelProperty(value = "璇锋眰鍙傛暟") + @TableField(exist = false) + private Map<String, Object> params = new HashMap<>(); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java index d82779a..5ffd588 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java @@ -21,7 +21,7 @@ @Accessors(chain = true) public class PageQuery implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; /** * 鍒嗛〉澶у皬 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java index c0e62c7..819e6b7 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java @@ -20,26 +20,26 @@ @Accessors(chain = true) public class TreeEntity extends BaseEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 鐖惰彍鍗曞悕绉� - */ - @TableField(exist = false) - @ApiModelProperty(value = "鐖惰彍鍗曞悕绉�") - private String parentName; + /** + * 鐖惰彍鍗曞悕绉� + */ + @TableField(exist = false) + @ApiModelProperty(value = "鐖惰彍鍗曞悕绉�") + private String parentName; - /** - * 鐖惰彍鍗旾D - */ - @ApiModelProperty(value = "鐖惰彍鍗旾D") - private Long parentId; + /** + * 鐖惰彍鍗旾D + */ + @ApiModelProperty(value = "鐖惰彍鍗旾D") + private Long parentId; - /** - * 瀛愰儴闂� - */ - @TableField(exist = false) - @ApiModelProperty(value = "瀛愰儴闂�") - private List<?> children = new ArrayList<>(); + /** + * 瀛愰儴闂� + */ + @TableField(exist = false) + @ApiModelProperty(value = "瀛愰儴闂�") + private List<?> children = new ArrayList<>(); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index 17ff660..860f2f2 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -26,68 +26,68 @@ @TableName("sys_dept") @ApiModel("閮ㄩ棬涓氬姟瀵硅薄") public class SysDept extends TreeEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 閮ㄩ棬ID - */ - @ApiModelProperty(value = "閮ㄩ棬id") - @TableId(value = "dept_id") - private Long deptId; + /** + * 閮ㄩ棬ID + */ + @ApiModelProperty(value = "閮ㄩ棬id") + @TableId(value = "dept_id") + private Long deptId; - /** - * 閮ㄩ棬鍚嶇О - */ - @ApiModelProperty(value = "閮ㄩ棬鍚嶇О") - @NotBlank(message = "閮ㄩ棬鍚嶇О涓嶈兘涓虹┖") - @Size(min = 0, max = 30, message = "閮ㄩ棬鍚嶇О闀垮害涓嶈兘瓒呰繃30涓瓧绗�") - private String deptName; + /** + * 閮ㄩ棬鍚嶇О + */ + @ApiModelProperty(value = "閮ㄩ棬鍚嶇О") + @NotBlank(message = "閮ㄩ棬鍚嶇О涓嶈兘涓虹┖") + @Size(min = 0, max = 30, message = "閮ㄩ棬鍚嶇О闀垮害涓嶈兘瓒呰繃30涓瓧绗�") + private String deptName; - /** - * 鏄剧ず椤哄簭 - */ - @ApiModelProperty(value = "鏄剧ず椤哄簭") - @NotBlank(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") - private String orderNum; + /** + * 鏄剧ず椤哄簭 + */ + @ApiModelProperty(value = "鏄剧ず椤哄簭") + @NotBlank(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") + private String orderNum; - /** - * 璐熻矗浜� - */ - @ApiModelProperty(value = "璐熻矗浜�") - private String leader; + /** + * 璐熻矗浜� + */ + @ApiModelProperty(value = "璐熻矗浜�") + private String leader; - /** - * 鑱旂郴鐢佃瘽 - */ - @ApiModelProperty(value = "鑱旂郴鐢佃瘽") - @Size(min = 0, max = 11, message = "鑱旂郴鐢佃瘽闀垮害涓嶈兘瓒呰繃11涓瓧绗�") - private String phone; + /** + * 鑱旂郴鐢佃瘽 + */ + @ApiModelProperty(value = "鑱旂郴鐢佃瘽") + @Size(min = 0, max = 11, message = "鑱旂郴鐢佃瘽闀垮害涓嶈兘瓒呰繃11涓瓧绗�") + private String phone; - /** - * 閭 - */ - @ApiModelProperty(value = "閭") - @Email(message = "閭鏍煎紡涓嶆纭�") - @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�") - private String email; + /** + * 閭 + */ + @ApiModelProperty(value = "閭") + @Email(message = "閭鏍煎紡涓嶆纭�") + @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�") + private String email; - /** - * 閮ㄩ棬鐘舵��:0姝e父,1鍋滅敤 - */ - @ApiModelProperty(value = "閮ㄩ棬鐘舵��:0姝e父,1鍋滅敤") - private String status; + /** + * 閮ㄩ棬鐘舵��:0姝e父,1鍋滅敤 + */ + @ApiModelProperty(value = "閮ㄩ棬鐘舵��:0姝e父,1鍋滅敤") + private String status; - /** - * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� - */ - @ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�") - @TableLogic - private String delFlag; + /** + * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� + */ + @ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�") + @TableLogic + private String delFlag; - /** - * 绁栫骇鍒楄〃 - */ - @ApiModelProperty(value = "绁栫骇鍒楄〃") - private String ancestors; + /** + * 绁栫骇鍒楄〃 + */ + @ApiModelProperty(value = "绁栫骇鍒楄〃") + private String ancestors; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java index 3c572bd..241aecd 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java @@ -31,85 +31,85 @@ @ApiModel("瀛楀吀鏁版嵁涓氬姟瀵硅薄") public class SysDictData extends BaseEntity { - /** - * 瀛楀吀缂栫爜 - */ - @ApiModelProperty(value = "瀛楀吀缂栫爜") - @ExcelProperty(value = "瀛楀吀缂栫爜") - @TableId(value = "dict_code") - private Long dictCode; + /** + * 瀛楀吀缂栫爜 + */ + @ApiModelProperty(value = "瀛楀吀缂栫爜") + @ExcelProperty(value = "瀛楀吀缂栫爜") + @TableId(value = "dict_code") + private Long dictCode; - /** - * 瀛楀吀鎺掑簭 - */ - @ApiModelProperty(value = "瀛楀吀鎺掑簭") - @ExcelProperty(value = "瀛楀吀鎺掑簭") - private Long dictSort; + /** + * 瀛楀吀鎺掑簭 + */ + @ApiModelProperty(value = "瀛楀吀鎺掑簭") + @ExcelProperty(value = "瀛楀吀鎺掑簭") + private Long dictSort; - /** - * 瀛楀吀鏍囩 - */ - @ApiModelProperty(value = "瀛楀吀鏍囩") - @ExcelProperty(value = "瀛楀吀鏍囩") - @NotBlank(message = "瀛楀吀鏍囩涓嶈兘涓虹┖") - @Size(min = 0, max = 100, message = "瀛楀吀鏍囩闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - private String dictLabel; + /** + * 瀛楀吀鏍囩 + */ + @ApiModelProperty(value = "瀛楀吀鏍囩") + @ExcelProperty(value = "瀛楀吀鏍囩") + @NotBlank(message = "瀛楀吀鏍囩涓嶈兘涓虹┖") + @Size(min = 0, max = 100, message = "瀛楀吀鏍囩闀垮害涓嶈兘瓒呰繃100涓瓧绗�") + private String dictLabel; - /** - * 瀛楀吀閿�� - */ - @ApiModelProperty(value = "瀛楀吀閿��") - @ExcelProperty(value = "瀛楀吀閿��") - @NotBlank(message = "瀛楀吀閿�间笉鑳戒负绌�") - @Size(min = 0, max = 100, message = "瀛楀吀閿�奸暱搴︿笉鑳借秴杩�100涓瓧绗�") - private String dictValue; + /** + * 瀛楀吀閿�� + */ + @ApiModelProperty(value = "瀛楀吀閿��") + @ExcelProperty(value = "瀛楀吀閿��") + @NotBlank(message = "瀛楀吀閿�间笉鑳戒负绌�") + @Size(min = 0, max = 100, message = "瀛楀吀閿�奸暱搴︿笉鑳借秴杩�100涓瓧绗�") + private String dictValue; - /** - * 瀛楀吀绫诲瀷 - */ - @ApiModelProperty(value = "瀛楀吀绫诲瀷") - @ExcelProperty(value = "瀛楀吀绫诲瀷") - @NotBlank(message = "瀛楀吀绫诲瀷涓嶈兘涓虹┖") - @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - private String dictType; + /** + * 瀛楀吀绫诲瀷 + */ + @ApiModelProperty(value = "瀛楀吀绫诲瀷") + @ExcelProperty(value = "瀛楀吀绫诲瀷") + @NotBlank(message = "瀛楀吀绫诲瀷涓嶈兘涓虹┖") + @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷闀垮害涓嶈兘瓒呰繃100涓瓧绗�") + private String dictType; - /** - * 鏍峰紡灞炴�э紙鍏朵粬鏍峰紡鎵╁睍锛� - */ - @ApiModelProperty(value = "鏍峰紡灞炴�э紙鍏朵粬鏍峰紡鎵╁睍锛�") - @Size(min = 0, max = 100, message = "鏍峰紡灞炴�ч暱搴︿笉鑳借秴杩�100涓瓧绗�") - private String cssClass; + /** + * 鏍峰紡灞炴�э紙鍏朵粬鏍峰紡鎵╁睍锛� + */ + @ApiModelProperty(value = "鏍峰紡灞炴�э紙鍏朵粬鏍峰紡鎵╁睍锛�") + @Size(min = 0, max = 100, message = "鏍峰紡灞炴�ч暱搴︿笉鑳借秴杩�100涓瓧绗�") + private String cssClass; - /** - * 琛ㄦ牸瀛楀吀鏍峰紡 - */ - @ApiModelProperty(value = "琛ㄦ牸瀛楀吀鏍峰紡") - private String listClass; + /** + * 琛ㄦ牸瀛楀吀鏍峰紡 + */ + @ApiModelProperty(value = "琛ㄦ牸瀛楀吀鏍峰紡") + private String listClass; - /** - * 鏄惁榛樿锛圷鏄� N鍚︼級 - */ - @ApiModelProperty(value = "鏄惁榛樿锛圷鏄� N鍚︼級") - @ExcelProperty(value = "鏄惁榛樿", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_yes_no") - private String isDefault; + /** + * 鏄惁榛樿锛圷鏄� N鍚︼級 + */ + @ApiModelProperty(value = "鏄惁榛樿锛圷鏄� N鍚︼級") + @ExcelProperty(value = "鏄惁榛樿", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_yes_no") + private String isDefault; - /** - * 鐘舵�侊紙0姝e父 1鍋滅敤锛� - */ - @ApiModelProperty(value = "鐘舵�侊紙0姝e父 1鍋滅敤锛�") - @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_normal_disable") - private String status; + /** + * 鐘舵�侊紙0姝e父 1鍋滅敤锛� + */ + @ApiModelProperty(value = "鐘舵�侊紙0姝e父 1鍋滅敤锛�") + @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; - /** - * 澶囨敞 - */ - @ApiModelProperty(value = "澶囨敞") - private String remark; + /** + * 澶囨敞 + */ + @ApiModelProperty(value = "澶囨敞") + private String remark; - public boolean getDefault() { - return UserConstants.YES.equals(this.isDefault); - } + public boolean getDefault() { + return UserConstants.YES.equals(this.isDefault); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java index c6c9b1a..702ec09 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java @@ -30,44 +30,44 @@ @ApiModel("瀛楀吀绫诲瀷涓氬姟瀵硅薄") public class SysDictType extends BaseEntity { - /** - * 瀛楀吀涓婚敭 - */ - @ApiModelProperty(value = "瀛楀吀涓婚敭") - @ExcelProperty(value = "瀛楀吀涓婚敭") - @TableId(value = "dict_id") - private Long dictId; + /** + * 瀛楀吀涓婚敭 + */ + @ApiModelProperty(value = "瀛楀吀涓婚敭") + @ExcelProperty(value = "瀛楀吀涓婚敭") + @TableId(value = "dict_id") + private Long dictId; - /** - * 瀛楀吀鍚嶇О - */ - @ApiModelProperty(value = "瀛楀吀鍚嶇О") - @ExcelProperty(value = "瀛楀吀鍚嶇О") - @NotBlank(message = "瀛楀吀鍚嶇О涓嶈兘涓虹┖") - @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷鍚嶇О闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - private String dictName; + /** + * 瀛楀吀鍚嶇О + */ + @ApiModelProperty(value = "瀛楀吀鍚嶇О") + @ExcelProperty(value = "瀛楀吀鍚嶇О") + @NotBlank(message = "瀛楀吀鍚嶇О涓嶈兘涓虹┖") + @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷鍚嶇О闀垮害涓嶈兘瓒呰繃100涓瓧绗�") + private String dictName; - /** - * 瀛楀吀绫诲瀷 - */ - @ApiModelProperty(value = "瀛楀吀绫诲瀷") - @ExcelProperty(value = "瀛楀吀绫诲瀷") - @NotBlank(message = "瀛楀吀绫诲瀷涓嶈兘涓虹┖") - @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷绫诲瀷闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - private String dictType; + /** + * 瀛楀吀绫诲瀷 + */ + @ApiModelProperty(value = "瀛楀吀绫诲瀷") + @ExcelProperty(value = "瀛楀吀绫诲瀷") + @NotBlank(message = "瀛楀吀绫诲瀷涓嶈兘涓虹┖") + @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷绫诲瀷闀垮害涓嶈兘瓒呰繃100涓瓧绗�") + private String dictType; - /** - * 鐘舵�侊紙0姝e父 1鍋滅敤锛� - */ - @ApiModelProperty(value = "鐘舵�侊紙0姝e父 1鍋滅敤锛�") - @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_normal_disable") - private String status; + /** + * 鐘舵�侊紙0姝e父 1鍋滅敤锛� + */ + @ApiModelProperty(value = "鐘舵�侊紙0姝e父 1鍋滅敤锛�") + @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_normal_disable") + private String status; - /** - * 澶囨敞 - */ - @ApiModelProperty(value = "澶囨敞") - private String remark; + /** + * 澶囨敞 + */ + @ApiModelProperty(value = "澶囨敞") + private String remark; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java index 8efc9f7..3febc94 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java @@ -26,97 +26,97 @@ @ApiModel("鑿滃崟鏉冮檺涓氬姟瀵硅薄") public class SysMenu extends TreeEntity { - /** - * 鑿滃崟ID - */ - @ApiModelProperty(value = "鑿滃崟ID") - @TableId(value = "menu_id") - private Long menuId; + /** + * 鑿滃崟ID + */ + @ApiModelProperty(value = "鑿滃崟ID") + @TableId(value = "menu_id") + private Long menuId; - /** - * 鑿滃崟鍚嶇О - */ - @ApiModelProperty(value = "鑿滃崟鍚嶇О") - @NotBlank(message = "鑿滃崟鍚嶇О涓嶈兘涓虹┖") - @Size(min = 0, max = 50, message = "鑿滃崟鍚嶇О闀垮害涓嶈兘瓒呰繃50涓瓧绗�") - private String menuName; + /** + * 鑿滃崟鍚嶇О + */ + @ApiModelProperty(value = "鑿滃崟鍚嶇О") + @NotBlank(message = "鑿滃崟鍚嶇О涓嶈兘涓虹┖") + @Size(min = 0, max = 50, message = "鑿滃崟鍚嶇О闀垮害涓嶈兘瓒呰繃50涓瓧绗�") + private String menuName; - /** - * 鏄剧ず椤哄簭 - */ - @ApiModelProperty(value = "鏄剧ず椤哄簭") - @NotBlank(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") - private String orderNum; + /** + * 鏄剧ず椤哄簭 + */ + @ApiModelProperty(value = "鏄剧ず椤哄簭") + @NotBlank(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") + private String orderNum; - /** - * 璺敱鍦板潃 - */ - @ApiModelProperty(value = "璺敱鍦板潃") - @Size(min = 0, max = 200, message = "璺敱鍦板潃涓嶈兘瓒呰繃200涓瓧绗�") - private String path; + /** + * 璺敱鍦板潃 + */ + @ApiModelProperty(value = "璺敱鍦板潃") + @Size(min = 0, max = 200, message = "璺敱鍦板潃涓嶈兘瓒呰繃200涓瓧绗�") + private String path; - /** - * 缁勪欢璺緞 - */ - @ApiModelProperty(value = "缁勪欢璺緞") - @Size(min = 0, max = 200, message = "缁勪欢璺緞涓嶈兘瓒呰繃255涓瓧绗�") - private String component; + /** + * 缁勪欢璺緞 + */ + @ApiModelProperty(value = "缁勪欢璺緞") + @Size(min = 0, max = 200, message = "缁勪欢璺緞涓嶈兘瓒呰繃255涓瓧绗�") + private String component; /** * 璺敱鍙傛暟 */ - @ApiModelProperty(value = "璺敱鍙傛暟") + @ApiModelProperty(value = "璺敱鍙傛暟") @TableField("`query`") private String query; - /** - * 鏄惁涓哄閾撅紙0鏄� 1鍚︼級 - */ - @ApiModelProperty(value = "鏄惁涓哄閾撅紙0鏄� 1鍚︼級") - private String isFrame; + /** + * 鏄惁涓哄閾撅紙0鏄� 1鍚︼級 + */ + @ApiModelProperty(value = "鏄惁涓哄閾撅紙0鏄� 1鍚︼級") + private String isFrame; - /** - * 鏄惁缂撳瓨锛�0缂撳瓨 1涓嶇紦瀛橈級 - */ - @ApiModelProperty(value = "鏄惁缂撳瓨锛�0缂撳瓨 1涓嶇紦瀛橈級") - private String isCache; + /** + * 鏄惁缂撳瓨锛�0缂撳瓨 1涓嶇紦瀛橈級 + */ + @ApiModelProperty(value = "鏄惁缂撳瓨锛�0缂撳瓨 1涓嶇紦瀛橈級") + private String isCache; - /** - * 绫诲瀷锛圡鐩綍 C鑿滃崟 F鎸夐挳锛� - */ - @ApiModelProperty(value = "绫诲瀷锛圡鐩綍 C鑿滃崟 F鎸夐挳锛�") - @NotBlank(message = "鑿滃崟绫诲瀷涓嶈兘涓虹┖") - private String menuType; + /** + * 绫诲瀷锛圡鐩綍 C鑿滃崟 F鎸夐挳锛� + */ + @ApiModelProperty(value = "绫诲瀷锛圡鐩綍 C鑿滃崟 F鎸夐挳锛�") + @NotBlank(message = "鑿滃崟绫诲瀷涓嶈兘涓虹┖") + private String menuType; - /** - * 鏄剧ず鐘舵�侊紙0鏄剧ず 1闅愯棌锛� - */ - @ApiModelProperty(value = "鏄剧ず鐘舵�侊紙0鏄剧ず 1闅愯棌锛�") - private String visible; + /** + * 鏄剧ず鐘舵�侊紙0鏄剧ず 1闅愯棌锛� + */ + @ApiModelProperty(value = "鏄剧ず鐘舵�侊紙0鏄剧ず 1闅愯棌锛�") + private String visible; - /** - * 鑿滃崟鐘舵�侊紙0鏄剧ず 1闅愯棌锛� - */ - @ApiModelProperty(value = "鑿滃崟鐘舵�侊紙0鏄剧ず 1闅愯棌锛�") - private String status; + /** + * 鑿滃崟鐘舵�侊紙0鏄剧ず 1闅愯棌锛� + */ + @ApiModelProperty(value = "鑿滃崟鐘舵�侊紙0鏄剧ず 1闅愯棌锛�") + private String status; - /** - * 鏉冮檺瀛楃涓� - */ - @ApiModelProperty(value = "鏉冮檺瀛楃涓�") - @Size(min = 0, max = 100, message = "鏉冮檺鏍囪瘑闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - private String perms; + /** + * 鏉冮檺瀛楃涓� + */ + @ApiModelProperty(value = "鏉冮檺瀛楃涓�") + @Size(min = 0, max = 100, message = "鏉冮檺鏍囪瘑闀垮害涓嶈兘瓒呰繃100涓瓧绗�") + private String perms; - /** - * 鑿滃崟鍥炬爣 - */ - @ApiModelProperty(value = "鑿滃崟鍥炬爣") - private String icon; + /** + * 鑿滃崟鍥炬爣 + */ + @ApiModelProperty(value = "鑿滃崟鍥炬爣") + private String icon; - /** - * 澶囨敞 - */ - @ApiModelProperty(value = "澶囨敞") - private String remark; + /** + * 澶囨敞 + */ + @ApiModelProperty(value = "澶囨敞") + private String remark; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java index 1d186db..3153e41 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java @@ -32,113 +32,113 @@ @ExcelIgnoreUnannotated public class SysRole extends BaseEntity { - /** - * 瑙掕壊ID - */ - @ApiModelProperty(value = "瑙掕壊ID") - @ExcelProperty(value = "瑙掕壊搴忓彿") - @TableId(value = "role_id") - private Long roleId; + /** + * 瑙掕壊ID + */ + @ApiModelProperty(value = "瑙掕壊ID") + @ExcelProperty(value = "瑙掕壊搴忓彿") + @TableId(value = "role_id") + private Long roleId; - /** - * 瑙掕壊鍚嶇О - */ - @ApiModelProperty(value = "瑙掕壊鍚嶇О") - @ExcelProperty(value = "瑙掕壊鍚嶇О") - @NotBlank(message = "瑙掕壊鍚嶇О涓嶈兘涓虹┖") - @Size(min = 0, max = 30, message = "瑙掕壊鍚嶇О闀垮害涓嶈兘瓒呰繃30涓瓧绗�") - private String roleName; + /** + * 瑙掕壊鍚嶇О + */ + @ApiModelProperty(value = "瑙掕壊鍚嶇О") + @ExcelProperty(value = "瑙掕壊鍚嶇О") + @NotBlank(message = "瑙掕壊鍚嶇О涓嶈兘涓虹┖") + @Size(min = 0, max = 30, message = "瑙掕壊鍚嶇О闀垮害涓嶈兘瓒呰繃30涓瓧绗�") + private String roleName; - /** - * 瑙掕壊鏉冮檺 - */ - @ApiModelProperty(value = "瑙掕壊鏉冮檺") - @ExcelProperty(value = "瑙掕壊鏉冮檺") - @NotBlank(message = "鏉冮檺瀛楃涓嶈兘涓虹┖") - @Size(min = 0, max = 100, message = "鏉冮檺瀛楃闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - private String roleKey; + /** + * 瑙掕壊鏉冮檺 + */ + @ApiModelProperty(value = "瑙掕壊鏉冮檺") + @ExcelProperty(value = "瑙掕壊鏉冮檺") + @NotBlank(message = "鏉冮檺瀛楃涓嶈兘涓虹┖") + @Size(min = 0, max = 100, message = "鏉冮檺瀛楃闀垮害涓嶈兘瓒呰繃100涓瓧绗�") + private String roleKey; - /** - * 瑙掕壊鎺掑簭 - */ - @ApiModelProperty(value = "瑙掕壊鎺掑簭") - @ExcelProperty(value = "瑙掕壊鎺掑簭") - @NotBlank(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") - private String roleSort; + /** + * 瑙掕壊鎺掑簭 + */ + @ApiModelProperty(value = "瑙掕壊鎺掑簭") + @ExcelProperty(value = "瑙掕壊鎺掑簭") + @NotBlank(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") + private String roleSort; - /** - * 鏁版嵁鑼冨洿锛�1锛氭墍鏈夋暟鎹潈闄愶紱2锛氳嚜瀹氫箟鏁版嵁鏉冮檺锛�3锛氭湰閮ㄩ棬鏁版嵁鏉冮檺锛�4锛氭湰閮ㄩ棬鍙婁互涓嬫暟鎹潈闄愶紱5锛氫粎鏈汉鏁版嵁鏉冮檺锛� - */ - @ApiModelProperty(value = "鏁版嵁鑼冨洿锛�1锛氭墍鏈夋暟鎹潈闄愶紱2锛氳嚜瀹氫箟鏁版嵁鏉冮檺锛�3锛氭湰閮ㄩ棬鏁版嵁鏉冮檺锛�4锛氭湰閮ㄩ棬鍙婁互涓嬫暟鎹潈闄愶紱5锛氫粎鏈汉鏁版嵁鏉冮檺锛�") - @ExcelProperty(value = "鏁版嵁鑼冨洿", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "1=鎵�鏈夋暟鎹潈闄�,2=鑷畾涔夋暟鎹潈闄�,3=鏈儴闂ㄦ暟鎹潈闄�,4=鏈儴闂ㄥ強浠ヤ笅鏁版嵁鏉冮檺,5=浠呮湰浜烘暟鎹潈闄�") - private String dataScope; + /** + * 鏁版嵁鑼冨洿锛�1锛氭墍鏈夋暟鎹潈闄愶紱2锛氳嚜瀹氫箟鏁版嵁鏉冮檺锛�3锛氭湰閮ㄩ棬鏁版嵁鏉冮檺锛�4锛氭湰閮ㄩ棬鍙婁互涓嬫暟鎹潈闄愶紱5锛氫粎鏈汉鏁版嵁鏉冮檺锛� + */ + @ApiModelProperty(value = "鏁版嵁鑼冨洿锛�1锛氭墍鏈夋暟鎹潈闄愶紱2锛氳嚜瀹氫箟鏁版嵁鏉冮檺锛�3锛氭湰閮ㄩ棬鏁版嵁鏉冮檺锛�4锛氭湰閮ㄩ棬鍙婁互涓嬫暟鎹潈闄愶紱5锛氫粎鏈汉鏁版嵁鏉冮檺锛�") + @ExcelProperty(value = "鏁版嵁鑼冨洿", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=鎵�鏈夋暟鎹潈闄�,2=鑷畾涔夋暟鎹潈闄�,3=鏈儴闂ㄦ暟鎹潈闄�,4=鏈儴闂ㄥ強浠ヤ笅鏁版嵁鏉冮檺,5=浠呮湰浜烘暟鎹潈闄�") + private String dataScope; - /** - * 鑿滃崟鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙 0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀猴級 - */ - @ApiModelProperty(value = "鑿滃崟鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙 0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀猴級") - private boolean menuCheckStrictly; + /** + * 鑿滃崟鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙 0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀猴級 + */ + @ApiModelProperty(value = "鑿滃崟鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙 0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀猴級") + private boolean menuCheckStrictly; - /** - * 閮ㄩ棬鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀� 锛� - */ - @ApiModelProperty(value = "閮ㄩ棬鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀� 锛�") - private boolean deptCheckStrictly; + /** + * 閮ㄩ棬鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀� 锛� + */ + @ApiModelProperty(value = "閮ㄩ棬鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀� 锛�") + private boolean deptCheckStrictly; - /** - * 瑙掕壊鐘舵�侊紙0姝e父 1鍋滅敤锛� - */ - @ApiModelProperty(value = "瑙掕壊鐘舵�侊紙0姝e父 1鍋滅敤锛�") - @ExcelProperty(value = "瑙掕壊鐘舵��", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_common_status") - private String status; + /** + * 瑙掕壊鐘舵�侊紙0姝e父 1鍋滅敤锛� + */ + @ApiModelProperty(value = "瑙掕壊鐘舵�侊紙0姝e父 1鍋滅敤锛�") + @ExcelProperty(value = "瑙掕壊鐘舵��", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_common_status") + private String status; - /** - * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� - */ - @ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�") - @TableLogic - private String delFlag; + /** + * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� + */ + @ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�") + @TableLogic + private String delFlag; - /** - * 澶囨敞 - */ - @ApiModelProperty(value = "澶囨敞") - private String remark; + /** + * 澶囨敞 + */ + @ApiModelProperty(value = "澶囨敞") + private String remark; - /** - * 鐢ㄦ埛鏄惁瀛樺湪姝よ鑹叉爣璇� 榛樿涓嶅瓨鍦� - */ - @ApiModelProperty(value = "鐢ㄦ埛鏄惁瀛樺湪姝よ鑹叉爣璇� 榛樿涓嶅瓨鍦�") - @TableField(exist = false) - private boolean flag = false; + /** + * 鐢ㄦ埛鏄惁瀛樺湪姝よ鑹叉爣璇� 榛樿涓嶅瓨鍦� + */ + @ApiModelProperty(value = "鐢ㄦ埛鏄惁瀛樺湪姝よ鑹叉爣璇� 榛樿涓嶅瓨鍦�") + @TableField(exist = false) + private boolean flag = false; - /** - * 鑿滃崟缁� - */ - @ApiModelProperty(value = "鑿滃崟缁�") - @TableField(exist = false) - private Long[] menuIds; + /** + * 鑿滃崟缁� + */ + @ApiModelProperty(value = "鑿滃崟缁�") + @TableField(exist = false) + private Long[] menuIds; - /** - * 閮ㄩ棬缁勶紙鏁版嵁鏉冮檺锛� - */ - @ApiModelProperty(value = "閮ㄩ棬缁勶紙鏁版嵁鏉冮檺锛�") - @TableField(exist = false) - private Long[] deptIds; + /** + * 閮ㄩ棬缁勶紙鏁版嵁鏉冮檺锛� + */ + @ApiModelProperty(value = "閮ㄩ棬缁勶紙鏁版嵁鏉冮檺锛�") + @TableField(exist = false) + private Long[] deptIds; - public SysRole(Long roleId) { - this.roleId = roleId; - } + public SysRole(Long roleId) { + this.roleId = roleId; + } - @ApiModelProperty(value = "鏄惁绠$悊鍛�") - public boolean isAdmin() { - return isAdmin(this.roleId); - } + @ApiModelProperty(value = "鏄惁绠$悊鍛�") + public boolean isAdmin() { + return isAdmin(this.roleId); + } - public static boolean isAdmin(Long roleId) { - return roleId != null && 1L == roleId; - } + public static boolean isAdmin(Long roleId) { + return roleId != null && 1L == roleId; + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 2d991a5..09b82e9 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -34,158 +34,158 @@ @ApiModel("鐢ㄦ埛淇℃伅涓氬姟瀵硅薄") public class SysUser extends BaseEntity { - /** - * 鐢ㄦ埛ID - */ - @ApiModelProperty(value = "鐢ㄦ埛ID") - @TableId(value = "user_id") - private Long userId; + /** + * 鐢ㄦ埛ID + */ + @ApiModelProperty(value = "鐢ㄦ埛ID") + @TableId(value = "user_id") + private Long userId; - /** - * 閮ㄩ棬ID - */ - @ApiModelProperty(value = "閮ㄩ棬ID") - private Long deptId; + /** + * 閮ㄩ棬ID + */ + @ApiModelProperty(value = "閮ㄩ棬ID") + private Long deptId; - /** - * 鐢ㄦ埛璐﹀彿 - */ - @ApiModelProperty(value = "鐢ㄦ埛璐﹀彿") + /** + * 鐢ㄦ埛璐﹀彿 + */ + @ApiModelProperty(value = "鐢ㄦ埛璐﹀彿") @Xss(message = "鐢ㄦ埛璐﹀彿涓嶈兘鍖呭惈鑴氭湰瀛楃") @NotBlank(message = "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖") - @Size(min = 0, max = 30, message = "鐢ㄦ埛璐﹀彿闀垮害涓嶈兘瓒呰繃30涓瓧绗�") - private String userName; + @Size(min = 0, max = 30, message = "鐢ㄦ埛璐﹀彿闀垮害涓嶈兘瓒呰繃30涓瓧绗�") + private String userName; - /** - * 鐢ㄦ埛鏄电О - */ + /** + * 鐢ㄦ埛鏄电О + */ @ApiModelProperty(value = "鐢ㄦ埛鏄电О") @Xss(message = "鐢ㄦ埛鏄电О涓嶈兘鍖呭惈鑴氭湰瀛楃") @Size(min = 0, max = 30, message = "鐢ㄦ埛鏄电О闀垮害涓嶈兘瓒呰繃30涓瓧绗�") - private String nickName; + private String nickName; - /** - * 鐢ㄦ埛閭 - */ + /** + * 鐢ㄦ埛閭 + */ @Sensitive(strategy = SensitiveStrategy.EMAIL) - @ApiModelProperty(value = "鐢ㄦ埛閭") - @Email(message = "閭鏍煎紡涓嶆纭�") - @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�") - private String email; + @ApiModelProperty(value = "鐢ㄦ埛閭") + @Email(message = "閭鏍煎紡涓嶆纭�") + @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�") + private String email; - /** - * 鎵嬫満鍙风爜 - */ + /** + * 鎵嬫満鍙风爜 + */ @Sensitive(strategy = SensitiveStrategy.PHONE) - @ApiModelProperty(value = "鎵嬫満鍙风爜") - private String phonenumber; + @ApiModelProperty(value = "鎵嬫満鍙风爜") + private String phonenumber; - /** - * 鐢ㄦ埛鎬у埆 - */ - @ApiModelProperty(value = "鐢ㄦ埛鎬у埆") - private String sex; + /** + * 鐢ㄦ埛鎬у埆 + */ + @ApiModelProperty(value = "鐢ㄦ埛鎬у埆") + private String sex; - /** - * 鐢ㄦ埛澶村儚 - */ - @ApiModelProperty(value = "鐢ㄦ埛澶村儚") - private String avatar; + /** + * 鐢ㄦ埛澶村儚 + */ + @ApiModelProperty(value = "鐢ㄦ埛澶村儚") + private String avatar; - /** - * 瀵嗙爜 - */ - @ApiModelProperty(value = "瀵嗙爜") - @TableField( - insertStrategy = FieldStrategy.NOT_EMPTY, - updateStrategy = FieldStrategy.NOT_EMPTY, - whereStrategy = FieldStrategy.NOT_EMPTY - ) - private String password; + /** + * 瀵嗙爜 + */ + @ApiModelProperty(value = "瀵嗙爜") + @TableField( + insertStrategy = FieldStrategy.NOT_EMPTY, + updateStrategy = FieldStrategy.NOT_EMPTY, + whereStrategy = FieldStrategy.NOT_EMPTY + ) + private String password; - @JsonIgnore - @JsonProperty - public String getPassword() { - return password; - } + @JsonIgnore + @JsonProperty + public String getPassword() { + return password; + } - /** - * 甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛� - */ - @ApiModelProperty(value = "甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛�") - private String status; + /** + * 甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛� + */ + @ApiModelProperty(value = "甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛�") + private String status; - /** - * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� - */ - @ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�") - @TableLogic - private String delFlag; + /** + * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� + */ + @ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�") + @TableLogic + private String delFlag; - /** - * 鏈�鍚庣櫥褰旾P - */ - @ApiModelProperty(value = "鏈�鍚庣櫥褰旾P") - private String loginIp; + /** + * 鏈�鍚庣櫥褰旾P + */ + @ApiModelProperty(value = "鏈�鍚庣櫥褰旾P") + private String loginIp; - /** - * 鏈�鍚庣櫥褰曟椂闂� - */ - @ApiModelProperty(value = "鏈�鍚庣櫥褰曟椂闂�") - private Date loginDate; + /** + * 鏈�鍚庣櫥褰曟椂闂� + */ + @ApiModelProperty(value = "鏈�鍚庣櫥褰曟椂闂�") + private Date loginDate; - /** - * 澶囨敞 - */ - @ApiModelProperty(value = "澶囨敞") - private String remark; + /** + * 澶囨敞 + */ + @ApiModelProperty(value = "澶囨敞") + private String remark; - /** - * 閮ㄩ棬瀵硅薄 - */ - @ApiModelProperty(value = "閮ㄩ棬瀵硅薄") - @TableField(exist = false) - private SysDept dept; + /** + * 閮ㄩ棬瀵硅薄 + */ + @ApiModelProperty(value = "閮ㄩ棬瀵硅薄") + @TableField(exist = false) + private SysDept dept; - /** - * 瑙掕壊瀵硅薄 - */ - @ApiModelProperty(value = "瑙掕壊瀵硅薄") - @TableField(exist = false) - private List<SysRole> roles; + /** + * 瑙掕壊瀵硅薄 + */ + @ApiModelProperty(value = "瑙掕壊瀵硅薄") + @TableField(exist = false) + private List<SysRole> roles; - /** - * 瑙掕壊缁� - */ - @ApiModelProperty(value = "瑙掕壊缁�") - @TableField(exist = false) - private Long[] roleIds; + /** + * 瑙掕壊缁� + */ + @ApiModelProperty(value = "瑙掕壊缁�") + @TableField(exist = false) + private Long[] roleIds; - /** - * 宀椾綅缁� - */ - @ApiModelProperty(value = "宀椾綅缁�") - @TableField(exist = false) - private Long[] postIds; + /** + * 宀椾綅缁� + */ + @ApiModelProperty(value = "宀椾綅缁�") + @TableField(exist = false) + private Long[] postIds; - /** - * 鏁版嵁鏉冮檺 褰撳墠瑙掕壊ID - */ - @ApiModelProperty(value = "瑙掕壊ID") - @TableField(exist = false) - private Long roleId; + /** + * 鏁版嵁鏉冮檺 褰撳墠瑙掕壊ID + */ + @ApiModelProperty(value = "瑙掕壊ID") + @TableField(exist = false) + private Long roleId; - public SysUser(Long userId) { - this.userId = userId; - } + public SysUser(Long userId) { + this.userId = userId; + } - @ApiModelProperty(value = "鏄惁绠$悊鍛�") - public boolean isAdmin() { - return isAdmin(this.userId); - } + @ApiModelProperty(value = "鏄惁绠$悊鍛�") + public boolean isAdmin() { + return isAdmin(this.userId); + } - public static boolean isAdmin(Long userId) { - return userId != null && 1L == userId; - } + public static boolean isAdmin(Long userId) { + return userId != null && 1L == userId; + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/BaseMapperPlus.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/BaseMapperPlus.java index e11ec94..9532db3 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/BaseMapperPlus.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/BaseMapperPlus.java @@ -22,15 +22,15 @@ */ public interface BaseMapperPlus<T> extends BaseMapper<T> { - /** - * 鍗晄ql鎵归噺鎻掑叆( 鍏ㄩ噺濉厖 ) - */ - int insertAll(@Param("list") Collection<T> batchList); + /** + * 鍗晄ql鎵归噺鎻掑叆( 鍏ㄩ噺濉厖 ) + */ + int insertAll(@Param("list") Collection<T> batchList); /** * 鏍规嵁 ID 鏌ヨ */ - default <V> V selectVoById(Serializable id, Class<V> voClass){ + default <V> V selectVoById(Serializable id, Class<V> voClass) { T obj = this.selectById(id); if (ObjectUtil.isNull(obj)) { return null; @@ -41,7 +41,7 @@ /** * 鏌ヨ锛堟牴鎹甀D 鎵归噺鏌ヨ锛� */ - default <V> List<V> selectVoBatchIds(Collection<? extends Serializable> idList, Class<V> voClass){ + default <V> List<V> selectVoBatchIds(Collection<? extends Serializable> idList, Class<V> voClass) { List<T> list = this.selectBatchIds(idList); if (CollUtil.isEmpty(list)) { return CollUtil.newArrayList(); @@ -52,7 +52,7 @@ /** * 鏌ヨ锛堟牴鎹� columnMap 鏉′欢锛� */ - default <V> List<V> selectVoByMap(Map<String, Object> map, Class<V> voClass){ + default <V> List<V> selectVoByMap(Map<String, Object> map, Class<V> voClass) { List<T> list = this.selectByMap(map); if (CollUtil.isEmpty(list)) { return CollUtil.newArrayList(); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/IServicePlus.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/IServicePlus.java index f45a14e..897b246 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/IServicePlus.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/IServicePlus.java @@ -19,98 +19,98 @@ */ public interface IServicePlus<T, V> extends IService<T> { - /** - * @param id 涓婚敭id - * @return V瀵硅薄 - */ - V getVoById(Serializable id); + /** + * @param id 涓婚敭id + * @return V瀵硅薄 + */ + V getVoById(Serializable id); - /** - * @param convertor 鑷畾涔夎浆鎹㈠櫒 - */ - default V getVoById(Serializable id, Function<T, V> convertor) { - return convertor.apply(getById(id)); - } + /** + * @param convertor 鑷畾涔夎浆鎹㈠櫒 + */ + default V getVoById(Serializable id, Function<T, V> convertor) { + return convertor.apply(getById(id)); + } - /** - * @param idList id鍒楄〃 - * @return V瀵硅薄 - */ - List<V> listVoByIds(Collection<? extends Serializable> idList); + /** + * @param idList id鍒楄〃 + * @return V瀵硅薄 + */ + List<V> listVoByIds(Collection<? extends Serializable> idList); - /** - * @param convertor 鑷畾涔夎浆鎹㈠櫒 - */ - default List<V> listVoByIds(Collection<? extends Serializable> idList, - Function<Collection<T>, List<V>> convertor) { - List<T> list = getBaseMapper().selectBatchIds(idList); - if (list == null) { - return null; - } - return convertor.apply(list); - } + /** + * @param convertor 鑷畾涔夎浆鎹㈠櫒 + */ + default List<V> listVoByIds(Collection<? extends Serializable> idList, + Function<Collection<T>, List<V>> convertor) { + List<T> list = getBaseMapper().selectBatchIds(idList); + if (list == null) { + return null; + } + return convertor.apply(list); + } - /** - * @param columnMap 琛ㄥ瓧娈� map 瀵硅薄 - * @return V瀵硅薄 - */ - List<V> listVoByMap(Map<String, Object> columnMap); + /** + * @param columnMap 琛ㄥ瓧娈� map 瀵硅薄 + * @return V瀵硅薄 + */ + List<V> listVoByMap(Map<String, Object> columnMap); - /** - * @param convertor 鑷畾涔夎浆鎹㈠櫒 - */ - default List<V> listVoByMap(Map<String, Object> columnMap, - Function<Collection<T>, List<V>> convertor) { - List<T> list = getBaseMapper().selectByMap(columnMap); - if (list == null) { - return null; - } - return convertor.apply(list); - } + /** + * @param convertor 鑷畾涔夎浆鎹㈠櫒 + */ + default List<V> listVoByMap(Map<String, Object> columnMap, + Function<Collection<T>, List<V>> convertor) { + List<T> list = getBaseMapper().selectByMap(columnMap); + if (list == null) { + return null; + } + return convertor.apply(list); + } - /** - * @param queryWrapper 鏌ヨ鏉′欢 - * @return V瀵硅薄 - */ - V getVoOne(Wrapper<T> queryWrapper); + /** + * @param queryWrapper 鏌ヨ鏉′欢 + * @return V瀵硅薄 + */ + V getVoOne(Wrapper<T> queryWrapper); - /** - * @param convertor 鑷畾涔夎浆鎹㈠櫒 - */ - default V getVoOne(Wrapper<T> queryWrapper, Function<T, V> convertor) { - return convertor.apply(getOne(queryWrapper, true)); - } + /** + * @param convertor 鑷畾涔夎浆鎹㈠櫒 + */ + default V getVoOne(Wrapper<T> queryWrapper, Function<T, V> convertor) { + return convertor.apply(getOne(queryWrapper, true)); + } - /** - * @param queryWrapper 鏌ヨ鏉′欢 - * @return V瀵硅薄 - */ - List<V> listVo(Wrapper<T> queryWrapper); + /** + * @param queryWrapper 鏌ヨ鏉′欢 + * @return V瀵硅薄 + */ + List<V> listVo(Wrapper<T> queryWrapper); - /** - * @param convertor 鑷畾涔夎浆鎹㈠櫒 - */ - default List<V> listVo(Wrapper<T> queryWrapper, Function<Collection<T>, List<V>> convertor) { - List<T> list = getBaseMapper().selectList(queryWrapper); - if (list == null) { - return null; - } - return convertor.apply(list); - } + /** + * @param convertor 鑷畾涔夎浆鎹㈠櫒 + */ + default List<V> listVo(Wrapper<T> queryWrapper, Function<Collection<T>, List<V>> convertor) { + List<T> list = getBaseMapper().selectList(queryWrapper); + if (list == null) { + return null; + } + return convertor.apply(list); + } - default List<V> listVo() { - return listVo(Wrappers.emptyWrapper()); - } + default List<V> listVo() { + return listVo(Wrappers.emptyWrapper()); + } - /** - * @param convertor 鑷畾涔夎浆鎹㈠櫒 - */ - default List<V> listVo(Function<Collection<T>, List<V>> convertor) { - return listVo(Wrappers.emptyWrapper(), convertor); - } + /** + * @param convertor 鑷畾涔夎浆鎹㈠櫒 + */ + default List<V> listVo(Function<Collection<T>, List<V>> convertor) { + return listVo(Wrappers.emptyWrapper(), convertor); + } - boolean saveAll(Collection<T> entityList); + boolean saveAll(Collection<T> entityList); - boolean saveOrUpdateAll(Collection<T> entityList); + boolean saveOrUpdateAll(Collection<T> entityList); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/ServicePlusImpl.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/ServicePlusImpl.java index 740cc28..50f8480 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/ServicePlusImpl.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/ServicePlusImpl.java @@ -31,172 +31,172 @@ @SuppressWarnings("unchecked") public class ServicePlusImpl<M extends BaseMapperPlus<T>, T, V> extends ServiceImpl<M, T> implements IServicePlus<T, V> { - @Autowired - protected M baseMapper; + @Autowired + protected M baseMapper; - @Override - public M getBaseMapper() { - return baseMapper; - } + @Override + public M getBaseMapper() { + return baseMapper; + } - protected Class<T> entityClass = currentModelClass(); + protected Class<T> entityClass = currentModelClass(); - @Override - public Class<T> getEntityClass() { - return entityClass; - } + @Override + public Class<T> getEntityClass() { + return entityClass; + } - protected Class<M> mapperClass = currentMapperClass(); + protected Class<M> mapperClass = currentMapperClass(); - protected Class<V> voClass = currentVoClass(); + protected Class<V> voClass = currentVoClass(); - public Class<V> getVoClass() { - return voClass; - } + public Class<V> getVoClass() { + return voClass; + } - @Override - protected Class<M> currentMapperClass() { - return (Class<M>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServicePlusImpl.class, 0); - } + @Override + protected Class<M> currentMapperClass() { + return (Class<M>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServicePlusImpl.class, 0); + } - @Override - protected Class<T> currentModelClass() { - return (Class<T>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServicePlusImpl.class, 1); - } + @Override + protected Class<T> currentModelClass() { + return (Class<T>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServicePlusImpl.class, 1); + } - protected Class<V> currentVoClass() { - return (Class<V>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServicePlusImpl.class, 2); - } + protected Class<V> currentVoClass() { + return (Class<V>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServicePlusImpl.class, 2); + } - /** - * 鍗曟潯鎵ц鎬ц兘宸� 閫傜敤浜庡垪琛ㄥ璞″唴瀹逛笉纭畾 - */ - @Override - public boolean saveBatch(Collection<T> entityList, int batchSize) { - return super.saveBatch(entityList, batchSize); - } + /** + * 鍗曟潯鎵ц鎬ц兘宸� 閫傜敤浜庡垪琛ㄥ璞″唴瀹逛笉纭畾 + */ + @Override + public boolean saveBatch(Collection<T> entityList, int batchSize) { + return super.saveBatch(entityList, batchSize); + } - @Override - public boolean saveOrUpdate(T entity) { - return super.saveOrUpdate(entity); - } + @Override + public boolean saveOrUpdate(T entity) { + return super.saveOrUpdate(entity); + } - /** - * 鍗曟潯鎵ц鎬ц兘宸� 閫傜敤浜庡垪琛ㄥ璞″唴瀹逛笉纭畾 - */ - @Override - public boolean saveOrUpdateBatch(Collection<T> entityList, int batchSize) { - return super.saveOrUpdateBatch(entityList, batchSize); - } + /** + * 鍗曟潯鎵ц鎬ц兘宸� 閫傜敤浜庡垪琛ㄥ璞″唴瀹逛笉纭畾 + */ + @Override + public boolean saveOrUpdateBatch(Collection<T> entityList, int batchSize) { + return super.saveOrUpdateBatch(entityList, batchSize); + } - @Override - public boolean updateBatchById(Collection<T> entityList, int batchSize) { - return super.updateBatchById(entityList, batchSize); - } + @Override + public boolean updateBatchById(Collection<T> entityList, int batchSize) { + return super.updateBatchById(entityList, batchSize); + } - /** - * 鍗晄ql鎵归噺鎻掑叆( 鍏ㄩ噺濉厖 鏃犺鏁版嵁搴撻粯璁ゅ�� ) - * 閫傜敤浜庢棤鑴戞彃鍏� - */ - @Override - public boolean saveBatch(Collection<T> entityList) { - return saveBatch(entityList, DEFAULT_BATCH_SIZE); - } + /** + * 鍗晄ql鎵归噺鎻掑叆( 鍏ㄩ噺濉厖 鏃犺鏁版嵁搴撻粯璁ゅ�� ) + * 閫傜敤浜庢棤鑴戞彃鍏� + */ + @Override + public boolean saveBatch(Collection<T> entityList) { + return saveBatch(entityList, DEFAULT_BATCH_SIZE); + } - @Override - public boolean saveOrUpdateBatch(Collection<T> entityList) { - return saveOrUpdateBatch(entityList, DEFAULT_BATCH_SIZE); - } + @Override + public boolean saveOrUpdateBatch(Collection<T> entityList) { + return saveOrUpdateBatch(entityList, DEFAULT_BATCH_SIZE); + } - @Override - public boolean updateBatchById(Collection<T> entityList) { - return updateBatchById(entityList, DEFAULT_BATCH_SIZE); - } + @Override + public boolean updateBatchById(Collection<T> entityList) { + return updateBatchById(entityList, DEFAULT_BATCH_SIZE); + } - /** - * 鍗晄ql鎵归噺鎻掑叆( 鍏ㄩ噺濉厖 ) - */ - @Override - public boolean saveAll(Collection<T> entityList) { - if (CollUtil.isEmpty(entityList)) { - return false; - } - return baseMapper.insertAll(entityList) == entityList.size(); - } + /** + * 鍗晄ql鎵归噺鎻掑叆( 鍏ㄩ噺濉厖 ) + */ + @Override + public boolean saveAll(Collection<T> entityList) { + if (CollUtil.isEmpty(entityList)) { + return false; + } + return baseMapper.insertAll(entityList) == entityList.size(); + } - /** - * 鍏ㄩ噺淇濆瓨鎴栨洿鏂� ( 鎸変富閿尯鍒� ) - */ - @Override - public boolean saveOrUpdateAll(Collection<T> entityList) { - if (CollUtil.isEmpty(entityList)) { - return false; - } - TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass); - Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!"); - String keyProperty = tableInfo.getKeyProperty(); - Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!"); - List<T> addList = new ArrayList<>(); - List<T> updateList = new ArrayList<>(); - int row = 0; - for (T entity : entityList) { - Object id = ReflectUtils.invokeGetter(entity, keyProperty); - if (ObjectUtil.isNull(id)) { - addList.add(entity); - } else { - updateList.add(entity); - } - } - if (CollUtil.isNotEmpty(updateList) && updateBatchById(updateList)) { - row += updateList.size(); - } + /** + * 鍏ㄩ噺淇濆瓨鎴栨洿鏂� ( 鎸変富閿尯鍒� ) + */ + @Override + public boolean saveOrUpdateAll(Collection<T> entityList) { + if (CollUtil.isEmpty(entityList)) { + return false; + } + TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass); + Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!"); + String keyProperty = tableInfo.getKeyProperty(); + Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!"); + List<T> addList = new ArrayList<>(); + List<T> updateList = new ArrayList<>(); + int row = 0; + for (T entity : entityList) { + Object id = ReflectUtils.invokeGetter(entity, keyProperty); + if (ObjectUtil.isNull(id)) { + addList.add(entity); + } else { + updateList.add(entity); + } + } + if (CollUtil.isNotEmpty(updateList) && updateBatchById(updateList)) { + row += updateList.size(); + } if (CollUtil.isNotEmpty(addList)) { row += baseMapper.insertAll(addList); } - return row == entityList.size(); - } + return row == entityList.size(); + } - /** - * 鏍规嵁 ID 鏌ヨ - */ - @Override - public V getVoById(Serializable id) { + /** + * 鏍规嵁 ID 鏌ヨ + */ + @Override + public V getVoById(Serializable id) { return getBaseMapper().selectVoById(id, voClass); - } + } - /** - * 鏌ヨ锛堟牴鎹甀D 鎵归噺鏌ヨ锛� - */ - @Override - public List<V> listVoByIds(Collection<? extends Serializable> idList) { + /** + * 鏌ヨ锛堟牴鎹甀D 鎵归噺鏌ヨ锛� + */ + @Override + public List<V> listVoByIds(Collection<? extends Serializable> idList) { return getBaseMapper().selectVoBatchIds(idList, voClass); - } + } - /** - * 鏌ヨ锛堟牴鎹� columnMap 鏉′欢锛� - */ - @Override - public List<V> listVoByMap(Map<String, Object> columnMap) { + /** + * 鏌ヨ锛堟牴鎹� columnMap 鏉′欢锛� + */ + @Override + public List<V> listVoByMap(Map<String, Object> columnMap) { return getBaseMapper().selectVoByMap(columnMap, voClass); - } + } - /** - * 鏍规嵁 Wrapper锛屾煡璇竴鏉¤褰� <br/> - * <p>缁撴灉闆嗭紝濡傛灉鏄涓細鎶涘嚭寮傚父锛岄殢鏈哄彇涓�鏉″姞涓婇檺鍒舵潯浠� wrapper.last("LIMIT 1")</p> - */ - @Override - public V getVoOne(Wrapper<T> queryWrapper) { + /** + * 鏍规嵁 Wrapper锛屾煡璇竴鏉¤褰� <br/> + * <p>缁撴灉闆嗭紝濡傛灉鏄涓細鎶涘嚭寮傚父锛岄殢鏈哄彇涓�鏉″姞涓婇檺鍒舵潯浠� wrapper.last("LIMIT 1")</p> + */ + @Override + public V getVoOne(Wrapper<T> queryWrapper) { return getBaseMapper().selectVoOne(queryWrapper, voClass); - } + } - /** - * 鏌ヨ鍒楄〃 - */ - @Override - public List<V> listVo(Wrapper<T> queryWrapper) { + /** + * 鏌ヨ鍒楄〃 + */ + @Override + public List<V> listVo(Wrapper<T> queryWrapper) { return getBaseMapper().selectVoList(queryWrapper, voClass); - } + } /** * 缈婚〉鏌ヨ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/methods/InsertAll.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/methods/InsertAll.java index 403ea53..9920dc5 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/methods/InsertAll.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/methods/InsertAll.java @@ -21,81 +21,81 @@ */ public class InsertAll extends AbstractMethod { - private final static String[] FILL_PROPERTY = {"createTime", "createBy", "updateTime", "updateBy"}; + private final static String[] FILL_PROPERTY = {"createTime", "createBy", "updateTime", "updateBy"}; - @Override - public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) { - final String sql = "<script>insert into %s %s values %s</script>"; - final String fieldSql = prepareFieldSql(tableInfo); - final String valueSql = prepareValuesSqlForMysqlBatch(tableInfo); - KeyGenerator keyGenerator = new NoKeyGenerator(); - String sqlMethod = "insertAll"; - String keyProperty = null; - String keyColumn = null; - // 琛ㄥ寘鍚富閿鐞嗛�昏緫,濡傛灉涓嶅寘鍚富閿綋鏅�氬瓧娈靛鐞� - if (StringUtils.isNotBlank(tableInfo.getKeyProperty())) { - if (tableInfo.getIdType() == IdType.AUTO) { - /** 鑷涓婚敭 */ - keyGenerator = new Jdbc3KeyGenerator(); - keyProperty = tableInfo.getKeyProperty(); - keyColumn = tableInfo.getKeyColumn(); - } else { - if (null != tableInfo.getKeySequence()) { - keyGenerator = TableInfoHelper.genKeyGenerator(sqlMethod, tableInfo, builderAssistant); - keyProperty = tableInfo.getKeyProperty(); - keyColumn = tableInfo.getKeyColumn(); - } - } - } - final String sqlResult = String.format(sql, tableInfo.getTableName(), fieldSql, valueSql); - SqlSource sqlSource = languageDriver.createSqlSource(configuration, sqlResult, modelClass); - return this.addInsertMappedStatement(mapperClass, modelClass, sqlMethod, sqlSource, keyGenerator, keyProperty, keyColumn); - } + @Override + public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) { + final String sql = "<script>insert into %s %s values %s</script>"; + final String fieldSql = prepareFieldSql(tableInfo); + final String valueSql = prepareValuesSqlForMysqlBatch(tableInfo); + KeyGenerator keyGenerator = new NoKeyGenerator(); + String sqlMethod = "insertAll"; + String keyProperty = null; + String keyColumn = null; + // 琛ㄥ寘鍚富閿鐞嗛�昏緫,濡傛灉涓嶅寘鍚富閿綋鏅�氬瓧娈靛鐞� + if (StringUtils.isNotBlank(tableInfo.getKeyProperty())) { + if (tableInfo.getIdType() == IdType.AUTO) { + /** 鑷涓婚敭 */ + keyGenerator = new Jdbc3KeyGenerator(); + keyProperty = tableInfo.getKeyProperty(); + keyColumn = tableInfo.getKeyColumn(); + } else { + if (null != tableInfo.getKeySequence()) { + keyGenerator = TableInfoHelper.genKeyGenerator(sqlMethod, tableInfo, builderAssistant); + keyProperty = tableInfo.getKeyProperty(); + keyColumn = tableInfo.getKeyColumn(); + } + } + } + final String sqlResult = String.format(sql, tableInfo.getTableName(), fieldSql, valueSql); + SqlSource sqlSource = languageDriver.createSqlSource(configuration, sqlResult, modelClass); + return this.addInsertMappedStatement(mapperClass, modelClass, sqlMethod, sqlSource, keyGenerator, keyProperty, keyColumn); + } - private String prepareFieldSql(TableInfo tableInfo) { - StringBuilder fieldSql = new StringBuilder(); - if (StringUtils.isNotBlank(tableInfo.getKeyColumn())) { - fieldSql.append(tableInfo.getKeyColumn()).append(","); - } - tableInfo.getFieldList().forEach(x -> fieldSql.append(x.getColumn()).append(",")); - fieldSql.delete(fieldSql.length() - 1, fieldSql.length()); - fieldSql.insert(0, "("); - fieldSql.append(")"); - return fieldSql.toString(); - } + private String prepareFieldSql(TableInfo tableInfo) { + StringBuilder fieldSql = new StringBuilder(); + if (StringUtils.isNotBlank(tableInfo.getKeyColumn())) { + fieldSql.append(tableInfo.getKeyColumn()).append(","); + } + tableInfo.getFieldList().forEach(x -> fieldSql.append(x.getColumn()).append(",")); + fieldSql.delete(fieldSql.length() - 1, fieldSql.length()); + fieldSql.insert(0, "("); + fieldSql.append(")"); + return fieldSql.toString(); + } - private String prepareValuesSqlForMysqlBatch(TableInfo tableInfo) { - final StringBuilder valueSql = new StringBuilder(); - valueSql.append("<foreach collection=\"list\" item=\"item\" index=\"index\" open=\"(\" separator=\"),(\" close=\")\">"); - if (StringUtils.isNotBlank(tableInfo.getKeyColumn())) { - valueSql.append("\n#{item.").append(tableInfo.getKeyProperty()).append("},\n"); - } - List<TableFieldInfo> fieldList = tableInfo.getFieldList(); - int last = fieldList.size() - 1; - for (int i = 0; i < fieldList.size(); i++) { - String property = fieldList.get(i).getProperty(); - if (!StringUtils.equalsAny(property, FILL_PROPERTY)) { - valueSql.append("<if test=\"item.").append(property).append(" != null\">"); - valueSql.append("#{item.").append(property).append("}"); - if (i != last) { - valueSql.append(","); - } - valueSql.append("</if>"); - valueSql.append("<if test=\"item.").append(property).append(" == null\">"); - valueSql.append("DEFAULT"); - if (i != last) { - valueSql.append(","); - } - valueSql.append("</if>"); - } else { - valueSql.append("#{item.").append(property).append("}"); - if (i != last) { - valueSql.append(","); - } - } - } - valueSql.append("</foreach>"); - return valueSql.toString(); - } + private String prepareValuesSqlForMysqlBatch(TableInfo tableInfo) { + final StringBuilder valueSql = new StringBuilder(); + valueSql.append("<foreach collection=\"list\" item=\"item\" index=\"index\" open=\"(\" separator=\"),(\" close=\")\">"); + if (StringUtils.isNotBlank(tableInfo.getKeyColumn())) { + valueSql.append("\n#{item.").append(tableInfo.getKeyProperty()).append("},\n"); + } + List<TableFieldInfo> fieldList = tableInfo.getFieldList(); + int last = fieldList.size() - 1; + for (int i = 0; i < fieldList.size(); i++) { + String property = fieldList.get(i).getProperty(); + if (!StringUtils.equalsAny(property, FILL_PROPERTY)) { + valueSql.append("<if test=\"item.").append(property).append(" != null\">"); + valueSql.append("#{item.").append(property).append("}"); + if (i != last) { + valueSql.append(","); + } + valueSql.append("</if>"); + valueSql.append("<if test=\"item.").append(property).append(" == null\">"); + valueSql.append("DEFAULT"); + if (i != last) { + valueSql.append(","); + } + valueSql.append("</if>"); + } else { + valueSql.append("#{item.").append(property).append("}"); + if (i != last) { + valueSql.append(","); + } + } + } + valueSql.append("</foreach>"); + return valueSql.toString(); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java index 46b01b9..b2537c1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java @@ -22,42 +22,42 @@ @Accessors(chain = true) @ApiModel("鍒嗛〉鍝嶅簲瀵硅薄") public class TableDataInfo<T> implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 鎬昏褰曟暟 - */ - @ApiModelProperty("鎬昏褰曟暟") - private long total; + /** + * 鎬昏褰曟暟 + */ + @ApiModelProperty("鎬昏褰曟暟") + private long total; - /** - * 鍒楄〃鏁版嵁 - */ - @ApiModelProperty("鍒楄〃鏁版嵁") - private List<T> rows; + /** + * 鍒楄〃鏁版嵁 + */ + @ApiModelProperty("鍒楄〃鏁版嵁") + private List<T> rows; - /** - * 娑堟伅鐘舵�佺爜 - */ - @ApiModelProperty("娑堟伅鐘舵�佺爜") - private int code; + /** + * 娑堟伅鐘舵�佺爜 + */ + @ApiModelProperty("娑堟伅鐘舵�佺爜") + private int code; - /** - * 娑堟伅鍐呭 - */ - @ApiModelProperty("娑堟伅鍐呭") - private String msg; + /** + * 娑堟伅鍐呭 + */ + @ApiModelProperty("娑堟伅鍐呭") + private String msg; - /** - * 鍒嗛〉 - * - * @param list 鍒楄〃鏁版嵁 - * @param total 鎬昏褰曟暟 - */ - public TableDataInfo(List<T> list, long total) { - this.rows = list; - this.total = total; - } + /** + * 鍒嗛〉 + * + * @param list 鍒楄〃鏁版嵁 + * @param total 鎬昏褰曟暟 + */ + public TableDataInfo(List<T> list, long total) { + this.rows = list; + this.total = total; + } public static <T> TableDataInfo<T> build(IPage<T> page) { TableDataInfo<T> rspData = new TableDataInfo<>(); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java index 53bc3d4..0b1d3f4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java @@ -20,339 +20,339 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public class StringUtils extends org.apache.commons.lang3.StringUtils { - /** - * 鑾峰彇鍙傛暟涓嶄负绌哄�� - * - * @param value defaultValue 瑕佸垽鏂殑value - * @return value 杩斿洖鍊� - */ - public static <T> T nvl(T value, T defaultValue) { - return ObjectUtil.defaultIfNull(value, defaultValue); - } + /** + * 鑾峰彇鍙傛暟涓嶄负绌哄�� + * + * @param value defaultValue 瑕佸垽鏂殑value + * @return value 杩斿洖鍊� + */ + public static <T> T nvl(T value, T defaultValue) { + return ObjectUtil.defaultIfNull(value, defaultValue); + } - /** - * 鑾峰彇鍙傛暟涓嶄负绌哄�� - * - * @param str defaultValue 瑕佸垽鏂殑value - * @return value 杩斿洖鍊� - */ - public static String blankToDefault(String str, String defaultValue) { - return StrUtil.blankToDefault(str, defaultValue); - } + /** + * 鑾峰彇鍙傛暟涓嶄负绌哄�� + * + * @param str defaultValue 瑕佸垽鏂殑value + * @return value 杩斿洖鍊� + */ + public static String blankToDefault(String str, String defaultValue) { + return StrUtil.blankToDefault(str, defaultValue); + } - /** - * * 鍒ゆ柇涓�涓狢ollection鏄惁涓虹┖锛� 鍖呭惈List锛孲et锛孮ueue - * - * @param coll 瑕佸垽鏂殑Collection - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(Collection<?> coll) { - return CollUtil.isEmpty(coll); - } + /** + * * 鍒ゆ柇涓�涓狢ollection鏄惁涓虹┖锛� 鍖呭惈List锛孲et锛孮ueue + * + * @param coll 瑕佸垽鏂殑Collection + * @return true锛氫负绌� false锛氶潪绌� + */ + public static boolean isEmpty(Collection<?> coll) { + return CollUtil.isEmpty(coll); + } - /** - * * 鍒ゆ柇涓�涓狢ollection鏄惁闈炵┖锛屽寘鍚獿ist锛孲et锛孮ueue - * - * @param coll 瑕佸垽鏂殑Collection - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotEmpty(Collection<?> coll) { - return !isEmpty(coll); - } + /** + * * 鍒ゆ柇涓�涓狢ollection鏄惁闈炵┖锛屽寘鍚獿ist锛孲et锛孮ueue + * + * @param coll 瑕佸垽鏂殑Collection + * @return true锛氶潪绌� false锛氱┖ + */ + public static boolean isNotEmpty(Collection<?> coll) { + return !isEmpty(coll); + } - /** - * * 鍒ゆ柇涓�涓璞℃暟缁勬槸鍚︿负绌� - * - * @param objects 瑕佸垽鏂殑瀵硅薄鏁扮粍 - * * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(Object[] objects) { - return ArrayUtil.isEmpty(objects); - } + /** + * * 鍒ゆ柇涓�涓璞℃暟缁勬槸鍚︿负绌� + * + * @param objects 瑕佸垽鏂殑瀵硅薄鏁扮粍 + * * @return true锛氫负绌� false锛氶潪绌� + */ + public static boolean isEmpty(Object[] objects) { + return ArrayUtil.isEmpty(objects); + } - /** - * * 鍒ゆ柇涓�涓璞℃暟缁勬槸鍚﹂潪绌� - * - * @param objects 瑕佸垽鏂殑瀵硅薄鏁扮粍 - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotEmpty(Object[] objects) { - return !isEmpty(objects); - } + /** + * * 鍒ゆ柇涓�涓璞℃暟缁勬槸鍚﹂潪绌� + * + * @param objects 瑕佸垽鏂殑瀵硅薄鏁扮粍 + * @return true锛氶潪绌� false锛氱┖ + */ + public static boolean isNotEmpty(Object[] objects) { + return !isEmpty(objects); + } - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚︿负绌� - * - * @param object 瑕佸垽鏂殑瀵硅薄鏁扮粍 - * * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(Object object) { - return ObjectUtil.isEmpty(object); - } + /** + * * 鍒ゆ柇涓�涓璞℃槸鍚︿负绌� + * + * @param object 瑕佸垽鏂殑瀵硅薄鏁扮粍 + * * @return true锛氫负绌� false锛氶潪绌� + */ + public static boolean isEmpty(Object object) { + return ObjectUtil.isEmpty(object); + } - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚﹂潪绌� - * - * @param object 瑕佸垽鏂殑瀵硅薄鏁扮粍 - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotEmpty(Object object) { - return !isEmpty(object); - } + /** + * * 鍒ゆ柇涓�涓璞℃槸鍚﹂潪绌� + * + * @param object 瑕佸垽鏂殑瀵硅薄鏁扮粍 + * @return true锛氶潪绌� false锛氱┖ + */ + public static boolean isNotEmpty(Object object) { + return !isEmpty(object); + } - /** - * * 鍒ゆ柇涓�涓狹ap鏄惁涓虹┖ - * - * @param map 瑕佸垽鏂殑Map - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(Map<?, ?> map) { - return MapUtil.isEmpty(map); - } + /** + * * 鍒ゆ柇涓�涓狹ap鏄惁涓虹┖ + * + * @param map 瑕佸垽鏂殑Map + * @return true锛氫负绌� false锛氶潪绌� + */ + public static boolean isEmpty(Map<?, ?> map) { + return MapUtil.isEmpty(map); + } - /** - * * 鍒ゆ柇涓�涓狹ap鏄惁涓虹┖ - * - * @param map 瑕佸垽鏂殑Map - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotEmpty(Map<?, ?> map) { - return !isEmpty(map); - } + /** + * * 鍒ゆ柇涓�涓狹ap鏄惁涓虹┖ + * + * @param map 瑕佸垽鏂殑Map + * @return true锛氶潪绌� false锛氱┖ + */ + public static boolean isNotEmpty(Map<?, ?> map) { + return !isEmpty(map); + } - /** - * * 鍒ゆ柇涓�涓瓧绗︿覆鏄惁涓虹┖涓� - * - * @param str String - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(String str) { - return StrUtil.isEmpty(str); - } + /** + * * 鍒ゆ柇涓�涓瓧绗︿覆鏄惁涓虹┖涓� + * + * @param str String + * @return true锛氫负绌� false锛氶潪绌� + */ + public static boolean isEmpty(String str) { + return StrUtil.isEmpty(str); + } - /** - * * 鍒ゆ柇涓�涓瓧绗︿覆鏄惁涓洪潪绌轰覆 - * - * @param str String - * @return true锛氶潪绌轰覆 false锛氱┖涓� - */ - public static boolean isNotEmpty(String str) { - return !isEmpty(str); - } + /** + * * 鍒ゆ柇涓�涓瓧绗︿覆鏄惁涓洪潪绌轰覆 + * + * @param str String + * @return true锛氶潪绌轰覆 false锛氱┖涓� + */ + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚︿负绌� - * - * @param object Object - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isNull(Object object) { - return ObjectUtil.isNull(object); - } + /** + * * 鍒ゆ柇涓�涓璞℃槸鍚︿负绌� + * + * @param object Object + * @return true锛氫负绌� false锛氶潪绌� + */ + public static boolean isNull(Object object) { + return ObjectUtil.isNull(object); + } - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚﹂潪绌� - * - * @param object Object - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotNull(Object object) { - return !isNull(object); - } + /** + * * 鍒ゆ柇涓�涓璞℃槸鍚﹂潪绌� + * + * @param object Object + * @return true锛氶潪绌� false锛氱┖ + */ + public static boolean isNotNull(Object object) { + return !isNull(object); + } - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚︽槸鏁扮粍绫诲瀷锛圝ava鍩烘湰鍨嬪埆鐨勬暟缁勶級 - * - * @param object 瀵硅薄 - * @return true锛氭槸鏁扮粍 false锛氫笉鏄暟缁� - */ - public static boolean isArray(Object object) { - return ArrayUtil.isArray(object); - } + /** + * * 鍒ゆ柇涓�涓璞℃槸鍚︽槸鏁扮粍绫诲瀷锛圝ava鍩烘湰鍨嬪埆鐨勬暟缁勶級 + * + * @param object 瀵硅薄 + * @return true锛氭槸鏁扮粍 false锛氫笉鏄暟缁� + */ + public static boolean isArray(Object object) { + return ArrayUtil.isArray(object); + } - /** - * 鍘荤┖鏍� - */ - public static String trim(String str) { - return StrUtil.trim(str); - } + /** + * 鍘荤┖鏍� + */ + public static String trim(String str) { + return StrUtil.trim(str); + } - /** - * 鎴彇瀛楃涓� - * - * @param str 瀛楃涓� - * @param start 寮�濮� - * @return 缁撴灉 - */ - public static String substring(final String str, int start) { - return substring(str, start, str.length()); - } + /** + * 鎴彇瀛楃涓� + * + * @param str 瀛楃涓� + * @param start 寮�濮� + * @return 缁撴灉 + */ + public static String substring(final String str, int start) { + return substring(str, start, str.length()); + } - /** - * 鎴彇瀛楃涓� - * - * @param str 瀛楃涓� - * @param start 寮�濮� - * @param end 缁撴潫 - * @return 缁撴灉 - */ - public static String substring(final String str, int start, int end) { - return StrUtil.sub(str, start, end); - } + /** + * 鎴彇瀛楃涓� + * + * @param str 瀛楃涓� + * @param start 寮�濮� + * @param end 缁撴潫 + * @return 缁撴灉 + */ + public static String substring(final String str, int start, int end) { + return StrUtil.sub(str, start, end); + } - /** - * 鏍煎紡鍖栨枃鏈�, {} 琛ㄧず鍗犱綅绗�<br> - * 姝ゆ柟娉曞彧鏄畝鍗曞皢鍗犱綅绗� {} 鎸夌収椤哄簭鏇挎崲涓哄弬鏁�<br> - * 濡傛灉鎯宠緭鍑� {} 浣跨敤 \\杞箟 { 鍗冲彲锛屽鏋滄兂杈撳嚭 {} 涔嬪墠鐨� \ 浣跨敤鍙岃浆涔夌 \\\\ 鍗冲彲<br> - * 渚嬶細<br> - * 閫氬父浣跨敤锛歠ormat("this is {} for {}", "a", "b") -> this is a for b<br> - * 杞箟{}锛� format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> - * 杞箟\锛� format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> - * - * @param template 鏂囨湰妯℃澘锛岃鏇挎崲鐨勯儴鍒嗙敤 {} 琛ㄧず - * @param params 鍙傛暟鍊� - * @return 鏍煎紡鍖栧悗鐨勬枃鏈� - */ - public static String format(String template, Object... params) { - return StrUtil.format(template, params); - } + /** + * 鏍煎紡鍖栨枃鏈�, {} 琛ㄧず鍗犱綅绗�<br> + * 姝ゆ柟娉曞彧鏄畝鍗曞皢鍗犱綅绗� {} 鎸夌収椤哄簭鏇挎崲涓哄弬鏁�<br> + * 濡傛灉鎯宠緭鍑� {} 浣跨敤 \\杞箟 { 鍗冲彲锛屽鏋滄兂杈撳嚭 {} 涔嬪墠鐨� \ 浣跨敤鍙岃浆涔夌 \\\\ 鍗冲彲<br> + * 渚嬶細<br> + * 閫氬父浣跨敤锛歠ormat("this is {} for {}", "a", "b") -> this is a for b<br> + * 杞箟{}锛� format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> + * 杞箟\锛� format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> + * + * @param template 鏂囨湰妯℃澘锛岃鏇挎崲鐨勯儴鍒嗙敤 {} 琛ㄧず + * @param params 鍙傛暟鍊� + * @return 鏍煎紡鍖栧悗鐨勬枃鏈� + */ + public static String format(String template, Object... params) { + return StrUtil.format(template, params); + } - /** - * 鏄惁涓篽ttp(s)://寮�澶� - * - * @param link 閾炬帴 - * @return 缁撴灉 - */ - public static boolean ishttp(String link) { - return Validator.isUrl(link); - } + /** + * 鏄惁涓篽ttp(s)://寮�澶� + * + * @param link 閾炬帴 + * @return 缁撴灉 + */ + public static boolean ishttp(String link) { + return Validator.isUrl(link); + } - /** - * 瀛楃涓茶浆set - * - * @param str 瀛楃涓� - * @param sep 鍒嗛殧绗� - * @return set闆嗗悎 - */ - public static Set<String> str2Set(String str, String sep) { - return new HashSet<>(str2List(str, sep, true, false)); - } + /** + * 瀛楃涓茶浆set + * + * @param str 瀛楃涓� + * @param sep 鍒嗛殧绗� + * @return set闆嗗悎 + */ + public static Set<String> str2Set(String str, String sep) { + return new HashSet<>(str2List(str, sep, true, false)); + } - /** - * 瀛楃涓茶浆list - * - * @param str 瀛楃涓� - * @param sep 鍒嗛殧绗� - * @param filterBlank 杩囨护绾┖鐧� - * @param trim 鍘绘帀棣栧熬绌虹櫧 - * @return list闆嗗悎 - */ - public static List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) { - List<String> list = new ArrayList<>(); - if (isEmpty(str)) { - return list; - } + /** + * 瀛楃涓茶浆list + * + * @param str 瀛楃涓� + * @param sep 鍒嗛殧绗� + * @param filterBlank 杩囨护绾┖鐧� + * @param trim 鍘绘帀棣栧熬绌虹櫧 + * @return list闆嗗悎 + */ + public static List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) { + List<String> list = new ArrayList<>(); + if (isEmpty(str)) { + return list; + } - // 杩囨护绌虹櫧瀛楃涓� - if (filterBlank && isBlank(str)) { - return list; - } - String[] split = str.split(sep); - for (String string : split) { - if (filterBlank && isBlank(string)) { - continue; - } - if (trim) { - string = trim(string); - } - list.add(string); - } + // 杩囨护绌虹櫧瀛楃涓� + if (filterBlank && isBlank(str)) { + return list; + } + String[] split = str.split(sep); + for (String string : split) { + if (filterBlank && isBlank(string)) { + continue; + } + if (trim) { + string = trim(string); + } + list.add(string); + } - return list; - } + return list; + } - /** - * 鏌ユ壘鎸囧畾瀛楃涓叉槸鍚﹀寘鍚寚瀹氬瓧绗︿覆鍒楄〃涓殑浠绘剰涓�涓瓧绗︿覆鍚屾椂涓插拷鐣ュぇ灏忓啓 - * - * @param cs 鎸囧畾瀛楃涓� - * @param searchCharSequences 闇�瑕佹鏌ョ殑瀛楃涓叉暟缁� - * @return 鏄惁鍖呭惈浠绘剰涓�涓瓧绗︿覆 - */ - public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) { - return StrUtil.containsAnyIgnoreCase(cs, searchCharSequences); - } + /** + * 鏌ユ壘鎸囧畾瀛楃涓叉槸鍚﹀寘鍚寚瀹氬瓧绗︿覆鍒楄〃涓殑浠绘剰涓�涓瓧绗︿覆鍚屾椂涓插拷鐣ュぇ灏忓啓 + * + * @param cs 鎸囧畾瀛楃涓� + * @param searchCharSequences 闇�瑕佹鏌ョ殑瀛楃涓叉暟缁� + * @return 鏄惁鍖呭惈浠绘剰涓�涓瓧绗︿覆 + */ + public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) { + return StrUtil.containsAnyIgnoreCase(cs, searchCharSequences); + } - /** - * 椹煎嘲杞笅鍒掔嚎鍛藉悕 - */ - public static String toUnderScoreCase(String str) { - return StrUtil.toUnderlineCase(str); - } + /** + * 椹煎嘲杞笅鍒掔嚎鍛藉悕 + */ + public static String toUnderScoreCase(String str) { + return StrUtil.toUnderlineCase(str); + } - /** - * 鏄惁鍖呭惈瀛楃涓� - * - * @param str 楠岃瘉瀛楃涓� - * @param strs 瀛楃涓茬粍 - * @return 鍖呭惈杩斿洖true - */ - public static boolean inStringIgnoreCase(String str, String... strs) { - return StrUtil.equalsAnyIgnoreCase(str, strs); - } + /** + * 鏄惁鍖呭惈瀛楃涓� + * + * @param str 楠岃瘉瀛楃涓� + * @param strs 瀛楃涓茬粍 + * @return 鍖呭惈杩斿洖true + */ + public static boolean inStringIgnoreCase(String str, String... strs) { + return StrUtil.equalsAnyIgnoreCase(str, strs); + } - /** - * 灏嗕笅鍒掔嚎澶у啓鏂瑰紡鍛藉悕鐨勫瓧绗︿覆杞崲涓洪┘宄板紡銆傚鏋滆浆鎹㈠墠鐨勪笅鍒掔嚎澶у啓鏂瑰紡鍛藉悕鐨勫瓧绗︿覆涓虹┖锛屽垯杩斿洖绌哄瓧绗︿覆銆� 渚嬪锛欻ELLO_WORLD->HelloWorld - * - * @param name 杞崲鍓嶇殑涓嬪垝绾垮ぇ鍐欐柟寮忓懡鍚嶇殑瀛楃涓� - * @return 杞崲鍚庣殑椹煎嘲寮忓懡鍚嶇殑瀛楃涓� - */ - public static String convertToCamelCase(String name) { - return StrUtil.upperFirst(StrUtil.toCamelCase(name)); - } + /** + * 灏嗕笅鍒掔嚎澶у啓鏂瑰紡鍛藉悕鐨勫瓧绗︿覆杞崲涓洪┘宄板紡銆傚鏋滆浆鎹㈠墠鐨勪笅鍒掔嚎澶у啓鏂瑰紡鍛藉悕鐨勫瓧绗︿覆涓虹┖锛屽垯杩斿洖绌哄瓧绗︿覆銆� 渚嬪锛欻ELLO_WORLD->HelloWorld + * + * @param name 杞崲鍓嶇殑涓嬪垝绾垮ぇ鍐欐柟寮忓懡鍚嶇殑瀛楃涓� + * @return 杞崲鍚庣殑椹煎嘲寮忓懡鍚嶇殑瀛楃涓� + */ + public static String convertToCamelCase(String name) { + return StrUtil.upperFirst(StrUtil.toCamelCase(name)); + } - /** - * 椹煎嘲寮忓懡鍚嶆硶 渚嬪锛歶ser_name->userName - */ - public static String toCamelCase(String s) { - return StrUtil.toCamelCase(s); - } + /** + * 椹煎嘲寮忓懡鍚嶆硶 渚嬪锛歶ser_name->userName + */ + public static String toCamelCase(String s) { + return StrUtil.toCamelCase(s); + } - /** - * 鏌ユ壘鎸囧畾瀛楃涓叉槸鍚﹀尮閰嶆寚瀹氬瓧绗︿覆鍒楄〃涓殑浠绘剰涓�涓瓧绗︿覆 - * - * @param str 鎸囧畾瀛楃涓� - * @param strs 闇�瑕佹鏌ョ殑瀛楃涓叉暟缁� - * @return 鏄惁鍖归厤 - */ - public static boolean matches(String str, List<String> strs) { - if (isEmpty(str) || isEmpty(strs)) { - return false; - } - for (String pattern : strs) { - if (isMatch(pattern, str)) { - return true; - } - } - return false; - } + /** + * 鏌ユ壘鎸囧畾瀛楃涓叉槸鍚﹀尮閰嶆寚瀹氬瓧绗︿覆鍒楄〃涓殑浠绘剰涓�涓瓧绗︿覆 + * + * @param str 鎸囧畾瀛楃涓� + * @param strs 闇�瑕佹鏌ョ殑瀛楃涓叉暟缁� + * @return 鏄惁鍖归厤 + */ + public static boolean matches(String str, List<String> strs) { + if (isEmpty(str) || isEmpty(strs)) { + return false; + } + for (String pattern : strs) { + if (isMatch(pattern, str)) { + return true; + } + } + return false; + } - /** - * 鍒ゆ柇url鏄惁涓庤鍒欓厤缃�: - * ? 琛ㄧず鍗曚釜瀛楃; - * * 琛ㄧず涓�灞傝矾寰勫唴鐨勪换鎰忓瓧绗︿覆锛屼笉鍙法灞傜骇; - * ** 琛ㄧず浠绘剰灞傝矾寰�; - * - * @param pattern 鍖归厤瑙勫垯 - * @param url 闇�瑕佸尮閰嶇殑url - * @return - */ - public static boolean isMatch(String pattern, String url) { + /** + * 鍒ゆ柇url鏄惁涓庤鍒欓厤缃�: + * ? 琛ㄧず鍗曚釜瀛楃; + * * 琛ㄧず涓�灞傝矾寰勫唴鐨勪换鎰忓瓧绗︿覆锛屼笉鍙法灞傜骇; + * ** 琛ㄧず浠绘剰灞傝矾寰�; + * + * @param pattern 鍖归厤瑙勫垯 + * @param url 闇�瑕佸尮閰嶇殑url + * @return + */ + public static boolean isMatch(String pattern, String url) { AntPathMatcher matcher = new AntPathMatcher(); return matcher.match(pattern, url); - } + } - @SuppressWarnings("unchecked") - public static <T> T cast(Object obj) { - return (T) obj; - } + @SuppressWarnings("unchecked") + public static <T> T cast(Object obj) { + return (T) obj; + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ValidatorUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ValidatorUtils.java index 522b989..1fe2eaf 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ValidatorUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ValidatorUtils.java @@ -17,9 +17,9 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public class ValidatorUtils { - private static final Validator VALID = SpringUtils.getBean(Validator.class); + private static final Validator VALID = SpringUtils.getBean(Validator.class); - public static <T> void validate(T object, Class<?>... groups) { + public static <T> void validate(T object, Class<?>... groups) { Set<ConstraintViolation<T>> validate = VALID.validate(object, groups); if (!validate.isEmpty()) { throw new ConstraintViolationException("鍙傛暟鏍¢獙寮傚父", validate); diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java index 40b031b..f568882 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestI18nController.java @@ -27,22 +27,22 @@ @RequestMapping("/demo/i18n") public class TestI18nController { - /** - * 閫氳繃code鑾峰彇鍥介檯鍖栧唴瀹� - * code涓� messages.properties 涓殑 key - * - * 娴嬭瘯浣跨敤 user.register.success - */ - @ApiOperation("閫氳繃code鑾峰彇鍥介檯鍖栧唴瀹�") - @GetMapping() - public AjaxResult<Void> get(@ApiParam("鍥介檯鍖朿ode") String code) { - return AjaxResult.success(MessageUtils.message(code)); - } + /** + * 閫氳繃code鑾峰彇鍥介檯鍖栧唴瀹� + * code涓� messages.properties 涓殑 key + * <p> + * 娴嬭瘯浣跨敤 user.register.success + */ + @ApiOperation("閫氳繃code鑾峰彇鍥介檯鍖栧唴瀹�") + @GetMapping() + public AjaxResult<Void> get(@ApiParam("鍥介檯鍖朿ode") String code) { + return AjaxResult.success(MessageUtils.message(code)); + } /** * Validator 鏍¢獙鍥介檯鍖� * 涓嶄紶鍊� 鍒嗗埆鏌ョ湅寮傚父杩斿洖 - * + * <p> * 娴嬭瘯浣跨敤 not.null */ @ApiOperation("Validator 鏍¢獙鍥介檯鍖�") @@ -54,7 +54,7 @@ /** * Bean 鏍¢獙鍥介檯鍖� * 涓嶄紶鍊� 鍒嗗埆鏌ョ湅寮傚父杩斿洖 - * + * <p> * 娴嬭瘯浣跨敤 not.null */ @ApiOperation("Bean 鏍¢獙鍥介檯鍖�") diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestDemo.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestDemo.java index 74b57d9..f36ae2b 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestDemo.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestDemo.java @@ -18,12 +18,12 @@ @TableName("test_demo") public class TestDemo extends BaseEntity { - private static final long serialVersionUID=1L; + private static final long serialVersionUID = 1L; - /** - * 涓婚敭 - */ + /** + * 涓婚敭 + */ @TableId(value = "id") private Long id; @@ -40,7 +40,7 @@ /** * 鎺掑簭鍙� */ - @OrderBy(asc = false, sort = 1) + @OrderBy(asc = false, sort = 1) private Long orderNum; /** diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java index 92e005b..7459362 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/TestTree.java @@ -21,7 +21,7 @@ @TableName("test_tree") public class TestTree extends TreeEntity { - private static final long serialVersionUID=1L; + private static final long serialVersionUID = 1L; /** diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java index 63d2836..5c41204 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestDemoBo.java @@ -26,43 +26,43 @@ /** * 涓婚敭 */ - @ApiModelProperty("涓婚敭") - @NotNull(message = "涓婚敭涓嶈兘涓虹┖", groups = { EditGroup.class }) + @ApiModelProperty("涓婚敭") + @NotNull(message = "涓婚敭涓嶈兘涓虹┖", groups = {EditGroup.class}) private Long id; /** * 閮ㄩ棬id */ - @ApiModelProperty("閮ㄩ棬id") - @NotNull(message = "閮ㄩ棬id涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("閮ㄩ棬id") + @NotNull(message = "閮ㄩ棬id涓嶈兘涓虹┖", groups = {AddGroup.class, EditGroup.class}) private Long deptId; /** * 鐢ㄦ埛id */ - @ApiModelProperty("鐢ㄦ埛id") - @NotNull(message = "鐢ㄦ埛id涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("鐢ㄦ埛id") + @NotNull(message = "鐢ㄦ埛id涓嶈兘涓虹┖", groups = {AddGroup.class, EditGroup.class}) private Long userId; /** * 鎺掑簭鍙� */ - @ApiModelProperty("鎺掑簭鍙�") - @NotNull(message = "鎺掑簭鍙蜂笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("鎺掑簭鍙�") + @NotNull(message = "鎺掑簭鍙蜂笉鑳戒负绌�", groups = {AddGroup.class, EditGroup.class}) private Long orderNum; /** * key閿� */ - @ApiModelProperty("key閿�") - @NotBlank(message = "key閿笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("key閿�") + @NotBlank(message = "key閿笉鑳戒负绌�", groups = {AddGroup.class, EditGroup.class}) private String testKey; /** * 鍊� */ - @ApiModelProperty("鍊�") - @NotBlank(message = "鍊间笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("鍊�") + @NotBlank(message = "鍊间笉鑳戒负绌�", groups = {AddGroup.class, EditGroup.class}) private String value; } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java index c561dd7..29f4ac9 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/bo/TestTreeBo.java @@ -26,29 +26,29 @@ /** * 涓婚敭 */ - @ApiModelProperty("涓婚敭") - @NotNull(message = "涓婚敭涓嶈兘涓虹┖", groups = { EditGroup.class }) + @ApiModelProperty("涓婚敭") + @NotNull(message = "涓婚敭涓嶈兘涓虹┖", groups = {EditGroup.class}) private Long id; /** * 閮ㄩ棬id */ - @ApiModelProperty("閮ㄩ棬id") - @NotNull(message = "閮ㄩ棬id涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("閮ㄩ棬id") + @NotNull(message = "閮ㄩ棬id涓嶈兘涓虹┖", groups = {AddGroup.class, EditGroup.class}) private Long deptId; /** * 鐢ㄦ埛id */ - @ApiModelProperty("鐢ㄦ埛id") - @NotNull(message = "鐢ㄦ埛id涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("鐢ㄦ埛id") + @NotNull(message = "鐢ㄦ埛id涓嶈兘涓虹┖", groups = {AddGroup.class, EditGroup.class}) private Long userId; /** * 鏍戣妭鐐瑰悕 */ - @ApiModelProperty("鏍戣妭鐐瑰悕") - @NotBlank(message = "鏍戣妭鐐瑰悕涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + @ApiModelProperty("鏍戣妭鐐瑰悕") + @NotBlank(message = "鏍戣妭鐐瑰悕涓嶈兘涓虹┖", groups = {AddGroup.class, EditGroup.class}) private String treeName; } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java index 4919bbd..ef26ff3 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestDemoVo.java @@ -9,7 +9,6 @@ import java.util.Date; - /** * 娴嬭瘯鍗曡〃瑙嗗浘瀵硅薄 test_demo * @@ -21,77 +20,77 @@ @ExcelIgnoreUnannotated public class TestDemoVo { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 涓婚敭 + /** + * 涓婚敭 */ - @ExcelProperty(value = "涓婚敭") - @ApiModelProperty("涓婚敭") - private Long id; + @ExcelProperty(value = "涓婚敭") + @ApiModelProperty("涓婚敭") + private Long id; /** * 閮ㄩ棬id */ - @ExcelProperty(value = "閮ㄩ棬id") - @ApiModelProperty("閮ㄩ棬id") - private Long deptId; + @ExcelProperty(value = "閮ㄩ棬id") + @ApiModelProperty("閮ㄩ棬id") + private Long deptId; /** * 鐢ㄦ埛id */ - @ExcelProperty(value = "鐢ㄦ埛id") - @ApiModelProperty("鐢ㄦ埛id") - private Long userId; + @ExcelProperty(value = "鐢ㄦ埛id") + @ApiModelProperty("鐢ㄦ埛id") + private Long userId; /** * 鎺掑簭鍙� */ - @ExcelProperty(value = "鎺掑簭鍙�") - @ApiModelProperty("鎺掑簭鍙�") - private Long orderNum; + @ExcelProperty(value = "鎺掑簭鍙�") + @ApiModelProperty("鎺掑簭鍙�") + private Long orderNum; /** * key閿� */ - @ExcelProperty(value = "key閿�") - @ApiModelProperty("key閿�") - private String testKey; + @ExcelProperty(value = "key閿�") + @ApiModelProperty("key閿�") + private String testKey; /** * 鍊� */ - @ExcelProperty(value = "鍊�") - @ApiModelProperty("鍊�") - private String value; + @ExcelProperty(value = "鍊�") + @ApiModelProperty("鍊�") + private String value; /** * 鍒涘缓鏃堕棿 */ - @ExcelProperty(value = "鍒涘缓鏃堕棿") - @ApiModelProperty("鍒涘缓鏃堕棿") - private Date createTime; + @ExcelProperty(value = "鍒涘缓鏃堕棿") + @ApiModelProperty("鍒涘缓鏃堕棿") + private Date createTime; /** * 鍒涘缓浜� */ - @ExcelProperty(value = "鍒涘缓浜�") - @ApiModelProperty("鍒涘缓浜�") - private String createBy; + @ExcelProperty(value = "鍒涘缓浜�") + @ApiModelProperty("鍒涘缓浜�") + private String createBy; /** * 鏇存柊鏃堕棿 */ - @ExcelProperty(value = "鏇存柊鏃堕棿") - @ApiModelProperty("鏇存柊鏃堕棿") - private Date updateTime; + @ExcelProperty(value = "鏇存柊鏃堕棿") + @ApiModelProperty("鏇存柊鏃堕棿") + private Date updateTime; /** * 鏇存柊浜� */ - @ExcelProperty(value = "鏇存柊浜�") - @ApiModelProperty("鏇存柊浜�") - private String updateBy; + @ExcelProperty(value = "鏇存柊浜�") + @ApiModelProperty("鏇存柊浜�") + private String updateBy; } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java index dab8162..309a0ae 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/domain/vo/TestTreeVo.java @@ -9,7 +9,6 @@ import java.util.Date; - /** * 娴嬭瘯鏍戣〃瑙嗗浘瀵硅薄 test_tree * @@ -21,48 +20,48 @@ @ExcelIgnoreUnannotated public class TestTreeVo { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** - * 涓婚敭 + /** + * 涓婚敭 */ - @ApiModelProperty("涓婚敭") - private Long id; + @ApiModelProperty("涓婚敭") + private Long id; /** * 鐖秈d */ - @ExcelProperty(value = "鐖秈d") - @ApiModelProperty("鐖秈d") - private Long parentId; + @ExcelProperty(value = "鐖秈d") + @ApiModelProperty("鐖秈d") + private Long parentId; /** * 閮ㄩ棬id */ - @ExcelProperty(value = "閮ㄩ棬id") - @ApiModelProperty("閮ㄩ棬id") - private Long deptId; + @ExcelProperty(value = "閮ㄩ棬id") + @ApiModelProperty("閮ㄩ棬id") + private Long deptId; /** * 鐢ㄦ埛id */ - @ExcelProperty(value = "鐢ㄦ埛id") - @ApiModelProperty("鐢ㄦ埛id") - private Long userId; + @ExcelProperty(value = "鐢ㄦ埛id") + @ApiModelProperty("鐢ㄦ埛id") + private Long userId; /** * 鏍戣妭鐐瑰悕 */ - @ExcelProperty(value = "鏍戣妭鐐瑰悕") - @ApiModelProperty("鏍戣妭鐐瑰悕") - private String treeName; + @ExcelProperty(value = "鏍戣妭鐐瑰悕") + @ApiModelProperty("鏍戣妭鐐瑰悕") + private String treeName; /** * 鍒涘缓鏃堕棿 */ - @ExcelProperty(value = "鍒涘缓鏃堕棿") - @ApiModelProperty("鍒涘缓鏃堕棿") - private Date createTime; + @ExcelProperty(value = "鍒涘缓鏃堕棿") + @ApiModelProperty("鍒涘缓鏃堕棿") + private Date createTime; } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java index 12834d3..4ea7298 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java @@ -1,11 +1,11 @@ package com.ruoyi.demo.service; import com.ruoyi.common.core.domain.PageQuery; -import com.ruoyi.demo.domain.TestDemo; -import com.ruoyi.demo.domain.vo.TestDemoVo; -import com.ruoyi.demo.domain.bo.TestDemoBo; import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.demo.domain.TestDemo; +import com.ruoyi.demo.domain.bo.TestDemoBo; +import com.ruoyi.demo.domain.vo.TestDemoVo; import java.util.Collection; import java.util.List; @@ -18,46 +18,50 @@ */ public interface ITestDemoService extends IServicePlus<TestDemo, TestDemoVo> { - /** - * 鏌ヨ鍗曚釜 - * @return - */ - TestDemoVo queryById(Long id); - - /** - * 鏌ヨ鍒楄〃 - */ - TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery); - - /** - * 鑷畾涔夊垎椤垫煡璇� - */ - TableDataInfo<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery); + /** + * 鏌ヨ鍗曚釜 + * + * @return + */ + TestDemoVo queryById(Long id); /** - * 鏌ヨ鍒楄〃 - */ - List<TestDemoVo> queryList(TestDemoBo bo); + * 鏌ヨ鍒楄〃 + */ + TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery); - /** - * 鏍规嵁鏂板涓氬姟瀵硅薄鎻掑叆娴嬭瘯鍗曡〃 - * @param bo 娴嬭瘯鍗曡〃鏂板涓氬姟瀵硅薄 - * @return - */ - Boolean insertByBo(TestDemoBo bo); + /** + * 鑷畾涔夊垎椤垫煡璇� + */ + TableDataInfo<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery); - /** - * 鏍规嵁缂栬緫涓氬姟瀵硅薄淇敼娴嬭瘯鍗曡〃 - * @param bo 娴嬭瘯鍗曡〃缂栬緫涓氬姟瀵硅薄 - * @return - */ - Boolean updateByBo(TestDemoBo bo); + /** + * 鏌ヨ鍒楄〃 + */ + List<TestDemoVo> queryList(TestDemoBo bo); - /** - * 鏍¢獙骞跺垹闄ゆ暟鎹� - * @param ids 涓婚敭闆嗗悎 - * @param isValid 鏄惁鏍¢獙,true-鍒犻櫎鍓嶆牎楠�,false-涓嶆牎楠� - * @return - */ - Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); + /** + * 鏍规嵁鏂板涓氬姟瀵硅薄鎻掑叆娴嬭瘯鍗曡〃 + * + * @param bo 娴嬭瘯鍗曡〃鏂板涓氬姟瀵硅薄 + * @return + */ + Boolean insertByBo(TestDemoBo bo); + + /** + * 鏍规嵁缂栬緫涓氬姟瀵硅薄淇敼娴嬭瘯鍗曡〃 + * + * @param bo 娴嬭瘯鍗曡〃缂栬緫涓氬姟瀵硅薄 + * @return + */ + Boolean updateByBo(TestDemoBo bo); + + /** + * 鏍¢獙骞跺垹闄ゆ暟鎹� + * + * @param ids 涓婚敭闆嗗悎 + * @param isValid 鏄惁鏍¢獙,true-鍒犻櫎鍓嶆牎楠�,false-涓嶆牎楠� + * @return + */ + Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java index 9b8acb9..0fa5c99 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java @@ -1,9 +1,9 @@ package com.ruoyi.demo.service; -import com.ruoyi.demo.domain.TestTree; -import com.ruoyi.demo.domain.vo.TestTreeVo; -import com.ruoyi.demo.domain.bo.TestTreeBo; import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.demo.domain.TestTree; +import com.ruoyi.demo.domain.bo.TestTreeBo; +import com.ruoyi.demo.domain.vo.TestTreeVo; import java.util.Collection; import java.util.List; @@ -15,36 +15,40 @@ * @date 2021-07-26 */ public interface ITestTreeService extends IServicePlus<TestTree, TestTreeVo> { - /** - * 鏌ヨ鍗曚釜 - * @return - */ - TestTreeVo queryById(Long id); + /** + * 鏌ヨ鍗曚釜 + * + * @return + */ + TestTreeVo queryById(Long id); - /** - * 鏌ヨ鍒楄〃 - */ - List<TestTreeVo> queryList(TestTreeBo bo); + /** + * 鏌ヨ鍒楄〃 + */ + List<TestTreeVo> queryList(TestTreeBo bo); - /** - * 鏍规嵁鏂板涓氬姟瀵硅薄鎻掑叆娴嬭瘯鏍戣〃 - * @param bo 娴嬭瘯鏍戣〃鏂板涓氬姟瀵硅薄 - * @return - */ - Boolean insertByBo(TestTreeBo bo); + /** + * 鏍规嵁鏂板涓氬姟瀵硅薄鎻掑叆娴嬭瘯鏍戣〃 + * + * @param bo 娴嬭瘯鏍戣〃鏂板涓氬姟瀵硅薄 + * @return + */ + Boolean insertByBo(TestTreeBo bo); - /** - * 鏍规嵁缂栬緫涓氬姟瀵硅薄淇敼娴嬭瘯鏍戣〃 - * @param bo 娴嬭瘯鏍戣〃缂栬緫涓氬姟瀵硅薄 - * @return - */ - Boolean updateByBo(TestTreeBo bo); + /** + * 鏍规嵁缂栬緫涓氬姟瀵硅薄淇敼娴嬭瘯鏍戣〃 + * + * @param bo 娴嬭瘯鏍戣〃缂栬緫涓氬姟瀵硅薄 + * @return + */ + Boolean updateByBo(TestTreeBo bo); - /** - * 鏍¢獙骞跺垹闄ゆ暟鎹� - * @param ids 涓婚敭闆嗗悎 - * @param isValid 鏄惁鏍¢獙,true-鍒犻櫎鍓嶆牎楠�,false-涓嶆牎楠� - * @return - */ - Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); + /** + * 鏍¢獙骞跺垹闄ゆ暟鎹� + * + * @param ids 涓婚敭闆嗗悎 + * @param isValid 鏄惁鏍¢獙,true-鍒犻櫎鍓嶆牎楠�,false-涓嶆牎楠� + * @return + */ + Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java index a647d24..604525e 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestDemoServiceImpl.java @@ -28,75 +28,75 @@ @Service public class TestDemoServiceImpl extends ServicePlusImpl<TestDemoMapper, TestDemo, TestDemoVo> implements ITestDemoService { - @Override - public TestDemoVo queryById(Long id) { - return getVoById(id); - } + @Override + public TestDemoVo queryById(Long id) { + return getVoById(id); + } - @Override - public TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery) { + @Override + public TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery) { LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo); Page<TestDemoVo> result = pageVo(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } + return TableDataInfo.build(result); + } - /** - * 鑷畾涔夊垎椤垫煡璇� - */ - @Override - public TableDataInfo<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery) { + /** + * 鑷畾涔夊垎椤垫煡璇� + */ + @Override + public TableDataInfo<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery) { LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo); - Page<TestDemoVo> result = baseMapper.customPageList(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } + Page<TestDemoVo> result = baseMapper.customPageList(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } - @Override - public List<TestDemoVo> queryList(TestDemoBo bo) { - return listVo(buildQueryWrapper(bo)); - } + @Override + public List<TestDemoVo> queryList(TestDemoBo bo) { + return listVo(buildQueryWrapper(bo)); + } - private LambdaQueryWrapper<TestDemo> buildQueryWrapper(TestDemoBo bo) { - Map<String, Object> params = bo.getParams(); - LambdaQueryWrapper<TestDemo> lqw = Wrappers.lambdaQuery(); - lqw.like(StringUtils.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey()); - lqw.eq(StringUtils.isNotBlank(bo.getValue()), TestDemo::getValue, bo.getValue()); - lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, - TestDemo::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); - return lqw; - } + private LambdaQueryWrapper<TestDemo> buildQueryWrapper(TestDemoBo bo) { + Map<String, Object> params = bo.getParams(); + LambdaQueryWrapper<TestDemo> lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey()); + lqw.eq(StringUtils.isNotBlank(bo.getValue()), TestDemo::getValue, bo.getValue()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + TestDemo::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + return lqw; + } - @Override - public Boolean insertByBo(TestDemoBo bo) { - TestDemo add = BeanUtil.toBean(bo, TestDemo.class); - validEntityBeforeSave(add); - boolean flag = save(add); - if (flag) { - bo.setId(add.getId()); - } - return flag; - } + @Override + public Boolean insertByBo(TestDemoBo bo) { + TestDemo add = BeanUtil.toBean(bo, TestDemo.class); + validEntityBeforeSave(add); + boolean flag = save(add); + if (flag) { + bo.setId(add.getId()); + } + return flag; + } - @Override - public Boolean updateByBo(TestDemoBo bo) { - TestDemo update = BeanUtil.toBean(bo, TestDemo.class); - validEntityBeforeSave(update); - return updateById(update); - } + @Override + public Boolean updateByBo(TestDemoBo bo) { + TestDemo update = BeanUtil.toBean(bo, TestDemo.class); + validEntityBeforeSave(update); + return updateById(update); + } - /** - * 淇濆瓨鍓嶇殑鏁版嵁鏍¢獙 - * - * @param entity 瀹炰綋绫绘暟鎹� - */ - private void validEntityBeforeSave(TestDemo entity) { - //TODO 鍋氫竴浜涙暟鎹牎楠�,濡傚敮涓�绾︽潫 - } + /** + * 淇濆瓨鍓嶇殑鏁版嵁鏍¢獙 + * + * @param entity 瀹炰綋绫绘暟鎹� + */ + private void validEntityBeforeSave(TestDemo entity) { + //TODO 鍋氫竴浜涙暟鎹牎楠�,濡傚敮涓�绾︽潫 + } - @Override - public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { - if (isValid) { - //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� - } - return removeByIds(ids); - } + @Override + public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { + if (isValid) { + //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� + } + return removeByIds(ids); + } } diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java index c4097e6..99a39f3 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/TestTreeServiceImpl.java @@ -26,59 +26,59 @@ @Service public class TestTreeServiceImpl extends ServicePlusImpl<TestTreeMapper, TestTree, TestTreeVo> implements ITestTreeService { - @Override - public TestTreeVo queryById(Long id) { - return getVoById(id); - } + @Override + public TestTreeVo queryById(Long id) { + return getVoById(id); + } -// @DS("slave") // 鍒囨崲浠庡簱鏌ヨ - @Override - public List<TestTreeVo> queryList(TestTreeBo bo) { + // @DS("slave") // 鍒囨崲浠庡簱鏌ヨ + @Override + public List<TestTreeVo> queryList(TestTreeBo bo) { LambdaQueryWrapper<TestTree> lqw = buildQueryWrapper(bo); return listVo(lqw); - } + } - private LambdaQueryWrapper<TestTree> buildQueryWrapper(TestTreeBo bo) { - Map<String, Object> params = bo.getParams(); - LambdaQueryWrapper<TestTree> lqw = Wrappers.lambdaQuery(); - lqw.like(StringUtils.isNotBlank(bo.getTreeName()), TestTree::getTreeName, bo.getTreeName()); - lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, - TestTree::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); - return lqw; - } + private LambdaQueryWrapper<TestTree> buildQueryWrapper(TestTreeBo bo) { + Map<String, Object> params = bo.getParams(); + LambdaQueryWrapper<TestTree> lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTreeName()), TestTree::getTreeName, bo.getTreeName()); + lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, + TestTree::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); + return lqw; + } - @Override - public Boolean insertByBo(TestTreeBo bo) { - TestTree add = BeanUtil.toBean(bo, TestTree.class); - validEntityBeforeSave(add); - boolean flag = save(add); - if (flag) { - bo.setId(add.getId()); - } - return flag; - } + @Override + public Boolean insertByBo(TestTreeBo bo) { + TestTree add = BeanUtil.toBean(bo, TestTree.class); + validEntityBeforeSave(add); + boolean flag = save(add); + if (flag) { + bo.setId(add.getId()); + } + return flag; + } - @Override - public Boolean updateByBo(TestTreeBo bo) { - TestTree update = BeanUtil.toBean(bo, TestTree.class); - validEntityBeforeSave(update); - return updateById(update); - } + @Override + public Boolean updateByBo(TestTreeBo bo) { + TestTree update = BeanUtil.toBean(bo, TestTree.class); + validEntityBeforeSave(update); + return updateById(update); + } - /** - * 淇濆瓨鍓嶇殑鏁版嵁鏍¢獙 - * - * @param entity 瀹炰綋绫绘暟鎹� - */ - private void validEntityBeforeSave(TestTree entity) { - //TODO 鍋氫竴浜涙暟鎹牎楠�,濡傚敮涓�绾︽潫 - } + /** + * 淇濆瓨鍓嶇殑鏁版嵁鏍¢獙 + * + * @param entity 瀹炰綋绫绘暟鎹� + */ + private void validEntityBeforeSave(TestTree entity) { + //TODO 鍋氫竴浜涙暟鎹牎楠�,濡傚敮涓�绾︽潫 + } - @Override - public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { - if (isValid) { - //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� - } - return removeByIds(ids); - } + @Override + public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { + if (isValid) { + //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� + } + return removeByIds(ids); + } } diff --git a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/MonitorAdminApplication.java b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/MonitorAdminApplication.java index 1d1cbca..d4f038c 100644 --- a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/MonitorAdminApplication.java +++ b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/MonitorAdminApplication.java @@ -11,9 +11,9 @@ @SpringBootApplication public class MonitorAdminApplication { - public static void main(String[] args) { - SpringApplication.run(MonitorAdminApplication.class, args); - System.out.println("Admin 鐩戞帶鍚姩鎴愬姛" ); - } + public static void main(String[] args) { + SpringApplication.run(MonitorAdminApplication.class, args); + System.out.println("Admin 鐩戞帶鍚姩鎴愬姛"); + } } diff --git a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java index 04a0fde..2b04f71 100644 --- a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java +++ b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java @@ -16,33 +16,33 @@ @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { - private final String adminContextPath; + private final String adminContextPath; - public SecurityConfig(AdminServerProperties adminServerProperties) { - this.adminContextPath = adminServerProperties.getContextPath(); - } + public SecurityConfig(AdminServerProperties adminServerProperties) { + this.adminContextPath = adminServerProperties.getContextPath(); + } - @Override - protected void configure(HttpSecurity httpSecurity) throws Exception { - SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); - successHandler.setTargetUrlParameter("redirectTo"); - successHandler.setDefaultTargetUrl(adminContextPath + "/"); - // admin鐩戞帶 鐢ㄦ埛閴存潈 - httpSecurity.authorizeRequests() - //鎺堜簣瀵规墍鏈夐潤鎬佽祫浜у拰鐧诲綍椤甸潰鐨勫叕鍏辫闂潈闄愩�� - .antMatchers(adminContextPath + "/assets/**").permitAll() - .antMatchers(adminContextPath + "/login").permitAll() + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception { + SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); + successHandler.setTargetUrlParameter("redirectTo"); + successHandler.setDefaultTargetUrl(adminContextPath + "/"); + // admin鐩戞帶 鐢ㄦ埛閴存潈 + httpSecurity.authorizeRequests() + //鎺堜簣瀵规墍鏈夐潤鎬佽祫浜у拰鐧诲綍椤甸潰鐨勫叕鍏辫闂潈闄愩�� + .antMatchers(adminContextPath + "/assets/**").permitAll() + .antMatchers(adminContextPath + "/login").permitAll() .antMatchers("/actuator").permitAll() .antMatchers("/actuator/**").permitAll() - //蹇呴』瀵规瘡涓叾浠栬姹傝繘琛岃韩浠介獙璇� - .anyRequest().authenticated().and() - //閰嶇疆鐧诲綍鍜屾敞閿� - .formLogin().loginPage(adminContextPath + "/login") - .successHandler(successHandler).and() - .logout().logoutUrl(adminContextPath + "/logout").and() - //鍚敤HTTP-Basic鏀寔銆傝繖鏄疭pring Boot Admin Client娉ㄥ唽鎵�蹇呴渶鐨� - .httpBasic().and().csrf().disable() - .headers().frameOptions().disable(); - } + //蹇呴』瀵规瘡涓叾浠栬姹傝繘琛岃韩浠介獙璇� + .anyRequest().authenticated().and() + //閰嶇疆鐧诲綍鍜屾敞閿� + .formLogin().loginPage(adminContextPath + "/login") + .successHandler(successHandler).and() + .logout().logoutUrl(adminContextPath + "/logout").and() + //鍚敤HTTP-Basic鏀寔銆傝繖鏄疭pring Boot Admin Client娉ㄥ唽鎵�蹇呴渶鐨� + .httpBasic().and().csrf().disable() + .headers().frameOptions().disable(); + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java index 95f3c9b..728773d 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/AsyncConfig.java @@ -23,9 +23,9 @@ @Configuration public class AsyncConfig extends AsyncConfigurerSupport { - @Autowired - @Qualifier("scheduledExecutorService") - private ScheduledExecutorService scheduledExecutorService; + @Autowired + @Qualifier("scheduledExecutorService") + private ScheduledExecutorService scheduledExecutorService; /** * 寮傛鎵ц闇�瑕佷娇鐢ㄦ潈闄愭鏋惰嚜甯︾殑鍖呰绾跨▼姹� 淇濊瘉鏉冮檺淇℃伅鐨勪紶閫� @@ -44,7 +44,7 @@ throwable.printStackTrace(); StringBuilder sb = new StringBuilder(); sb.append("Exception message - ").append(throwable.getMessage()) - .append(", Method name - ").append(method.getName()); + .append(", Method name - ").append(method.getName()); if (ArrayUtil.isNotEmpty(objects)) { sb.append(", Parameter value - ").append(Arrays.toString(objects)); } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java index 735f7e3..6f7a82e 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -21,11 +21,10 @@ /** * 鍘婚櫎鐩戞帶椤甸潰搴曢儴鐨勫箍鍛� */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) @Bean @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true") - public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) - { + public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) { // 鑾峰彇web鐩戞帶椤甸潰鐨勫弬鏁� DruidStatProperties.StatViewServlet config = properties.getStatViewServlet(); // 鎻愬彇common.js鐨勯厤缃矾寰� @@ -33,16 +32,14 @@ String commonJsPattern = pattern.replaceAll("\\*", "js/common.js"); final String filePath = "support/http/resources/js/common.js"; // 鍒涘缓filter杩涜杩囨护 - Filter filter = new Filter() - { + Filter filter = new Filter() { @Override - public void init(javax.servlet.FilterConfig filterConfig) throws ServletException - { + public void init(javax.servlet.FilterConfig filterConfig) throws ServletException { } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException - { + throws IOException, ServletException { chain.doFilter(request, response); // 閲嶇疆缂撳啿鍖猴紝鍝嶅簲澶翠笉浼氳閲嶇疆 // response.resetBuffer(); @@ -53,9 +50,9 @@ text = text.replaceAll("powered.*?shrek.wang</a>", ""); response.getWriter().write(text); } + @Override - public void destroy() - { + public void destroy() { } }; FilterRegistrationBean registrationBean = new FilterRegistrationBean(); diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java index 20b52a8..e64fa3a 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java @@ -17,30 +17,30 @@ @Configuration public class I18nConfig { - @Bean - public LocaleResolver localeResolver() { - return new I18nLocaleResolver(); - } + @Bean + public LocaleResolver localeResolver() { + return new I18nLocaleResolver(); + } - /** - * 鑾峰彇璇锋眰澶村浗闄呭寲淇℃伅 - */ - static class I18nLocaleResolver implements LocaleResolver { + /** + * 鑾峰彇璇锋眰澶村浗闄呭寲淇℃伅 + */ + static class I18nLocaleResolver implements LocaleResolver { - @Override - public Locale resolveLocale(HttpServletRequest httpServletRequest) { - String language = httpServletRequest.getHeader("content-language"); - Locale locale = Locale.getDefault(); - if (StrUtil.isNotBlank(language)) { - String[] split = language.split("_"); - locale = new Locale(split[0], split[1]); - } - return locale; - } + @Override + public Locale resolveLocale(HttpServletRequest httpServletRequest) { + String language = httpServletRequest.getHeader("content-language"); + Locale locale = Locale.getDefault(); + if (StrUtil.isNotBlank(language)) { + String[] split = language.split("_"); + locale = new Locale(split[0], split[1]); + } + return locale; + } - @Override - public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) { + @Override + public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) { - } - } + } + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/JacksonConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/JacksonConfig.java index 55756d4..a5d6371 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/JacksonConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/JacksonConfig.java @@ -28,23 +28,23 @@ @Configuration public class JacksonConfig { - @Primary - @Bean - public ObjectMapper getObjectMapper(Jackson2ObjectMapperBuilder builder, JacksonProperties jacksonProperties) { - ObjectMapper objectMapper = builder.createXmlMapper(false).build(); - // 鍏ㄥ眬閰嶇疆搴忓垪鍖栬繑鍥� JSON 澶勭悊 - SimpleModule simpleModule = new SimpleModule(); - simpleModule.addSerializer(Long.class, BigNumberSerializer.INSTANCE); - simpleModule.addSerializer(Long.TYPE, BigNumberSerializer.INSTANCE); - simpleModule.addSerializer(BigInteger.class, BigNumberSerializer.INSTANCE); - simpleModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern(jacksonProperties.getDateFormat()); - simpleModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter)); - simpleModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter)); - objectMapper.registerModule(simpleModule); - objectMapper.setTimeZone(TimeZone.getDefault()); - log.info("鍒濆鍖� jackson 閰嶇疆"); - return objectMapper; - } + @Primary + @Bean + public ObjectMapper getObjectMapper(Jackson2ObjectMapperBuilder builder, JacksonProperties jacksonProperties) { + ObjectMapper objectMapper = builder.createXmlMapper(false).build(); + // 鍏ㄥ眬閰嶇疆搴忓垪鍖栬繑鍥� JSON 澶勭悊 + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(Long.class, BigNumberSerializer.INSTANCE); + simpleModule.addSerializer(Long.TYPE, BigNumberSerializer.INSTANCE); + simpleModule.addSerializer(BigInteger.class, BigNumberSerializer.INSTANCE); + simpleModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(jacksonProperties.getDateFormat()); + simpleModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter)); + simpleModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter)); + objectMapper.registerModule(simpleModule); + objectMapper.setTimeZone(TimeZone.getDefault()); + log.info("鍒濆鍖� jackson 閰嶇疆"); + return objectMapper; + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java index 5daaa9a..d7f238b 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java @@ -31,17 +31,17 @@ @MapperScan("${mybatis-plus.mapperPackage}") public class MybatisPlusConfig { - @Bean - public MybatisPlusInterceptor mybatisPlusInterceptor() { - MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); // 鏁版嵁鏉冮檺澶勭悊 interceptor.addInnerInterceptor(dataPermissionInterceptor()); - // 鍒嗛〉鎻掍欢 - interceptor.addInnerInterceptor(paginationInnerInterceptor()); - // 涔愯閿佹彃浠� - interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); - return interceptor; - } + // 鍒嗛〉鎻掍欢 + interceptor.addInnerInterceptor(paginationInnerInterceptor()); + // 涔愯閿佹彃浠� + interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); + return interceptor; + } /** * 鏁版嵁鏉冮檺鎷︽埅鍣� @@ -50,47 +50,47 @@ return new PlusDataPermissionInterceptor(); } - /** - * 鍒嗛〉鎻掍欢锛岃嚜鍔ㄨ瘑鍒暟鎹簱绫诲瀷 - */ - public PaginationInnerInterceptor paginationInnerInterceptor() { - PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); - // 璁剧疆鏈�澶у崟椤甸檺鍒舵暟閲忥紝榛樿 500 鏉★紝-1 涓嶅彈闄愬埗 - paginationInnerInterceptor.setMaxLimit(-1L); - // 鍒嗛〉鍚堢悊鍖� - paginationInnerInterceptor.setOverflow(true); - return paginationInnerInterceptor; - } + /** + * 鍒嗛〉鎻掍欢锛岃嚜鍔ㄨ瘑鍒暟鎹簱绫诲瀷 + */ + public PaginationInnerInterceptor paginationInnerInterceptor() { + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); + // 璁剧疆鏈�澶у崟椤甸檺鍒舵暟閲忥紝榛樿 500 鏉★紝-1 涓嶅彈闄愬埗 + paginationInnerInterceptor.setMaxLimit(-1L); + // 鍒嗛〉鍚堢悊鍖� + paginationInnerInterceptor.setOverflow(true); + return paginationInnerInterceptor; + } - /** - * 涔愯閿佹彃浠� - */ - public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() { - return new OptimisticLockerInnerInterceptor(); - } + /** + * 涔愯閿佹彃浠� + */ + public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() { + return new OptimisticLockerInnerInterceptor(); + } - /** - * 鍏冨璞″瓧娈靛~鍏呮帶鍒跺櫒 - */ - @Bean - public MetaObjectHandler metaObjectHandler() { - return new CreateAndUpdateMetaObjectHandler(); - } + /** + * 鍏冨璞″瓧娈靛~鍏呮帶鍒跺櫒 + */ + @Bean + public MetaObjectHandler metaObjectHandler() { + return new CreateAndUpdateMetaObjectHandler(); + } - /** - * sql娉ㄥ叆鍣ㄩ厤缃� - */ - @Bean - public ISqlInjector sqlInjector() { - return new DefaultSqlInjector() { - @Override - public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) { - List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo); - methodList.add(new InsertAll()); - return methodList; - } - }; - } + /** + * sql娉ㄥ叆鍣ㄩ厤缃� + */ + @Bean + public ISqlInjector sqlInjector() { + return new DefaultSqlInjector() { + @Override + public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) { + List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo); + methodList.add(new InsertAll()); + return methodList; + } + }; + } /** * 浣跨敤缃戝崱淇℃伅缁戝畾闆姳鐢熸垚鍣� @@ -101,24 +101,24 @@ return new DefaultIdentifierGenerator(NetUtil.getLocalhost()); } - /** - * PaginationInnerInterceptor 鍒嗛〉鎻掍欢锛岃嚜鍔ㄨ瘑鍒暟鎹簱绫诲瀷 - * https://baomidou.com/pages/97710a/ - * OptimisticLockerInnerInterceptor 涔愯閿佹彃浠� - * https://baomidou.com/pages/0d93c0/ - * MetaObjectHandler 鍏冨璞″瓧娈靛~鍏呮帶鍒跺櫒 - * https://baomidou.com/pages/4c6bcf/ - * ISqlInjector sql娉ㄥ叆鍣� - * https://baomidou.com/pages/42ea4a/ - * BlockAttackInnerInterceptor 濡傛灉鏄鍏ㄨ〃鐨勫垹闄ゆ垨鏇存柊鎿嶄綔锛屽氨浼氱粓姝㈣鎿嶄綔 - * https://baomidou.com/pages/f9a237/ - * IllegalSQLInnerInterceptor sql鎬ц兘瑙勮寖鎻掍欢(鍨冨溇SQL鎷︽埅) - * IdentifierGenerator 鑷畾涔変富閿瓥鐣� - * https://baomidou.com/pages/568eb2/ - * TenantLineInnerInterceptor 澶氱鎴锋彃浠� - * https://baomidou.com/pages/aef2f2/ - * DynamicTableNameInnerInterceptor 鍔ㄦ�佽〃鍚嶆彃浠� - * https://baomidou.com/pages/2a45ff/ - */ + /** + * PaginationInnerInterceptor 鍒嗛〉鎻掍欢锛岃嚜鍔ㄨ瘑鍒暟鎹簱绫诲瀷 + * https://baomidou.com/pages/97710a/ + * OptimisticLockerInnerInterceptor 涔愯閿佹彃浠� + * https://baomidou.com/pages/0d93c0/ + * MetaObjectHandler 鍏冨璞″瓧娈靛~鍏呮帶鍒跺櫒 + * https://baomidou.com/pages/4c6bcf/ + * ISqlInjector sql娉ㄥ叆鍣� + * https://baomidou.com/pages/42ea4a/ + * BlockAttackInnerInterceptor 濡傛灉鏄鍏ㄨ〃鐨勫垹闄ゆ垨鏇存柊鎿嶄綔锛屽氨浼氱粓姝㈣鎿嶄綔 + * https://baomidou.com/pages/f9a237/ + * IllegalSQLInnerInterceptor sql鎬ц兘瑙勮寖鎻掍欢(鍨冨溇SQL鎷︽埅) + * IdentifierGenerator 鑷畾涔変富閿瓥鐣� + * https://baomidou.com/pages/568eb2/ + * TenantLineInnerInterceptor 澶氱鎴锋彃浠� + * https://baomidou.com/pages/aef2f2/ + * DynamicTableNameInnerInterceptor 鍔ㄦ�佽〃鍚嶆彃浠� + * https://baomidou.com/pages/2a45ff/ + */ } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java index bf6bc8f..29d79d1 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java @@ -34,7 +34,7 @@ private SwaggerProperties swaggerProperties; @Autowired - private TokenProperties tokenProperties; + private TokenProperties tokenProperties; @Autowired private OpenApiExtensionResolver openApiExtensionResolver; @@ -44,30 +44,30 @@ */ @PostConstruct public void createRestApi() { - for (SwaggerProperties.Groups group : swaggerProperties.getGroups()) { - String basePackage = group.getBasePackage(); - Docket docket = new Docket(DocumentationType.OAS_30) - .enable(swaggerProperties.getEnabled()) - // 鐢ㄦ潵鍒涘缓璇PI鐨勫熀鏈俊鎭紝灞曠ず鍦ㄦ枃妗g殑椤甸潰涓紙鑷畾涔夊睍绀虹殑淇℃伅锛� - .apiInfo(apiInfo()) - // 璁剧疆鍝簺鎺ュ彛鏆撮湶缁橲wagger灞曠ず - .select() - // 鎵弿鎵�鏈夋湁娉ㄨВ鐨刟pi锛岀敤杩欑鏂瑰紡鏇寸伒娲� - //.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) - // 鎵弿鎸囧畾鍖呬腑鐨剆wagger娉ㄨВ - .apis(RequestHandlerSelectors.basePackage(basePackage)) - // 鎵弿鎵�鏈� .apis(RequestHandlerSelectors.any()) - .paths(PathSelectors.any()) - .build() - .groupName(group.getName()) - // 璁剧疆瀹夊叏妯″紡锛宻wagger鍙互璁剧疆璁块棶token - .securitySchemes(securitySchemes()) - .securityContexts(securityContexts()) - .extensions(openApiExtensionResolver.buildExtensions(group.getName())) - .pathMapping(swaggerProperties.getPathMapping()); - String beanName = StringUtils.substringAfterLast(basePackage, ".") + "Docket"; - SpringUtils.registerBean(beanName, docket); - } + for (SwaggerProperties.Groups group : swaggerProperties.getGroups()) { + String basePackage = group.getBasePackage(); + Docket docket = new Docket(DocumentationType.OAS_30) + .enable(swaggerProperties.getEnabled()) + // 鐢ㄦ潵鍒涘缓璇PI鐨勫熀鏈俊鎭紝灞曠ず鍦ㄦ枃妗g殑椤甸潰涓紙鑷畾涔夊睍绀虹殑淇℃伅锛� + .apiInfo(apiInfo()) + // 璁剧疆鍝簺鎺ュ彛鏆撮湶缁橲wagger灞曠ず + .select() + // 鎵弿鎵�鏈夋湁娉ㄨВ鐨刟pi锛岀敤杩欑鏂瑰紡鏇寸伒娲� + //.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + // 鎵弿鎸囧畾鍖呬腑鐨剆wagger娉ㄨВ + .apis(RequestHandlerSelectors.basePackage(basePackage)) + // 鎵弿鎵�鏈� .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() + .groupName(group.getName()) + // 璁剧疆瀹夊叏妯″紡锛宻wagger鍙互璁剧疆璁块棶token + .securitySchemes(securitySchemes()) + .securityContexts(securityContexts()) + .extensions(openApiExtensionResolver.buildExtensions(group.getName())) + .pathMapping(swaggerProperties.getPathMapping()); + String beanName = StringUtils.substringAfterLast(basePackage, ".") + "Docket"; + SpringUtils.registerBean(beanName, docket); + } } /** @@ -75,8 +75,8 @@ */ private List<SecurityScheme> securitySchemes() { List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); - String header = tokenProperties.getHeader(); - apiKeyList.add(new ApiKey(header, header, In.HEADER.toValue())); + String header = tokenProperties.getHeader(); + apiKeyList.add(new ApiKey(header, header, In.HEADER.toValue())); return apiKeyList; } @@ -86,10 +86,10 @@ private List<SecurityContext> securityContexts() { List<SecurityContext> securityContexts = new ArrayList<>(); securityContexts.add( - SecurityContext.builder() - .securityReferences(defaultAuth()) - .operationSelector(o -> o.requestMappingPattern().matches("/.*")) - .build()); + SecurityContext.builder() + .securityReferences(defaultAuth()) + .operationSelector(o -> o.requestMappingPattern().matches("/.*")) + .build()); return securityContexts; } @@ -112,14 +112,14 @@ // 鐢ˋpiInfoBuilder杩涜瀹氬埗 SwaggerProperties.Contact contact = swaggerProperties.getContact(); return new ApiInfoBuilder() - // 璁剧疆鏍囬 - .title(swaggerProperties.getTitle()) - // 鎻忚堪 - .description(swaggerProperties.getDescription()) - // 浣滆�呬俊鎭� - .contact(new Contact(contact.getName(), contact.getUrl(), contact.getEmail())) - // 鐗堟湰 - .version(swaggerProperties.getVersion()) - .build(); + // 璁剧疆鏍囬 + .title(swaggerProperties.getTitle()) + // 鎻忚堪 + .description(swaggerProperties.getDescription()) + // 浣滆�呬俊鎭� + .contact(new Contact(contact.getName(), contact.getUrl(), contact.getEmail())) + // 鐗堟湰 + .version(swaggerProperties.getVersion()) + .build(); } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/CaptchaProperties.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/CaptchaProperties.java index 354d8c3..1b41c66 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/CaptchaProperties.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/CaptchaProperties.java @@ -16,23 +16,23 @@ @ConfigurationProperties(prefix = "captcha") public class CaptchaProperties { - /** - * 楠岃瘉鐮佺被鍨� - */ + /** + * 楠岃瘉鐮佺被鍨� + */ private CaptchaType type; - /** - * 楠岃瘉鐮佺被鍒� - */ + /** + * 楠岃瘉鐮佺被鍒� + */ private CaptchaCategory category; - /** - * 鏁板瓧楠岃瘉鐮佷綅鏁� - */ + /** + * 鏁板瓧楠岃瘉鐮佷綅鏁� + */ private Integer numberLength; - /** - * 瀛楃楠岃瘉鐮侀暱搴� - */ + /** + * 瀛楃楠岃瘉鐮侀暱搴� + */ private Integer charLength; } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/RedissonProperties.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/RedissonProperties.java index 4516da2..0b9024d 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/RedissonProperties.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/RedissonProperties.java @@ -20,217 +20,217 @@ @ConfigurationProperties(prefix = "redisson") public class RedissonProperties { - /** - * 绾跨▼姹犳暟閲�,榛樿鍊� = 褰撳墠澶勭悊鏍告暟閲� * 2 - */ - private int threads; + /** + * 绾跨▼姹犳暟閲�,榛樿鍊� = 褰撳墠澶勭悊鏍告暟閲� * 2 + */ + private int threads; - /** - * Netty绾跨▼姹犳暟閲�,榛樿鍊� = 褰撳墠澶勭悊鏍告暟閲� * 2 - */ - private int nettyThreads; + /** + * Netty绾跨▼姹犳暟閲�,榛樿鍊� = 褰撳墠澶勭悊鏍告暟閲� * 2 + */ + private int nettyThreads; - /** - * 浼犺緭妯″紡 - */ - private TransportMode transportMode; + /** + * 浼犺緭妯″紡 + */ + private TransportMode transportMode; - /** - * 鍗曟満鏈嶅姟閰嶇疆 - */ - private SingleServerConfig singleServerConfig; + /** + * 鍗曟満鏈嶅姟閰嶇疆 + */ + private SingleServerConfig singleServerConfig; - /** - * 闆嗙兢鏈嶅姟閰嶇疆 - */ - private ClusterServersConfig clusterServersConfig; + /** + * 闆嗙兢鏈嶅姟閰嶇疆 + */ + private ClusterServersConfig clusterServersConfig; - /** - * 缂撳瓨缁� - */ - private List<CacheGroup> cacheGroup; + /** + * 缂撳瓨缁� + */ + private List<CacheGroup> cacheGroup; - @Data - @NoArgsConstructor - public static class SingleServerConfig { + @Data + @NoArgsConstructor + public static class SingleServerConfig { - /** - * 瀹㈡埛绔悕绉� - */ - private String clientName; + /** + * 瀹㈡埛绔悕绉� + */ + private String clientName; - /** - * 鏈�灏忕┖闂茶繛鎺ユ暟 - */ - private int connectionMinimumIdleSize; + /** + * 鏈�灏忕┖闂茶繛鎺ユ暟 + */ + private int connectionMinimumIdleSize; - /** - * 杩炴帴姹犲ぇ灏� - */ - private int connectionPoolSize; + /** + * 杩炴帴姹犲ぇ灏� + */ + private int connectionPoolSize; - /** - * 杩炴帴绌洪棽瓒呮椂锛屽崟浣嶏細姣 - */ - private int idleConnectionTimeout; + /** + * 杩炴帴绌洪棽瓒呮椂锛屽崟浣嶏細姣 + */ + private int idleConnectionTimeout; - /** - * 鍛戒护绛夊緟瓒呮椂锛屽崟浣嶏細姣 - */ - private int timeout; + /** + * 鍛戒护绛夊緟瓒呮椂锛屽崟浣嶏細姣 + */ + private int timeout; - /** - * 濡傛灉灏濊瘯鍦ㄦ闄愬埗涔嬪唴鍙戦�佹垚鍔燂紝鍒欏紑濮嬪惎鐢� timeout 璁℃椂銆� - */ - private int retryAttempts; + /** + * 濡傛灉灏濊瘯鍦ㄦ闄愬埗涔嬪唴鍙戦�佹垚鍔燂紝鍒欏紑濮嬪惎鐢� timeout 璁℃椂銆� + */ + private int retryAttempts; - /** - * 鍛戒护閲嶈瘯鍙戦�佹椂闂撮棿闅旓紝鍗曚綅锛氭绉� - */ - private int retryInterval; + /** + * 鍛戒护閲嶈瘯鍙戦�佹椂闂撮棿闅旓紝鍗曚綅锛氭绉� + */ + private int retryInterval; - /** - * 鍙戝竷鍜岃闃呰繛鎺ョ殑鏈�灏忕┖闂茶繛鎺ユ暟 - */ - private int subscriptionConnectionMinimumIdleSize; + /** + * 鍙戝竷鍜岃闃呰繛鎺ョ殑鏈�灏忕┖闂茶繛鎺ユ暟 + */ + private int subscriptionConnectionMinimumIdleSize; - /** - * 鍙戝竷鍜岃闃呰繛鎺ユ睜澶у皬 - */ - private int subscriptionConnectionPoolSize; + /** + * 鍙戝竷鍜岃闃呰繛鎺ユ睜澶у皬 + */ + private int subscriptionConnectionPoolSize; - /** - * 鍗曚釜杩炴帴鏈�澶ц闃呮暟閲� - */ - private int subscriptionsPerConnection; + /** + * 鍗曚釜杩炴帴鏈�澶ц闃呮暟閲� + */ + private int subscriptionsPerConnection; - /** - * DNS鐩戞祴鏃堕棿闂撮殧锛屽崟浣嶏細姣 - */ - private int dnsMonitoringInterval; + /** + * DNS鐩戞祴鏃堕棿闂撮殧锛屽崟浣嶏細姣 + */ + private int dnsMonitoringInterval; - } + } - @Data - @NoArgsConstructor - public static class ClusterServersConfig { + @Data + @NoArgsConstructor + public static class ClusterServersConfig { - /** - * 瀹㈡埛绔悕绉� - */ - private String clientName; + /** + * 瀹㈡埛绔悕绉� + */ + private String clientName; - /** - * master鏈�灏忕┖闂茶繛鎺ユ暟 - */ - private int masterConnectionMinimumIdleSize; + /** + * master鏈�灏忕┖闂茶繛鎺ユ暟 + */ + private int masterConnectionMinimumIdleSize; - /** - * master杩炴帴姹犲ぇ灏� - */ - private int masterConnectionPoolSize; + /** + * master杩炴帴姹犲ぇ灏� + */ + private int masterConnectionPoolSize; - /** - * slave鏈�灏忕┖闂茶繛鎺ユ暟 - */ - private int slaveConnectionMinimumIdleSize; + /** + * slave鏈�灏忕┖闂茶繛鎺ユ暟 + */ + private int slaveConnectionMinimumIdleSize; - /** - * slave杩炴帴姹犲ぇ灏� - */ - private int slaveConnectionPoolSize; + /** + * slave杩炴帴姹犲ぇ灏� + */ + private int slaveConnectionPoolSize; - /** - * 杩炴帴绌洪棽瓒呮椂锛屽崟浣嶏細姣 - */ - private int idleConnectionTimeout; + /** + * 杩炴帴绌洪棽瓒呮椂锛屽崟浣嶏細姣 + */ + private int idleConnectionTimeout; - /** - * ping瓒呮椂 - */ - private int pingConnectionInterval; + /** + * ping瓒呮椂 + */ + private int pingConnectionInterval; - /** - * 鍛戒护绛夊緟瓒呮椂锛屽崟浣嶏細姣 - */ - private int timeout; + /** + * 鍛戒护绛夊緟瓒呮椂锛屽崟浣嶏細姣 + */ + private int timeout; - /** - * 濡傛灉灏濊瘯鍦ㄦ闄愬埗涔嬪唴鍙戦�佹垚鍔燂紝鍒欏紑濮嬪惎鐢� timeout 璁℃椂銆� - */ - private int retryAttempts; + /** + * 濡傛灉灏濊瘯鍦ㄦ闄愬埗涔嬪唴鍙戦�佹垚鍔燂紝鍒欏紑濮嬪惎鐢� timeout 璁℃椂銆� + */ + private int retryAttempts; - /** - * 鍛戒护閲嶈瘯鍙戦�佹椂闂撮棿闅旓紝鍗曚綅锛氭绉� - */ - private int retryInterval; + /** + * 鍛戒护閲嶈瘯鍙戦�佹椂闂撮棿闅旓紝鍗曚綅锛氭绉� + */ + private int retryInterval; - /** - * 閿欒閲嶈瘯娆℃暟 - */ - private int failedSlaveReconnectionInterval; + /** + * 閿欒閲嶈瘯娆℃暟 + */ + private int failedSlaveReconnectionInterval; - /** - * 鍙戝竷鍜岃闃呰繛鎺ユ睜鏈�灏忕┖闂茶繛鎺ユ暟 - */ - private int subscriptionConnectionMinimumIdleSize; + /** + * 鍙戝竷鍜岃闃呰繛鎺ユ睜鏈�灏忕┖闂茶繛鎺ユ暟 + */ + private int subscriptionConnectionMinimumIdleSize; - /** - * 鍙戝竷鍜岃闃呰繛鎺ユ睜澶у皬 - */ - private int subscriptionConnectionPoolSize; + /** + * 鍙戝竷鍜岃闃呰繛鎺ユ睜澶у皬 + */ + private int subscriptionConnectionPoolSize; - /** - * 鍗曚釜杩炴帴鏈�澶ц闃呮暟閲� - */ - private int subscriptionsPerConnection; + /** + * 鍗曚釜杩炴帴鏈�澶ц闃呮暟閲� + */ + private int subscriptionsPerConnection; - /** - * 鎵弿闂撮殧 - */ - private int scanInterval; + /** + * 鎵弿闂撮殧 + */ + private int scanInterval; - /** - * DNS鐩戞祴鏃堕棿闂撮殧锛屽崟浣嶏細姣 - */ - private int dnsMonitoringInterval; + /** + * DNS鐩戞祴鏃堕棿闂撮殧锛屽崟浣嶏細姣 + */ + private int dnsMonitoringInterval; - /** - * 璇诲彇妯″紡 - */ - private ReadMode readMode; + /** + * 璇诲彇妯″紡 + */ + private ReadMode readMode; - /** - * 璁㈤槄妯″紡 - */ - private SubscriptionMode subscriptionMode; + /** + * 璁㈤槄妯″紡 + */ + private SubscriptionMode subscriptionMode; - } + } - @Data - @NoArgsConstructor - public static class CacheGroup { + @Data + @NoArgsConstructor + public static class CacheGroup { - /** - * 缁刬d - */ - private String groupId; + /** + * 缁刬d + */ + private String groupId; - /** - * 缁勮繃鏈熸椂闂� - */ - private long ttl; + /** + * 缁勮繃鏈熸椂闂� + */ + private long ttl; - /** - * 缁勬渶澶х┖闂叉椂闂� - */ - private long maxIdleTime; + /** + * 缁勬渶澶х┖闂叉椂闂� + */ + private long maxIdleTime; - /** - * 缁勬渶澶ч暱搴� - */ - private int maxSize; + /** + * 缁勬渶澶ч暱搴� + */ + private int maxSize; - } + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java index 9c4cd23..c2b3f97 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/SwaggerProperties.java @@ -21,10 +21,10 @@ * 楠岃瘉鐮佺被鍨� */ private Boolean enabled; - /** - * 璁剧疆璇锋眰鐨勭粺涓�鍓嶇紑 - */ - private String pathMapping; + /** + * 璁剧疆璇锋眰鐨勭粺涓�鍓嶇紑 + */ + private String pathMapping; /** * 楠岃瘉鐮佺被鍒� */ @@ -38,51 +38,51 @@ */ private String version; - /** - * 鑱旂郴鏂瑰紡 - */ + /** + * 鑱旂郴鏂瑰紡 + */ private Contact contact; - /** - * 缁勯厤缃� - */ - private List<Groups> groups; + /** + * 缁勯厤缃� + */ + private List<Groups> groups; @Data - @NoArgsConstructor - public static class Contact { + @NoArgsConstructor + public static class Contact { - /** - * 鑱旂郴浜� - */ - private String name; + /** + * 鑱旂郴浜� + */ + private String name; - /** - * 鑱旂郴浜簎rl - */ - private String url; + /** + * 鑱旂郴浜簎rl + */ + private String url; - /** - * 鑱旂郴浜篹mail - */ - private String email; + /** + * 鑱旂郴浜篹mail + */ + private String email; - } + } - @Data - @NoArgsConstructor - public static class Groups { + @Data + @NoArgsConstructor + public static class Groups { - /** - * 缁勫悕 - */ - private String name; + /** + * 缁勫悕 + */ + private String name; - /** - * 鍩虹鍖呰矾寰� - */ - private String basePackage; + /** + * 鍩虹鍖呰矾寰� + */ + private String basePackage; - } + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/CreateAndUpdateMetaObjectHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/CreateAndUpdateMetaObjectHandler.java index 7cf64c4..4c4f36c 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/CreateAndUpdateMetaObjectHandler.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/handler/CreateAndUpdateMetaObjectHandler.java @@ -22,43 +22,43 @@ @Slf4j public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler { - @Override - public void insertFill(MetaObject metaObject) { - try { - if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity) { - BaseEntity baseEntity = (BaseEntity) metaObject.getOriginalObject(); - Date current = new Date(); - // 鍒涘缓鏃堕棿涓虹┖ 鍒欏~鍏� - if (ObjectUtil.isNull(baseEntity.getCreateTime())) { - baseEntity.setCreateTime(current); - } - // 鏇存柊鏃堕棿涓虹┖ 鍒欏~鍏� - if (ObjectUtil.isNull(baseEntity.getUpdateTime())) { - baseEntity.setUpdateTime(current); - } - String username = getLoginUsername(); - // 褰撳墠宸茬櫥褰� 涓� 鍒涘缓浜轰负绌� 鍒欏~鍏� - if (StringUtils.isNotBlank(username) - && StringUtils.isBlank(baseEntity.getCreateBy())) { - baseEntity.setCreateBy(username); - } - // 褰撳墠宸茬櫥褰� 涓� 鏇存柊浜轰负绌� 鍒欏~鍏� - if (StringUtils.isNotBlank(username) - && StringUtils.isBlank(baseEntity.getUpdateBy())) { - baseEntity.setUpdateBy(username); - } - } - } catch (Exception e) { - throw new ServiceException("鑷姩娉ㄥ叆寮傚父 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); - } - } + @Override + public void insertFill(MetaObject metaObject) { + try { + if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity) { + BaseEntity baseEntity = (BaseEntity) metaObject.getOriginalObject(); + Date current = new Date(); + // 鍒涘缓鏃堕棿涓虹┖ 鍒欏~鍏� + if (ObjectUtil.isNull(baseEntity.getCreateTime())) { + baseEntity.setCreateTime(current); + } + // 鏇存柊鏃堕棿涓虹┖ 鍒欏~鍏� + if (ObjectUtil.isNull(baseEntity.getUpdateTime())) { + baseEntity.setUpdateTime(current); + } + String username = getLoginUsername(); + // 褰撳墠宸茬櫥褰� 涓� 鍒涘缓浜轰负绌� 鍒欏~鍏� + if (StringUtils.isNotBlank(username) + && StringUtils.isBlank(baseEntity.getCreateBy())) { + baseEntity.setCreateBy(username); + } + // 褰撳墠宸茬櫥褰� 涓� 鏇存柊浜轰负绌� 鍒欏~鍏� + if (StringUtils.isNotBlank(username) + && StringUtils.isBlank(baseEntity.getUpdateBy())) { + baseEntity.setUpdateBy(username); + } + } + } catch (Exception e) { + throw new ServiceException("鑷姩娉ㄥ叆寮傚父 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); + } + } - @Override - public void updateFill(MetaObject metaObject) { - try { - if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity) { - BaseEntity baseEntity = (BaseEntity) metaObject.getOriginalObject(); - Date current = new Date(); + @Override + public void updateFill(MetaObject metaObject) { + try { + if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity) { + BaseEntity baseEntity = (BaseEntity) metaObject.getOriginalObject(); + Date current = new Date(); // 鏇存柊鏃堕棿濉厖(涓嶇涓轰笉涓虹┖) baseEntity.setUpdateTime(current); String username = getLoginUsername(); @@ -66,24 +66,24 @@ if (StringUtils.isNotBlank(username)) { baseEntity.setUpdateBy(username); } - } - } catch (Exception e) { - throw new ServiceException("鑷姩娉ㄥ叆寮傚父 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); - } - } + } + } catch (Exception e) { + throw new ServiceException("鑷姩娉ㄥ叆寮傚父 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED); + } + } - /** - * 鑾峰彇鐧诲綍鐢ㄦ埛鍚� - */ - private String getLoginUsername() { - LoginUser loginUser; - try { - loginUser = SecurityUtils.getLoginUser(); - } catch (Exception e) { - log.warn("鑷姩娉ㄥ叆璀﹀憡 => 鐢ㄦ埛鏈櫥褰�"); - return null; - } - return loginUser.getUsername(); - } + /** + * 鑾峰彇鐧诲綍鐢ㄦ埛鍚� + */ + private String getLoginUsername() { + LoginUser loginUser; + try { + loginUser = SecurityUtils.getLoginUser(); + } catch (Exception e) { + log.warn("鑷姩娉ㄥ叆璀﹀憡 => 鐢ㄦ埛鏈櫥褰�"); + return null; + } + return loginUser.getUsername(); + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/jackson/BigNumberSerializer.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/jackson/BigNumberSerializer.java index 1781b94..a4aee15 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/jackson/BigNumberSerializer.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/jackson/BigNumberSerializer.java @@ -15,28 +15,28 @@ @JacksonStdImpl public class BigNumberSerializer extends NumberSerializer { - /** - * 鏍规嵁 JS Number.MAX_SAFE_INTEGER 涓� Number.MIN_SAFE_INTEGER 寰楁潵 - */ - private static final long MAX_SAFE_INTEGER = 9007199254740991L; - private static final long MIN_SAFE_INTEGER = -9007199254740991L; + /** + * 鏍规嵁 JS Number.MAX_SAFE_INTEGER 涓� Number.MIN_SAFE_INTEGER 寰楁潵 + */ + private static final long MAX_SAFE_INTEGER = 9007199254740991L; + private static final long MIN_SAFE_INTEGER = -9007199254740991L; - /** - * 鎻愪緵瀹炰緥 - */ - public static final BigNumberSerializer INSTANCE = new BigNumberSerializer(Number.class); + /** + * 鎻愪緵瀹炰緥 + */ + public static final BigNumberSerializer INSTANCE = new BigNumberSerializer(Number.class); - public BigNumberSerializer(Class<? extends Number> rawType) { - super(rawType); - } + public BigNumberSerializer(Class<? extends Number> rawType) { + super(rawType); + } - @Override - public void serialize(Number value, JsonGenerator gen, SerializerProvider provider) throws IOException { - // 瓒呭嚭鑼冨洿 搴忓垪鍖栦綅瀛楃涓� - if (value.longValue() > MIN_SAFE_INTEGER && value.longValue() < MAX_SAFE_INTEGER) { - super.serialize(value, gen, provider); - } else { - gen.writeString(value.toString()); - } - } + @Override + public void serialize(Number value, JsonGenerator gen, SerializerProvider provider) throws IOException { + // 瓒呭嚭鑼冨洿 搴忓垪鍖栦綅瀛楃涓� + if (value.longValue() > MIN_SAFE_INTEGER && value.longValue() < MAX_SAFE_INTEGER) { + super.serialize(value, gen, provider); + } else { + gen.writeString(value.toString()); + } + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java index ef77a21..9d27874 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java @@ -18,24 +18,24 @@ @Component public class ShutdownManager { - @Autowired - @Qualifier("scheduledExecutorService") - private ScheduledExecutorService scheduledExecutorService; + @Autowired + @Qualifier("scheduledExecutorService") + private ScheduledExecutorService scheduledExecutorService; - @PreDestroy - public void destroy() { - shutdownAsyncManager(); - } + @PreDestroy + public void destroy() { + shutdownAsyncManager(); + } - /** - * 鍋滄寮傛鎵ц浠诲姟 - */ - private void shutdownAsyncManager() { - try { - log.info("====鍏抽棴鍚庡彴浠诲姟浠诲姟绾跨▼姹�===="); - Threads.shutdownAndAwaitTermination(scheduledExecutorService); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } + /** + * 鍋滄寮傛鎵ц浠诲姟 + */ + private void shutdownAsyncManager() { + try { + log.info("====鍏抽棴鍚庡彴浠诲姟浠诲姟绾跨▼姹�===="); + Threads.shutdownAndAwaitTermination(scheduledExecutorService); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java index 76d8090..969af51 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java @@ -28,28 +28,28 @@ @Configuration public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler { - @Autowired - private TokenService tokenService; + @Autowired + private TokenService tokenService; - @Autowired - private LogininforService asyncService; + @Autowired + private LogininforService asyncService; - /** - * 閫�鍑哄鐞� - */ - @Override - public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) - throws IOException, ServletException { - LoginUser loginUser = tokenService.getLoginUser(request); + /** + * 閫�鍑哄鐞� + */ + @Override + public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) + throws IOException, ServletException { + LoginUser loginUser = tokenService.getLoginUser(request); String message = MessageUtils.message("user.logout.success"); if (StringUtils.isNotNull(loginUser)) { - String userName = loginUser.getUsername(); - // 鍒犻櫎鐢ㄦ埛缂撳瓨璁板綍 - tokenService.delLoginUser(loginUser.getToken()); - // 璁板綍鐢ㄦ埛閫�鍑烘棩蹇� - asyncService.recordLogininfor(userName, Constants.LOGOUT, message, request); - } - ServletUtils.renderString(response, JsonUtils.toJsonString(AjaxResult.error(HttpStatus.HTTP_OK, message))); - } + String userName = loginUser.getUsername(); + // 鍒犻櫎鐢ㄦ埛缂撳瓨璁板綍 + tokenService.delLoginUser(loginUser.getToken()); + // 璁板綍鐢ㄦ埛閫�鍑烘棩蹇� + asyncService.recordLogininfor(userName, Constants.LOGOUT, message, request); + } + ServletUtils.renderString(response, JsonUtils.toJsonString(AjaxResult.error(HttpStatus.HTTP_OK, message))); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java index 3b9fce0..19c7cd8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java @@ -70,7 +70,7 @@ */ @ApiModelProperty(value = "绯荤粺鍐呯疆锛圷鏄� N鍚︼級") @ExcelProperty(value = "绯荤粺鍐呯疆", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_yes_no") + @ExcelDictFormat(dictType = "sys_yes_no") private String configType; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java index 84ab555..ff77cee 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java @@ -52,7 +52,7 @@ */ @ApiModelProperty(value = "涓氬姟绫诲瀷锛�0鍏跺畠 1鏂板 2淇敼 3鍒犻櫎锛�") @ExcelProperty(value = "涓氬姟绫诲瀷", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_oper_type") + @ExcelDictFormat(dictType = "sys_oper_type") private Integer businessType; /** @@ -81,7 +81,7 @@ */ @ApiModelProperty(value = "鎿嶄綔绫诲埆锛�0鍏跺畠 1鍚庡彴鐢ㄦ埛 2鎵嬫満绔敤鎴凤級") @ExcelProperty(value = "鎿嶄綔绫诲埆", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "0=鍏跺畠,1=鍚庡彴鐢ㄦ埛,2=鎵嬫満绔敤鎴�") + @ExcelDictFormat(readConverterExp = "0=鍏跺畠,1=鍚庡彴鐢ㄦ埛,2=鎵嬫満绔敤鎴�") private Integer operatorType; /** @@ -138,7 +138,7 @@ */ @ApiModelProperty(value = "鎿嶄綔鐘舵�侊紙0姝e父 1寮傚父锛�") @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_common_status") + @ExcelDictFormat(dictType = "sys_common_status") private Integer status; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOss.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOss.java index 0793d04..d7d75e3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOss.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOss.java @@ -19,35 +19,35 @@ @TableName("sys_oss") public class SysOss extends BaseEntity { - /** - * 瀵硅薄瀛樺偍涓婚敭 - */ - @TableId(value = "oss_id", type = IdType.AUTO) - private Long ossId; + /** + * 瀵硅薄瀛樺偍涓婚敭 + */ + @TableId(value = "oss_id", type = IdType.AUTO) + private Long ossId; - /** - * 鏂囦欢鍚� - */ - private String fileName; + /** + * 鏂囦欢鍚� + */ + private String fileName; - /** - * 鍘熷悕 - */ - private String originalName; + /** + * 鍘熷悕 + */ + private String originalName; - /** - * 鏂囦欢鍚庣紑鍚� - */ - private String fileSuffix; + /** + * 鏂囦欢鍚庣紑鍚� + */ + private String fileSuffix; - /** - * URL鍦板潃 - */ - private String url; + /** + * URL鍦板潃 + */ + private String url; - /** - * 鏈嶅姟鍟� - */ - private String service; + /** + * 鏈嶅姟鍟� + */ + private String service; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java index b0b8a11..6b99ceb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java @@ -69,8 +69,8 @@ * 鐘舵�侊紙0姝e父 1鍋滅敤锛� */ @ApiModelProperty(value = "鐘舵�侊紙0姝e父 1鍋滅敤锛�") - @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class) - @ExcelDictFormat(dictType = "sys_common_status") + @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "sys_common_status") private String status; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index a604a12..9672fe0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -426,9 +426,8 @@ * * @return */ - public String innerLinkReplaceEach(String path) - { - return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS }, - new String[] { "", "" }); + public String innerLinkReplaceEach(String path) { + return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS}, + new String[]{"", ""}); } } -- Gitblit v1.9.3