mirror of https://github.com/halo-dev/halo
fix: api parameter names in the post list content api. (#1415)
parent
878e7155a8
commit
02e4b88288
|
@ -65,13 +65,14 @@ public class PostController {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CS304 issue for https://github.com/halo-dev/halo/issues/1351
|
//CS304 issue for https://github.com/halo-dev/halo/issues/1351
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable users search published articles with keywords
|
* Enable users search published articles with keywords
|
||||||
*
|
*
|
||||||
* @param pageable store the priority of the sort algorithm
|
* @param pageable store the priority of the sort algorithm
|
||||||
* @param keyword search articles with keyword
|
* @param keyword search articles with keyword
|
||||||
* @param categoryid search articles with categoryid
|
* @param categoryId search articles with categoryId
|
||||||
* @return published articles that contains keywords and specific categoryid
|
* @return published articles that contains keywords and specific categoryid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
@ -79,10 +80,10 @@ public class PostController {
|
||||||
public Page<PostListVO> pageBy(
|
public Page<PostListVO> pageBy(
|
||||||
@PageableDefault(sort = {"topPriority", "createTime"}, direction = DESC) Pageable pageable,
|
@PageableDefault(sort = {"topPriority", "createTime"}, direction = DESC) Pageable pageable,
|
||||||
@RequestParam(value = "keyword") String keyword,
|
@RequestParam(value = "keyword") String keyword,
|
||||||
@RequestParam(value = "categoryid") int categoryid) {
|
@RequestParam(value = "categoryId") Integer categoryId) {
|
||||||
PostQuery postQuery = new PostQuery();
|
PostQuery postQuery = new PostQuery();
|
||||||
postQuery.setKeyword(keyword);
|
postQuery.setKeyword(keyword);
|
||||||
postQuery.setCategoryId(categoryid);
|
postQuery.setCategoryId(categoryId);
|
||||||
postQuery.setStatus(PostStatus.PUBLISHED);
|
postQuery.setStatus(PostStatus.PUBLISHED);
|
||||||
Page<Post> postPage = postService.pageBy(postQuery, pageable);
|
Page<Post> postPage = postService.pageBy(postQuery, pageable);
|
||||||
return postService.convertToListVo(postPage, true);
|
return postService.convertToListVo(postPage, true);
|
||||||
|
|
Loading…
Reference in New Issue