diff options
| author | shizhendong <[email protected]> | 2024-11-18 09:39:09 +0800 |
|---|---|---|
| committer | shizhendong <[email protected]> | 2024-11-18 09:39:09 +0800 |
| commit | 55a2dabc0db6f74bf58a763598ec949d0298556e (patch) | |
| tree | 6a783d57c0408d637c94147053d39f544f081ced | |
| parent | b368080eafbd775d5b83fb2df9551bae7c6eb8d7 (diff) | |
fix: application 新增|导入 接口默认不再添加 icon.png 文件
| -rw-r--r-- | src/main/java/net/geedge/asw/module/app/service/impl/ApplicationServiceImpl.java | 2 | ||||
| -rw-r--r-- | src/main/java/net/geedge/asw/module/app/service/impl/GitServiceImpl.java | 18 |
2 files changed, 2 insertions, 18 deletions
diff --git a/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationServiceImpl.java b/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationServiceImpl.java index 42495ad..8eb8068 100644 --- a/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationServiceImpl.java +++ b/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationServiceImpl.java @@ -163,7 +163,7 @@ public class ApplicationServiceImpl implements IApplicationService { } // 新增APP for (ApplicationEntity entity : addAppList) { - for (String fileName : T.ListUtil.of("README.md", "meta.json", "signature.json", "icon.png")) { + for (String fileName : T.ListUtil.of("README.md", "meta.json", "signature.json")) { String fileContent = T.StrUtil.EMPTY; if ("meta.json".equals(fileName)) { JSONObject tempJSONObject = T.JSONUtil.parseObj(entity); diff --git a/src/main/java/net/geedge/asw/module/app/service/impl/GitServiceImpl.java b/src/main/java/net/geedge/asw/module/app/service/impl/GitServiceImpl.java index 3a14315..12d604c 100644 --- a/src/main/java/net/geedge/asw/module/app/service/impl/GitServiceImpl.java +++ b/src/main/java/net/geedge/asw/module/app/service/impl/GitServiceImpl.java @@ -592,9 +592,7 @@ public class GitServiceImpl implements IGitService { treeWalk.setFilter(PathFilter.create("applications/")); treeWalk.setRecursive(true); - Map<String, String> appIconDataMapping = T.MapUtil.newHashMap(); Map<String, String> appDirPathMapping = T.MapUtil.newHashMap(true); - while (treeWalk.next()) { String filePath = treeWalk.getPathString(); String fileName = treeWalk.getNameString(); @@ -624,13 +622,6 @@ public class GitServiceImpl implements IGitService { appDirPathMapping.put(applicationName, appDirPath); resultList.add(m); - } else if (T.StrUtil.equals("icon.png", fileName)) { - ObjectLoader loader = repository.open(treeWalk.getObjectId(0)); - byte[] bytes = loader.getBytes(); - if (T.ObjectUtil.isNotEmpty(bytes)) { - String dirPath = treeWalk.getPathString().replaceAll(fileName, ""); - appIconDataMapping.put(dirPath, Base64.getEncoder().encodeToString(bytes)); - } } } @@ -638,13 +629,6 @@ public class GitServiceImpl implements IGitService { for (Map<Object, Object> map : resultList) { String applicationName = T.MapUtil.getStr(map, "name"); - if (T.StrUtil.isNotEmpty(applicationName)) { - String iconBase64Str = appIconDataMapping.get(T.StrUtil.concat(true, "applications/", applicationName, "/")); - if (T.StrUtil.isNotEmpty(iconBase64Str)) { - map.put("icon", "data:image/png;base64," + iconBase64Str); - } - } - RevCommit lastCommit = T.MapUtil.get(lastCommitMapping, applicationName, RevCommit.class); map.put("commit", this.buildAswCommitInfo(lastCommit)); } @@ -718,7 +702,7 @@ public class GitServiceImpl implements IGitService { Repository repository = git.getRepository(); Map<String, ObjectId> filePathAndBlobIdMap = T.MapUtil.newHashMap(true); - for (String str : T.ListUtil.of("README.md", "meta.json", "signature.json", "icon.png")) { + for (String str : T.ListUtil.of("README.md", "meta.json", "signature.json")) { String savePath = T.StrUtil.concat(true, "applications/", applicationName, "/", str); String fileContent = T.StrUtil.EMPTY; |
