Commit 5899f2350cbcff0c05eede090713bfa519a3b88c
1 parent
68ae977b
feat:开发看板介绍获取所以图片接口
Showing
2 changed files
with
42 additions
and
8 deletions
src/main/java/com/huaheng/api/tv/controller/TvController.java
@@ -34,6 +34,7 @@ import org.jetbrains.annotations.NotNull; | @@ -34,6 +34,7 @@ import org.jetbrains.annotations.NotNull; | ||
34 | import org.springframework.web.bind.annotation.*; | 34 | import org.springframework.web.bind.annotation.*; |
35 | 35 | ||
36 | import javax.annotation.Resource; | 36 | import javax.annotation.Resource; |
37 | +import java.io.File; | ||
37 | import java.util.*; | 38 | import java.util.*; |
38 | 39 | ||
39 | @RestController | 40 | @RestController |
@@ -84,6 +85,39 @@ public class TvController extends BaseController { | @@ -84,6 +85,39 @@ public class TvController extends BaseController { | ||
84 | // allBean.setUpList(upList); | 85 | // allBean.setUpList(upList); |
85 | // return TVResult.success(allBean); | 86 | // return TVResult.success(allBean); |
86 | //} | 87 | //} |
88 | + @GetMapping("/queryAllPicture") | ||
89 | + public List<String> queryAllPicture() { | ||
90 | + //String directoryPath = "D:/Huaheng/uploadPath/file/"; | ||
91 | + String directoryPath = "/Users/yiwenpeng/Desktop/素材"; | ||
92 | + return listImageFiles(directoryPath); | ||
93 | + } | ||
94 | + | ||
95 | + public List<String> listImageFiles(String directoryPath) { | ||
96 | + List<String> imageFiles = new ArrayList<>(); | ||
97 | + | ||
98 | + File directory = new File(directoryPath); | ||
99 | + File[] files = directory.listFiles(); | ||
100 | + | ||
101 | + if (files != null) { | ||
102 | + for (File file : files) { | ||
103 | + if (file.isFile() && isImageFile(file.getName())) { | ||
104 | + imageFiles.add(file.getAbsolutePath()); | ||
105 | + } | ||
106 | + } | ||
107 | + } | ||
108 | + | ||
109 | + return imageFiles; | ||
110 | + } | ||
111 | + | ||
112 | + public boolean isImageFile(String fileName) { | ||
113 | + String[] imageExtensions = {".jpg", ".jpeg", ".png", ".gif", ".bmp"}; | ||
114 | + for (String extension : imageExtensions) { | ||
115 | + if (fileName.toLowerCase().endsWith(extension)) { | ||
116 | + return true; | ||
117 | + } | ||
118 | + } | ||
119 | + return false; | ||
120 | + } | ||
87 | 121 | ||
88 | 122 | ||
89 | //入库看板1,240221(未完成任务) | 123 | //入库看板1,240221(未完成任务) |
src/main/java/com/huaheng/framework/config/ShiroConfig.java
@@ -280,14 +280,14 @@ public class ShiroConfig { | @@ -280,14 +280,14 @@ public class ShiroConfig { | ||
280 | filterChainDefinitionMap.put("/mobile/receipt/batch/**", "anon"); | 280 | filterChainDefinitionMap.put("/mobile/receipt/batch/**", "anon"); |
281 | 281 | ||
282 | //todo pda出入库查询,测试后注释 | 282 | //todo pda出入库查询,测试后注释 |
283 | - filterChainDefinitionMap.put("/receipt/receiptHeader/listPda", "anon"); | ||
284 | - filterChainDefinitionMap.put("/receipt/receiptDetail/list", "anon"); | ||
285 | - filterChainDefinitionMap.put("/receipt/receiptDetail/pdaList", "anon"); | ||
286 | - filterChainDefinitionMap.put("/task/taskHeader/getTaskByTaskId", "anon"); | ||
287 | - filterChainDefinitionMap.put("/task/taskHeader/getTaskByShipmentCode", "anon"); | ||
288 | - filterChainDefinitionMap.put("/mobile/inventory/completeTaskListByWMS", "anon"); | ||
289 | - filterChainDefinitionMap.put("/receipt/receiving/saveBatch", "anon"); | ||
290 | - filterChainDefinitionMap.put("/config/zone/getAllFlatLocation", "anon"); | 283 | + //filterChainDefinitionMap.put("/receipt/receiptHeader/listPda", "anon"); |
284 | + //filterChainDefinitionMap.put("/receipt/receiptDetail/list", "anon"); | ||
285 | + //filterChainDefinitionMap.put("/receipt/receiptDetail/pdaList", "anon"); | ||
286 | + //filterChainDefinitionMap.put("/task/taskHeader/getTaskByTaskId", "anon"); | ||
287 | + //filterChainDefinitionMap.put("/task/taskHeader/getTaskByShipmentCode", "anon"); | ||
288 | + //filterChainDefinitionMap.put("/mobile/inventory/completeTaskListByWMS", "anon"); | ||
289 | + //filterChainDefinitionMap.put("/receipt/receiving/saveBatch", "anon"); | ||
290 | + //filterChainDefinitionMap.put("/config/zone/getAllFlatLocation", "anon"); | ||
291 | 291 | ||
292 | 292 | ||
293 | // 系统权限列表 | 293 | // 系统权限列表 |