跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 后端接口一定要保持单一职责吗

发表于

之前干前端的时候遇到一个需求就是需要用表格展示一些订单或者商品信息,但是跟我对接的后端哥们让我从两个接口拿。但是我想让他再单独出一个接口直接返回我所有的信息,这样我就不用请求两次接口再拼装展示到表格中; 我的想法就是: 单独一次的请求肯定比两次性能好,万一有一个请求嘎了或者慢了, 表格数据就加载慢或者不出来了。

后端那哥们的想法是:接口需要保持单一职责,再单独出一个接口就重复了。

当时刚到那家公司,也没劲跟这哥们扯犊子,不过他给的理由我也无办法反驳,但是我感觉我的想法也是对的。

大佬们遇到这种情况,最佳的做法应该是咋样的啊。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.