shiqian 4 жил өмнө
parent
commit
78e66ac0ad

+ 3 - 3
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java

@@ -20,14 +20,14 @@ public class ObjectUtils {
     private static final String NULL = "null";
     private static final String UNDEFINED = "undefined";
 
-    public static  <T> Collection<T> requiredNonNull(Collection<T> input, String... errorMsg){
+    public static  <T> Collection<T> requireNonNull(Collection<T> input, String... errorMsg){
         if (null == input || input.size() == 0) {
             throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }
 
-    public static long[] requiredNonNull(long[] input, String... errorMsg){
+    public static long[] requireNonNull(long[] input, String... errorMsg){
         if (ArrayUtils.isEmpty(input)) {
             throw new IllegalArgumentException(errorMsg[0]);
         }
@@ -36,7 +36,7 @@ public class ObjectUtils {
     }
 
 
-    public static Long[] requiredNonNull(Long[] input, String... errorMsg){
+    public static Long[] requireNonNull(Long[] input, String... errorMsg){
         if (ArrayUtils.isEmpty(input)) {
             throw new IllegalArgumentException(errorMsg[0]);
         }

+ 4 - 5
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/MyController.java

@@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
-import static com.boman.common.core.utils.obj.ObjectUtils.requiredNonNull;
 
 /**
  * @author shiqian
@@ -50,16 +49,16 @@ public class MyController extends BaseController {
     @GetMapping("/loadTable")
     public AjaxResult loadTable(GenTable genTable) {
         List<GenTable> tableList = genTableService.selectGenTableList(genTable);
-        requiredNonNull(tableList);
+        requireNonNull(tableList);
 
         // load table and tableColumn
         List<Long> tableIdList = tableList.stream().map(GenTable::getTableId).collect(Collectors.toList());
         List<GenTableColumn> genTableColumns = genTableColumnService.listByTableIdList(tableIdList);
-        requiredNonNull(genTableColumns);
+        requireNonNull(genTableColumns);
         packTableAndInsertToRedis(tableList, genTableColumns);
 
         List<GenTableRelation> relationList = genTableRelationService.selectGenTableRelationList(new GenTableRelation());
-        requiredNonNull(relationList);
+        requireNonNull(relationList);
         // load gen_table_relation表数据到redis
         redisService.setCacheObject(RedisKey.RELATION_INFO, relationList, 12L, TimeUnit.DAYS);
 
@@ -86,7 +85,7 @@ public class MyController extends BaseController {
                     List<GenTable> collect = tableList.stream()
                             .filter(genTable -> genTable.getTableId().equals(childId))
                             .collect(Collectors.toList());
-                    tableListTemp.add(requireNonNull(collect).get(0));
+                    tableListTemp.add(collect.get(0));
                 }
             }
             table.setRelationList(tableListTemp);

+ 2 - 2
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java

@@ -122,7 +122,7 @@ public class TableServiceCmdService {
     public AjaxResult objectDelete(BaseTableSaveDTO dto) {
         requireNonNull(dto.getTable());
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
-        requiredNonNull(idArr);
+        requireNonNull(idArr);
         // 拿到pkName
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
         String pkName = IdUtils.getPkName(genTable.getColumns());
@@ -149,7 +149,7 @@ public class TableServiceCmdService {
     public AjaxResult objectLogicDelete(BaseTableSaveDTO dto) {
         requireNonNull(dto.getTable());
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
-        requiredNonNull(idArr);
+        requireNonNull(idArr);
 
         // 拿到pkName
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());