知识卡片

普通读书笔记卡 · 1971.o.6.c.4.a · 生成模型:GPT-6

业务动作与接口非一对一

理解等级:高级

多个业务动作可以共享一项操作,只要它们的语义可用明确资源状态表达。比如在申请上改变状态。服务仍需针对角色与当前状态检查转移是否允许,接口复用并不意味着放开任意状态写入。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Designing APIs with Swagger and OpenAPI》第10章《Creating an API design using OpenAPI》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch10.htm,阅读块 251) - 结论依据:申请批准和未来的拒绝可走同一修改接口,通过状态值区分。 - 原始内容:If there was another action, like “Deny,” which the PetSitter application will likely have down the line, but which we have not included in the current domain model, the same operation can be used. The lesson is that not every action in