✏️ modify the property of the post class priority to postPriority

pull/137/head
ruibaby 2019-03-03 09:16:18 +08:00
parent be6c4fb7d1
commit d39ffbb382
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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);