mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-21 07:08:12 +08:00
提供services & addon & ee & electron 模块,
This commit is contained in:
@@ -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]';
|
||||
|
||||
Reference in New Issue
Block a user