@fastcar/core 0.2.42 → 0.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/annotation/stereotype/Log.ts +1 -1
- package/target/FastCarApplication.js +1 -1
- package/target/annotation/stereotype/Log.js +1 -1
- package/target/annotation/AddRequireModule.js +0 -21
- package/target/annotation/Autowired.js +0 -15
- package/target/annotation/Calldependency.js +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastcar/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43",
|
|
4
4
|
"homepage": "https://github.com/williamDazhangyu/fast-car",
|
|
5
5
|
"main": "target/index.js",
|
|
6
6
|
"author": "william_zhong",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"reflect-metadata": "^0.1.13",
|
|
36
|
-
"winston": "^3.
|
|
36
|
+
"winston": "^3.9.0",
|
|
37
37
|
"yaml": "^1.10.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -11,7 +11,7 @@ export default function Log(category?: string) {
|
|
|
11
11
|
get: (): Logger => {
|
|
12
12
|
let app: ApplicationInterface = Reflect.get(global, CommonConstant.FastcarApp);
|
|
13
13
|
let appid = app.getSetting(CommonConstant.APPId) || ""; //进行差异化区分
|
|
14
|
-
return app ? app.getLogger(appid ?
|
|
14
|
+
return app ? app.getLogger(appid ? `${appid}.${m}` : m) : console;
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
};
|
|
@@ -666,7 +666,7 @@ let FastCarApplication = FastCarApplication_1 = class FastCarApplication extends
|
|
|
666
666
|
};
|
|
667
667
|
__decorate([
|
|
668
668
|
(0, Log_1.default)("sys"),
|
|
669
|
-
__metadata("design:type",
|
|
669
|
+
__metadata("design:type", winston.Logger)
|
|
670
670
|
], FastCarApplication.prototype, "sysLogger", void 0);
|
|
671
671
|
FastCarApplication = FastCarApplication_1 = __decorate([
|
|
672
672
|
Component_1.default,
|
|
@@ -9,7 +9,7 @@ function Log(category) {
|
|
|
9
9
|
get: () => {
|
|
10
10
|
let app = Reflect.get(global, CommonConstant_1.CommonConstant.FastcarApp);
|
|
11
11
|
let appid = app.getSetting(CommonConstant_1.CommonConstant.APPId) || ""; //进行差异化区分
|
|
12
|
-
return app ? app.getLogger(appid ?
|
|
12
|
+
return app ? app.getLogger(appid ? `${appid}.${m}` : m) : console;
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const FastCarMetaData_1 = require("../constant/FastCarMetaData");
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
/***
|
|
6
|
-
* @version 1.0 依赖模块注入
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
function AddRequireModule(target, m, alias) {
|
|
10
|
-
let relyname = FastCarMetaData_1.FastCarMetaData.IocModule;
|
|
11
|
-
if (Reflect.hasMetadata(relyname, target)) {
|
|
12
|
-
let iocMap = Reflect.getMetadata(relyname, target);
|
|
13
|
-
iocMap.set(m, alias);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
let modules = new Map();
|
|
17
|
-
modules.set(m, alias);
|
|
18
|
-
Reflect.defineMetadata(relyname, modules, target);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.default = AddRequireModule;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ReflectUtil_1 = require("../utils/ReflectUtil");
|
|
4
|
-
const AddRequireModule_1 = require("./AddRequireModule");
|
|
5
|
-
/***
|
|
6
|
-
* @version 1.0 说明哪些模块需要被加载
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
function Autowired(target, propertyKey) {
|
|
11
|
-
//反向找设计类型
|
|
12
|
-
let key = ReflectUtil_1.default.getNameByPropertyKey(target, propertyKey);
|
|
13
|
-
AddRequireModule_1.default(target, propertyKey, key);
|
|
14
|
-
}
|
|
15
|
-
exports.default = Autowired;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const CommonConstant_1 = require("../constant/CommonConstant");
|
|
4
|
-
const ReflectUtil_1 = require("../utils/ReflectUtil");
|
|
5
|
-
/***
|
|
6
|
-
* @version 1.0 在使用该函数时进行调用 声明的类可以不是组件
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
function CallDependency(target, propertyKey) {
|
|
10
|
-
Reflect.defineProperty(target, propertyKey, {
|
|
11
|
-
get: () => {
|
|
12
|
-
let key = ReflectUtil_1.default.getNameByPropertyKey(target, propertyKey);
|
|
13
|
-
let app = Reflect.get(global, CommonConstant_1.CommonConstant.FastcarApp);
|
|
14
|
-
return app ? app.getComponentByName(key) : null;
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
exports.default = CallDependency;
|