提供services & addon & ee & electron 模块,

This commit is contained in:
gaoshuaixing
2023-05-23 17:09:45 +08:00
parent fd3cd5cfdb
commit 37468c5d75
71 changed files with 622 additions and 605 deletions

View File

@@ -2,6 +2,8 @@
const { Controller } = require('ee-core');
const Log = require('ee-core/log');
const Services = require('ee-core/services');
const Addon = require('ee-core/addon');
/**
* example
@@ -24,13 +26,49 @@ class ExampleController extends Controller {
* test
*/
async test () {
const result = await this.service.example.test('electron');
let tmpDir = Ps.getLogDir();
Log.info('tmpDir:', tmpDir);
const result1 = await Services.get('example').test('electron');
Log.info('service result1:', result1);
return result;
Services.get('framework').test('electron');
return 'hello electron-egg';
}
/**
* test
*/
async testUtils () {
let mid = await Utils.machineIdSync(true);
Log.info('mid 11111111:', mid);
Utils.machineId().then((id) => {
Log.info('mid 222222222:', id);
});
return;
}
/**
* test
*/
async testService () {
const serviceResult2 = await Services.get('example').test('electron');
Log.info('service result2:', serviceResult2);
return;
}
/**
* test
*/
async testAddon () {
const trayResult2 = Addon.get('tray').hello();
Log.info('addon result2:', trayResult2);
return;
}
}
ExampleController.toString = () => '[class ExampleController]';