fix: application 新增|导入 接口默认不再添加 icon.png 文件
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user