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

新增 Upvote 和 Downvote 的 tracker API #2565

Closed
guqing opened this issue Oct 13, 2022 · 1 comment · Fixed by #2566
Closed

新增 Upvote 和 Downvote 的 tracker API #2565

guqing opened this issue Oct 13, 2022 · 1 comment · Fixed by #2566
Assignees
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@guqing
Copy link
Member

guqing commented Oct 13, 2022

Your current Halo version

2.0.0-alpha.2

Describe this feature

新增 API 以支持例如文章、评论的点赞和踩

Additional information

/area core
/milestone 2.0
/kind feature
/assign

@ruibaby
Copy link
Member

ruibaby commented Oct 13, 2022

/area core
/milestone 2.0
/kind feature
/assign @guqing

@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Oct 13, 2022
@f2c-ci-robot f2c-ci-robot bot added this to the 2.0 milestone Oct 13, 2022
@f2c-ci-robot f2c-ci-robot bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 13, 2022
f2c-ci-robot bot pushed a commit that referenced this issue Oct 15, 2022
#### What type of PR is this?
/kind feature
/area core
/milestone 2.0
/kind api-change

#### What this PR does / why we need it:
新增文章和评论等资源的点赞和踩 API

#### Which issue(s) this PR fixes:

Fixes #2565

#### Special notes for your reviewer:
how to test it?
1.  创建并发布一篇文章 替换下面的 `your-post-name` 然后执行它
```curl
curl --location --request POST 'http://localhost:8090/apis/api.halo.run/v1alpha1/trackers/upvote' \
--header 'Content-Type: application/json' \
--data-raw '{
    "group": "content.halo.run",
    "plural": "posts",
    "name": your-post-name
}
```
2. 请求成功并得到 response 为点赞数
3. 踩的 API 为 `http://localhost:8090/apis/api.halo.run/v1alpha1/trackers/downvote` 请求体与步骤1相同的测试方法
4. 重启 Halo 后 Counter 数据应该依然存在并且正确

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
新增文章和评论等资源的点赞和踩 API
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants