Browse Source

评论改查代码提交

pans 7 months ago
parent
commit
37a01d683b

+ 2 - 2
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/ResourceFileFormatController.java

@@ -74,8 +74,8 @@ public class ResourceFileFormatController {
     @ApiOperationSupport(order = 1)
     @ApiOperation("resource_file_format-全量列表")
     @GetMapping("/disk/fileformat/allList")
-    public CommonResult<List<ResourceFileFormat>> allList(ResourceFileFormatPageParam resourceFileFormatPageParam) {
-        return CommonResult.data(resourceFileFormatService.allList(resourceFileFormatPageParam));
+    public CommonResult<List<ResourceFileFormat>> allList() {
+        return CommonResult.data(resourceFileFormatService.allList());
     }
 
     /**

+ 1 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/ResourceFileFormatService.java

@@ -44,7 +44,7 @@ public interface ResourceFileFormatService extends IService<ResourceFileFormat>
      * @author pans
      * @date  2025/06/28 12:01
      */
-    List<ResourceFileFormat> allList(ResourceFileFormatPageParam resourceFileFormatPageParam);
+    List<ResourceFileFormat> allList();
 
     /**
      * 添加resource_file_format

+ 8 - 12
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/ResourceFileFormatServiceImpl.java

@@ -67,20 +67,16 @@ public class ResourceFileFormatServiceImpl extends ServiceImpl<ResourceFileForma
      * @date  2025/06/28 12:01
      */
     @Override
-    public List<ResourceFileFormat> allList(ResourceFileFormatPageParam resourceFileFormatPageParam)
+    public List<ResourceFileFormat> allList()
     {
         QueryWrapper<ResourceFileFormat> queryWrapper = new QueryWrapper<>();
-        if(ObjectUtil.isNotEmpty(resourceFileFormatPageParam.getSearchKey())){
-            queryWrapper.lambda().like(ResourceFileFormat::getFileExtendName, resourceFileFormatPageParam.getSearchKey());
-        }
-        if(ObjectUtil.isAllNotEmpty(resourceFileFormatPageParam.getSortField(), resourceFileFormatPageParam.getSortOrder())) {
-            CommonSortOrderEnum.validate(resourceFileFormatPageParam.getSortOrder());
-            queryWrapper.orderBy(true, resourceFileFormatPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
-                    StrUtil.toUnderlineCase(resourceFileFormatPageParam.getSortField()));
-        } else {
-            queryWrapper.lambda().orderByAsc(ResourceFileFormat::getId);
-        }
-        return this.list(queryWrapper);
+        queryWrapper.lambda().orderByAsc(ResourceFileFormat::getId);
+        List<ResourceFileFormat> list = this.list(queryWrapper);
+
+        ResourceFileFormat  resourceFileFormat =new ResourceFileFormat();
+        resourceFileFormat.setFileExtendName("全部");
+        list.add(0,resourceFileFormat);
+        return list;
     }
 
     @Transactional(rollbackFor = Exception.class)

+ 38 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/util/CheckThreadPool.java

@@ -0,0 +1,38 @@
+package vip.xiaonuo.disk.util;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created with IntelliJ IDEA.
+ *
+ * @Author: zouwang
+ * @Date: 2024/04/18/10:29
+ * @Description:
+ */
+public class CheckThreadPool {
+
+    private static final int THREAD_POOL_SIZE = 50;
+    private static final int MAX_POOL_SIZE = 300;
+    private static final int QUEUE_CAPACITY = 1000;
+
+
+    private static final ThreadPoolExecutor executor = new ThreadPoolExecutor(
+            THREAD_POOL_SIZE,
+            MAX_POOL_SIZE,
+            1000L,
+            TimeUnit.MILLISECONDS,
+            new ArrayBlockingQueue<>(QUEUE_CAPACITY)
+    );
+
+    private CheckThreadPool() {
+    }
+
+
+    public static ExecutorService getExecutor() {
+        return executor;
+    }
+
+}