可以参考 github 的设计。
https://developer.github.com/v3/activity/s...
https://developer.github.com/v3/activity/n...
按照你觉得合适的命名来。当时想的是 我已经读过的通知。
按照 github 的设计就挺好,直接 put notifications ,传入 last_read_at
可以参考 github 的设计。
https://developer.github.com/v3/activity/s...
https://developer.github.com/v3/activity/n...
按照你觉得合适的命名来。当时想的是 我已经读过的通知。
按照 github 的设计就挺好,直接 put notifications ,传入 last_read_at
@liyu001989
谢谢啦!突然理解了。
刚再翻了下资料 理解 RESTful 架构,user/read/notifications
是把用户读取通知这个服务看作一种一种资源,
如果写成 user/notifications/read
就变成对用户通知这个资源进行读的操作,URI 中包含了 read
这个动作,是不符合 RESTful HTTP API
的设计理念的, 所以老师的这种写法才是正确的。
推荐文章: