example.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. // upload file
  8. router.post('/api/example/uploadFile', controller.example.uploadFile);
  9. // add test data
  10. router.post('/api/example/addTestData', controller.example.addTestData);
  11. // delete test data
  12. router.post('/api/example/delTestData', controller.example.delTestData);
  13. // update test data
  14. router.post('/api/example/updateTestData', controller.example.updateTestData);
  15. // get test data
  16. router.post('/api/example/getTestData', controller.example.getTestData);
  17. // open launch
  18. router.post('/api/example/autoLaunchEnable', controller.example.autoLaunchEnable);
  19. // close launch
  20. router.post('/api/example/autoLaunchDisable', controller.example.autoLaunchDisable);
  21. // is launch
  22. router.post('/api/example/autoLaunchIsEnabled', controller.example.autoLaunchIsEnabled);
  23. // open software
  24. router.post('/api/example/openSoftware', controller.example.openSoftware);
  25. // test some electron api
  26. router.post('/api/example/testElectronApi', controller.example.testElectronApi);
  27. // test2
  28. router.post('/api/example/test2', controller.example.test2);
  29. // message show
  30. router.post('/api/example/messageShow', controller.example.messageShow);
  31. // message show confirm
  32. router.post('/api/example/messageShowConfirm', controller.example.messageShowConfirm);
  33. // upload chrome extension
  34. router.post('/api/example/uploadExtension', controller.example.uploadExtension);
  35. // db operation
  36. router.post('/api/example/dbOperation', controller.example.dbOperation);
  37. };