example.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. // open local dir
  8. router.post('/api/v1/example/openLocalDir', controller.v1.example.openLocalDir);
  9. // executeJS
  10. router.post('/api/v1/example/executeJS', controller.v1.example.executeJS);
  11. // upload file
  12. router.post('/api/v1/example/uploadFile', controller.v1.example.uploadFile);
  13. // get ws url
  14. router.post('/api/v1/example/getWsUrl', controller.v1.example.getWsUrl);
  15. // add test data
  16. router.post('/api/v1/example/addTestData', controller.v1.example.addTestData);
  17. // delete test data
  18. router.post('/api/v1/example/delTestData', controller.v1.example.delTestData);
  19. // update test data
  20. router.post('/api/v1/example/updateTestData', controller.v1.example.updateTestData);
  21. // get test data
  22. router.post('/api/v1/example/getTestData', controller.v1.example.getTestData);
  23. // set shortcut
  24. router.post('/api/v1/example/setShortcut', controller.v1.example.setShortcut);
  25. // open launch
  26. router.post('/api/v1/example/autoLaunchEnable', controller.v1.example.autoLaunchEnable);
  27. // close launch
  28. router.post('/api/v1/example/autoLaunchDisable', controller.v1.example.autoLaunchDisable);
  29. // is launch
  30. router.post('/api/v1/example/autoLaunchIsEnabled', controller.v1.example.autoLaunchIsEnabled);
  31. };