fix: category and tag query parameters in post query (#2441)

#### What type of PR is this?
/kind api-change
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
修复文章列表的分类、标签查询参数方法名和取值不一致导致无效问题
#### Which issue(s) this PR fixes:

Fixes #2439

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/2453/head
guqing 2022-09-21 21:58:12 +08:00 committed by GitHub
parent ac8dd74211
commit eee81e78f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package run.halo.app.content;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import java.util.Set;
import org.springframework.lang.Nullable;
@ -20,16 +21,19 @@ public class PostQuery extends IListRequest.QueryListRequest {
}
@Nullable
@Schema(name = "contributor")
public Set<String> getContributors() {
return listToSet(queryParams.get("contributor"));
}
@Nullable
@Schema(name = "category")
public Set<String> getCategories() {
return listToSet(queryParams.get("category"));
}
@Nullable
@Schema(name = "tag")
public Set<String> getTags() {
return listToSet(queryParams.get("tag"));
}