perf: change the default sort order of articles (#2480)

#### What type of PR is this?

/kind improvement
/milestone 2.0
/area core

#### What this PR does / why we need it:

修改文章列表的默认排序规则,之前是按照创建时间(createTime)升序,现在改为降序。即最新创建的文章在前面。

#### Special notes for your reviewer:

测试方式:

连续创建多篇文章,检查前后台的文章排序是否是最新的在最前面。

/cc @halo-dev/sig-halo 

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/2484/head
Ryan Wang 2022-09-28 14:52:16 +08:00 committed by GitHub
parent 91793a7e03
commit e954af88ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -73,7 +73,6 @@ public enum PostSorter {
Function<Post, Instant> createTime =
post -> post.getMetadata().getCreationTimestamp();
return Comparator.comparing(createTime)
.thenComparing(name)
.reversed();
.thenComparing(name);
}
}