-
Notifications
You must be signed in to change notification settings - Fork 63
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
WIP: Indices #231
WIP: Indices #231
Conversation
✅ Deploy Preview for bangumi-org-server ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Codecov ReportBase: 49.72% // Head: 50.65% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #231 +/- ##
==========================================
+ Coverage 49.72% 50.65% +0.92%
==========================================
Files 197 197
Lines 7803 8073 +270
==========================================
+ Hits 3880 4089 +209
- Misses 3467 3505 +38
- Partials 456 479 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
desc改成description吧… |
h.i.Get may return two type of errors, not found and db error resp should behave differently
[POST] /indices/<index_id>/subjects 不用返回条目信息了吧 |
我觉得加上比较合适。不像修改或者删除,信息都是已知或者只是移除。 新增之后如果需要在客户端增加内容或者展示啥东西,就可以省一个找信息的请求(比如 /indices/5/subject 或者 /subject/<subject_id>) |
也有道理。 |
删除目录之后,收藏目录列表应该怎么处理?是直接移除,还是告知该目录已被删除 |
先不做( |
感觉这个PR一次加的东西有点多,要不先做目录条目增改删,其他的分开PR |
嗯, 我晚点有时间拆一下,目录本身的一个 pr,和用户相关的一个 pr |
sai老板目前给了目录条目的增改删权限,如果先做这个的话可以合并之后直接上线。然后目录表的增改还没给,大概可以跟前一个一起PR。 目录删除的话还要涉及目录留言和用户条目收藏两个表的删除权限,放在用户条目收藏API之后再PR比较好。(用户留言好像不删除,直接留在那也行,反正也看不到了) 没对应数据库权限的PR合了之后还要考虑额外加flag来启用,开发和部署都挺难受的… |
讨论 Issue #230
[POST] /indices 新建目录
请求数据
返回数据
[PUT] /indices/<index_id> 修改目录
请求数据
返回数据
无, 200 代表修改成功
[DELETE] /indices/<index_id> 删除目录
请求数据
无
返回数据
无, 200 代表修改成功
[POST] /indices/<index_id>/subjects 在目录中增加条目
请求数据
返回数据
[PUT] /indices/<index_id>/subjects/<subject_id> 在目录中修改条目
请求数据
返回数据
无, 200 代表修改成功
[DELETE] /indices/<index_id>/subjects/<subject_id> 在目录中删除条目
请求数据
无
返回数据
无, 200 代表修改成功
[GET] /users//indices 获取用户创建的条目
请求数据
无
返回数据
[GET] /users//indices/collect 获取用户收藏的条目
请求数据
无
返回数据
[POST] /indices/<index_id>/collect 收藏条目
请求数据
无
返回数据
无, 200 代表修改成功,重复收藏会返回 202 (Accpeted)
[DELETE] /indices/<index_id>/collect 取消收藏条目
请求数据
无
返回数据
无, 200 代表修改成功, 404 代表用户没有收藏该条目