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

资源排序API #2

Open
Guo-Zhang opened this issue Jun 19, 2023 · 0 comments
Open

资源排序API #2

Guo-Zhang opened this issue Jun 19, 2023 · 0 comments

Comments

@Guo-Zhang
Copy link
Member

对某个资源执行bulk_update操作,比如更变两个资源的排序。

API格式如PATCH /<resources>,详见DRF实现

以及一些DRF内部实现:

这种方案的好处是比较通用,缺点是没有社区规范和标准支持。

另外一种保守方案是设计一个无状态service,比如reorder方法。

社区没有专门的文档或者最佳实践对排序API的定义,因此我们需要根据我们自己的需求和偏好定义。

PS:Django的order字段解决方案:https://github.com/django-ordered-model/django-ordered-model。

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

No branches or pull requests

1 participant