fix: application 列表页面按照 commit.createdAt 倒叙排序

This commit is contained in:
shizhendong
2024-11-07 16:57:14 +08:00
parent 336c4ed778
commit c7d493f150

View File

@@ -574,6 +574,12 @@ public class GitServiceImpl implements IGitService {
map.put("commit", this.buildAswCommitInfo(lastCommit)); map.put("commit", this.buildAswCommitInfo(lastCommit));
} }
} }
// 按照提交日期倒叙
resultList = resultList.stream().sorted(Comparator.comparing(map -> {
Map commit = T.MapUtil.get((Map) map, "commit", Map.class, new HashMap(2));
return (Long) T.MapUtil.getLong(commit, "createdAt", 0l);
}).reversed()).collect(Collectors.toList());
} catch (IOException e) { } catch (IOException e) {
log.error(e, "[listApplication] [error] [workspaceId: {}] [branch: {}]", workspaceId, branch); log.error(e, "[listApplication] [error] [workspaceId: {}] [branch: {}]", workspaceId, branch);
throw new ASWException(RCode.ERROR); throw new ASWException(RCode.ERROR);