example.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // open software
  32. router.post('/api/v1/example/openSoftware', controller.v1.example.openSoftware);
  33. // select file dir
  34. router.post('/api/v1/example/selectFileDir', controller.v1.example.selectFileDir);
  35. // test some electron api
  36. router.post('/api/v1/example/testElectronApi', controller.v1.example.testElectronApi);
  37. // test2
  38. router.post('/api/v1/example/test2', controller.v1.example.test2);
  39. // message show
  40. router.post('/api/v1/example/messageShow', controller.v1.example.messageShow);
  41. // message show confirm
  42. router.post('/api/v1/example/messageShowConfirm', controller.v1.example.messageShowConfirm);
  43. // upload chrome extension
  44. router.post('/api/v1/example/uploadExtension', controller.v1.example.uploadExtension);
  45. // db operation
  46. router.post('/api/v1/example/dbOperation', controller.v1.example.dbOperation);
  47. };