Modify the content api to support list posts with new class PostQueryContent.#1373
Merged
Conversation
Member
|
感觉这样做不太好,还不如直接把 keyword 和 categoryId 当做参数。 你要修改的话,直接在这个分支 push commit 就行了,不用重新开 pr。 |
Contributor
Author
|
好的,我再尝试下,谢谢! |
ruibaby
requested changes
May 16, 2021
| Page<Post> postPage = postService.pageBy(PostStatus.PUBLISHED, pageable); | ||
| return postService.convertToListVo(postPage); | ||
| @PageableDefault(sort = {"topPriority", "createTime"}, direction = DESC) Pageable pageable, | ||
| @RequestParam(value = "keyword") String keyword) { |
| PostStatus status = PostStatus.PUBLISHED; | ||
| PostQuery postQuery=new PostQuery(); | ||
| postQuery.setKeyword(keyword); | ||
| postQuery.setStatus(status); |
Member
There was a problem hiding this comment.
直接 postQuery.setStatue(PostStatus.PUBLISHED) 就好了。
Contributor
Author
|
修改好了,添加了categoryid,简化了代码。 |
ruibaby
approved these changes
May 16, 2021
Member
|
需要处理一下 checkstyle 异常。 https://github.com/halo-dev/halo/pull/1373/checks?check_run_id=2596554135 |
|
收到,我修改下! |
|
修改了checkstyle,然后那个title我最后其实放弃了用新的类的思路,直接通过requestparams去获取参数了。 |
ruibaby
approved these changes
May 17, 2021
Member
什么 title |
|
哦哦,就是我怕这个pr的名字有误导性--Modify the content api to support list posts with new class PostQueryContent. 因为我后来没有采用这个引入新类的方法了 |
Member
|
@Cui-Yusong @1171-jpg 同一个人? |
|
啊不是,代码是我写的,提交时用的@Cui-Yusong 的账号,造成困扰了,不好意思哈 |
ruibaby
pushed a commit
to ruibaby/halo
that referenced
this pull request
Jun 11, 2021
…ategory params. (halo-dev#1373) * Modefy the content api to support list posts with new class PostQueryContent * Modefy the content api to support list posts with new class PostQueryContent * using parameters * with categoryid * checkstyle Co-authored-by: Cui <11811305@mail.sustech.edu.cn>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
相比之前的版本,把remove去掉了,另外在model/params里新建了一个PostQueryContent类,这样文档上就不会显示status了。