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

feat(spx-backend): implement Community API #955

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

aofei
Copy link
Member

@aofei aofei commented Sep 27, 2024

Fixes #920
Fixes #948


Breaking changes to the API spec

  1. Renamed Model.cTime to Model.createdAt.
  2. Renamed Model.uTime to Model.updatedAt.
  3. Renamed IsPublic to Visibility.
  4. Redesigned Visibility as a self-descriptive string enum instead of an integer enum.
  5. Renamed Asset.assetType to Asset.type.
  6. Redesigned Asset.type as a self-descriptive string enum instead of an integer enum.
  7. Changed endpoint /user/following/{username} to /user/{username}/following.
  8. Changed endpoint /project/liking/{owner}/{name} to /project/{owner}/{name}/liking.
  9. Removed the incorrectly added requestBody.name parameter from PUT /project/{owner}/{name}.
  10. Removed the unused preview and clickCount properties from Asset.

spx-backend/init.sql Outdated Show resolved Hide resolved
spx-backend/init.sql Outdated Show resolved Hide resolved
@@ -394,7 +390,7 @@ paths:
"204":
description: Successfully deleted the project.

/project/liking/{owner}/{name}:
/project/{owner}/{name}/liking:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改动是不得已的,因为 yap 认为 /project/liking/{owner}/{name}/project/:owner/:name 冲突(yap 没有细分静态路由和参数路由的优先级)

@@ -165,13 +165,13 @@ const {
const c = category.value.value
const cPersonal = categoryPersonal.value.value
return listAsset({
pageSize: 500, // try to get all
pageSize: 100, // try to get all
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

后端限制了 pageSize 的值在区间 [1, 100]。考虑到预期是要做分页的,所以我先遵循 api spec 把这里给改小了。

Copy link
Collaborator

@nighca nighca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他我没问题了

Fixes goplus#920
Fixes goplus#948

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@qiniu-ci
Copy link

This PR has been deployed to the preview environment. You can explore it using the preview URL.

Warning

Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the Go+ Builder team.

@aofei aofei requested a review from nighca October 15, 2024 07:39
@aofei
Copy link
Member Author

aofei commented Oct 15, 2024

其他我没问题了

补充了测试 & 同步改动了前端,我本地测试了没啥问题,看看还需不需要再 review 下

@aofei aofei merged commit 92c514e into goplus:dev Oct 15, 2024
6 of 7 checks passed
@aofei aofei deleted the implement-community-api branch October 15, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance DB indexing strategy to improve query efficiency Community model
3 participants