状态字段应该使用"status"还是"state"
大约 542 字stackexchange上的解释
- status is used to describe an outcome of an operation (e.g. success/fail).
- state is used to describe a stage in a process (e.g. pending/dispatched).
- status is a final (resulting) state.
status
用来描述操作的结果,比如:成功/失败。表示一个终结状态。
state
用来描述过程的某个阶段,比如:进行中/已发送;处理完成后“进行中”就变成“已发送”了。
举例
- 订单状态:order_state
- 订单创建
- 待付款
- 付款确认中
- 付款成功
- 退款中
- 退款成功
- 操作是否成功:operation_status
- 成功
- 失败
参考
阅读 1101 · 发布于 2020-01-08
————        END        ————
扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看换一批
- PowerShell 快捷键阅读 50
- Spring Boot中的ApplicationRunner和CommandLineRunner阅读 510
- Android允许使用大内存阅读 382
- Java中识别字符串编码阅读 181
- 面试题:OSI模型和TCP/IP模型各有几层阅读 1103
- 面试题:二进制与十进制互相转换阅读 522
- 设计模式之备忘录模式阅读 512
- OpenResty中使用ngx.location.capture完成第三方接口请求阅读 2138
- Elasticsearch can not run elasticsearch as root阅读 2308
- curl命令遇到重定向时请求重定向后地址阅读 101