fix: api parameter names in the post list content api. (#1415)

pull/1414/head
Ryan Wang 2021-07-11 23:49:20 +08:00 committed by GitHub
parent 878e7155a8
commit 02e4b88288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -65,12 +65,13 @@ public class PostController {
}
//CS304 issue for https://github.com/halo-dev/halo/issues/1351
/**
* Enable users search published articles with keywords
*
* @param pageable store the priority of the sort algorithm
* @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
*/
@ -79,10 +80,10 @@ public class PostController {
public Page<PostListVO> pageBy(
@PageableDefault(sort = {"topPriority", "createTime"}, direction = DESC) Pageable pageable,
@RequestParam(value = "keyword") String keyword,
@RequestParam(value = "categoryid") int categoryid) {
@RequestParam(value = "categoryId") Integer categoryId) {
PostQuery postQuery = new PostQuery();
postQuery.setKeyword(keyword);
postQuery.setCategoryId(categoryid);
postQuery.setCategoryId(categoryId);
postQuery.setStatus(PostStatus.PUBLISHED);
Page<Post> postPage = postService.pageBy(postQuery, pageable);
return postService.convertToListVo(postPage, true);