Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the keyword and categoryId parameters of the post list api are required #1432 #1436

Merged
merged 2 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

# next

## Bug Fixes

- 修复 Content Api 中文章列表接口的 `keyword` 和 `categoryId` 参数为必传的问题。

# 1.4.10

## Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ public PostController(PostService postService,
* @param pageable store the priority of the sort algorithm
* @param keyword search articles with keyword
* @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
@ApiOperation("Lists posts")
public Page<PostListVO> pageBy(
@PageableDefault(sort = {"topPriority", "createTime"}, direction = DESC) Pageable pageable,
@RequestParam(value = "keyword") String keyword,
@RequestParam(value = "categoryId") Integer categoryId) {
@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "categoryId", required = false) Integer categoryId) {
PostQuery postQuery = new PostQuery();
postQuery.setKeyword(keyword);
postQuery.setCategoryId(categoryId);
Expand Down