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)
|
* Post priority (default is 0)
|
||||||
*/
|
*/
|
||||||
@ColumnDefault("0")
|
@ColumnDefault("0")
|
||||||
private Integer priority;
|
private Integer postPriority;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
public Date getPostDate() {
|
public Date getPostDate() {
|
||||||
|
@ -176,8 +176,8 @@ public class Post implements Serializable {
|
||||||
postUpdate = now;
|
postUpdate = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priority == null) {
|
if (postPriority == null) {
|
||||||
priority = 0;
|
postPriority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
postId = null;
|
postId = null;
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class FrontIndexController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String index(Model model) {
|
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,
|
public String index(Model model,
|
||||||
@PathVariable(value = "page") Integer page,
|
@PathVariable(value = "page") Integer page,
|
||||||
@SortDefault.SortDefaults({
|
@SortDefault.SortDefaults({
|
||||||
@SortDefault(sort = "priority", direction = DESC),
|
@SortDefault(sort = "postPriority", direction = DESC),
|
||||||
@SortDefault(sort = "postDate", direction = DESC)
|
@SortDefault(sort = "postDate", direction = DESC)
|
||||||
}) Sort sort) {
|
}) Sort sort) {
|
||||||
log.debug("Requested index page, sort info: [{}]", sort);
|
log.debug("Requested index page, sort info: [{}]", sort);
|
||||||
|
|
Loading…
Reference in New Issue