Introduction
    like most frameworks, it receives front-end requests, organizes parameters, and calls Service to process services.

    Example

    1. const Controller = require('ee-core').Controller;
    2. /**
    3. * example
    4. * @class
    5. */
    6. class ExampleController extends Controller {
    7. constructor(ctx) {
    8. super(ctx);
    9. }
    10. /**
    11. * All methods receive two parameters
    12. * @param args Parameters transmitted by the front end
    13. * @param event - IpcMainEvent doc:https://www.electronjs.org/docs/latest/api/structures/ipc-main-event
    14. */
    15. /**
    16. * test
    17. */
    18. async test (args, event) {
    19. const params = args;
    20. // call service
    21. const result = await this.service.example.test('ee');
    22. // Actively send a request to the front end
    23. // channel front-end ipc.on(), listening route
    24. const channel = "controller.example.something"
    25. event.reply(channel, {age:21})
    26. const data = {}
    27. return data;
    28. }
    29. }