mirror of https://github.com/halo-dev/halo
✏️ modify the property of the post class priority to postPriority
parent
be6c4fb7d1
commit
d39ffbb382
|
@ -152,7 +152,7 @@ public class Post implements Serializable {
|
|||
* Post priority (default is 0)
|
||||
*/
|
||||
@ColumnDefault("0")
|
||||
private Integer priority;
|
||||
private Integer postPriority;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
public Date getPostDate() {
|
||||
|
@ -176,8 +176,8 @@ public class Post implements Serializable {
|
|||
postUpdate = now;
|
||||
}
|
||||
|
||||
if (priority == null) {
|
||||
priority = 0;
|
||||
if (postPriority == null) {
|
||||
postPriority = 0;
|
||||
}
|
||||
|
||||
postId = null;
|
||||
|
|
|
@ -46,7 +46,7 @@ public class FrontIndexController extends BaseController {
|
|||
*/
|
||||
@GetMapping
|
||||
public String index(Model model) {
|
||||
return this.index(model, 1, Sort.by(DESC, "priority").and(Sort.by(DESC, "postDate")));
|
||||
return this.index(model, 1, Sort.by(DESC, "postPriority").and(Sort.by(DESC, "postDate")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,7 +60,7 @@ public class FrontIndexController extends BaseController {
|
|||
public String index(Model model,
|
||||
@PathVariable(value = "page") Integer page,
|
||||
@SortDefault.SortDefaults({
|
||||
@SortDefault(sort = "priority", direction = DESC),
|
||||
@SortDefault(sort = "postPriority", direction = DESC),
|
||||
@SortDefault(sort = "postDate", direction = DESC)
|
||||
}) Sort sort) {
|
||||
log.debug("Requested index page, sort info: [{}]", sort);
|
||||
|
|
Loading…
Reference in New Issue