index.ts 846 B

12345678910111213141516171819202122232425262728293031323334
  1. import * as booking from './module/booking'
  2. import * as tracking from './module/tracking'
  3. import * as common from './module/common'
  4. import * as login from './module/login'
  5. import * as other from './module/other'
  6. import * as notificationMessage from './module/notificationMessage'
  7. import * as system from './module/system'
  8. import * as AIRobot from './module/AIRobot'
  9. import * as Delivery from './module/Delivery'
  10. /**
  11. * api 对象接口定义
  12. */
  13. function generateApiMap(maps: any) {
  14. const methodMap: any = {}
  15. for (const key in maps) {
  16. methodMap[key] = maps[key]
  17. }
  18. return methodMap
  19. }
  20. const apis = generateApiMap({
  21. ...booking,
  22. ...tracking,
  23. ...common,
  24. ...login,
  25. ...other,
  26. ...notificationMessage,
  27. ...system,
  28. ...AIRobot,
  29. ...Delivery
  30. })
  31. export default {
  32. ...apis // 取出所有可遍历属性赋值在新的对象上
  33. }