example.js 669 B

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. const { Controller } = require('ee-core');
  3. const Log = require('ee-core/log');
  4. /**
  5. * example
  6. * @class
  7. */
  8. class ExampleController extends Controller {
  9. constructor(ctx) {
  10. super(ctx);
  11. }
  12. /**
  13. * 所有方法接收两个参数
  14. * @param args 前端传的参数
  15. * @param event - ipc通信时才有值。详情见:控制器文档
  16. */
  17. /**
  18. * test
  19. */
  20. async test () {
  21. const result = await this.service.example.test('electron');
  22. let tmpDir = Ps.getLogDir();
  23. Log.info('tmpDir:', tmpDir);
  24. return result;
  25. }
  26. }
  27. ExampleController.toString = () => '[class ExampleController]';
  28. module.exports = ExampleController;