example.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. // set shortcut
  22. router.post('/api/example/setShortcut', controller.example.setShortcut);
  23. // open launch
  24. router.post('/api/example/autoLaunchEnable', controller.example.autoLaunchEnable);
  25. // close launch
  26. router.post('/api/example/autoLaunchDisable', controller.example.autoLaunchDisable);
  27. // is launch
  28. router.post('/api/example/autoLaunchIsEnabled', controller.example.autoLaunchIsEnabled);
  29. // open software
  30. router.post('/api/example/openSoftware', controller.example.openSoftware);
  31. // select file dir
  32. router.post('/api/example/selectFileDir', controller.example.selectFileDir);
  33. // test some electron api
  34. router.post('/api/example/testElectronApi', controller.example.testElectronApi);
  35. // test2
  36. router.post('/api/example/test2', controller.example.test2);
  37. // message show
  38. router.post('/api/example/messageShow', controller.example.messageShow);
  39. // message show confirm
  40. router.post('/api/example/messageShowConfirm', controller.example.messageShowConfirm);
  41. // upload chrome extension
  42. router.post('/api/example/uploadExtension', controller.example.uploadExtension);
  43. // db operation
  44. router.post('/api/example/dbOperation', controller.example.dbOperation);
  45. };