mirror of
https://gitee.com/blossom-editor/blossom.git
synced 2025-12-07 17:28:27 +08:00
commit
aa4bfb0c7d
@ -58,9 +58,16 @@ public class TodoUtil {
|
|||||||
if (CollUtil.isEmpty(todos)) {
|
if (CollUtil.isEmpty(todos)) {
|
||||||
return "无内容";
|
return "无内容";
|
||||||
}
|
}
|
||||||
Map<String, List<TodoEntity>> maps = todos.stream().collect(Collectors.groupingBy(TodoEntity::getTodoName));
|
|
||||||
|
List<Map.Entry<String, List<TodoEntity>>> entryList = todos.stream()
|
||||||
|
.collect(Collectors.groupingBy(TodoEntity::getTodoName))
|
||||||
|
// 增加根据Todo name的排序
|
||||||
|
.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toList());
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
maps.forEach((todoName, tasks) -> {
|
entryList.forEach(entry -> {
|
||||||
|
String todoName = entry.getKey();
|
||||||
|
List<TodoEntity> tasks = entry.getValue();
|
||||||
sb.append(String.format("# %s \n\n", todoName));
|
sb.append(String.format("# %s \n\n", todoName));
|
||||||
|
|
||||||
for (TodoEntity task : tasks) {
|
for (TodoEntity task : tasks) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user