example.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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/example/openLocalDir', controller.example.openLocalDir);
  9. // executeJS
  10. router.post('/api/example/executeJS', controller.example.executeJS);
  11. // upload file
  12. router.post('/api/example/uploadFile', controller.example.uploadFile);
  13. // add test data
  14. router.post('/api/example/addTestData', controller.example.addTestData);
  15. // delete test data
  16. router.post('/api/example/delTestData', controller.example.delTestData);
  17. // update test data
  18. router.post('/api/example/updateTestData', controller.example.updateTestData);
  19. // get test data
  20. router.post('/api/example/getTestData', controller.example.getTestData);
  21. // open launch
  22. router.post('/api/example/autoLaunchEnable', controller.example.autoLaunchEnable);
  23. // close launch
  24. router.post('/api/example/autoLaunchDisable', controller.example.autoLaunchDisable);
  25. // is launch
  26. router.post('/api/example/autoLaunchIsEnabled', controller.example.autoLaunchIsEnabled);
  27. // open software
  28. router.post('/api/example/openSoftware', controller.example.openSoftware);
  29. // test some electron api
  30. router.post('/api/example/testElectronApi', controller.example.testElectronApi);
  31. // test2
  32. router.post('/api/example/test2', controller.example.test2);
  33. // message show
  34. router.post('/api/example/messageShow', controller.example.messageShow);
  35. // message show confirm
  36. router.post('/api/example/messageShowConfirm', controller.example.messageShowConfirm);
  37. // upload chrome extension
  38. router.post('/api/example/uploadExtension', controller.example.uploadExtension);
  39. // db operation
  40. router.post('/api/example/dbOperation', controller.example.dbOperation);
  41. };