@fastcar/core 0.2.50 → 0.2.53
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/annotation.d.ts +3 -0
- package/index.d.ts +5 -0
- package/package.json +1 -1
- package/src/FastCarApplication.ts +11 -3
- package/src/annotation/env/BaseName.ts +7 -0
- package/src/annotation.ts +2 -1
- package/src/constant/CommonConstant.ts +1 -0
- package/src/db.ts +2 -0
- package/src/utils/CryptoUtil.ts +2 -2
- package/src/utils/DataFormat.ts +5 -0
- package/target/FastCarApplication.js +10 -3
- package/target/annotation/env/BaseName.js +9 -0
- package/target/annotation.js +3 -1
- package/target/constant/CommonConstant.js +1 -0
- package/target/db.js +2 -0
- package/target/utils/CryptoUtil.js +2 -2
- package/target/utils/DataFormat.js +4 -0
- package/test/example/logs/fastcar-server.logger.log +3 -0
- package/test/example/logs/fastcar-server.logger1.log +9 -0
- package/test/example/logs/fastcar-server.sys1.log +14 -0
- package/test/example/logs/fastcar-server.sys2.log +2 -0
- package/test/example/logs/fastcar-server.sys3.log +9 -0
- package/test/example/logs/fastcar-server.sys4.log +1 -0
- package/test/example/logs/other-server.app.log +0 -0
- package/test/example/logs/other-server.logger.log +3 -0
- package/test/example/logs/other-server.sys.log +25 -0
- package/test/example/logs/other-server.sys1.log +12 -0
- package/test/example/logs/other-server.sys2.log +15 -0
- package/test/example/logs/other-server.sys3.log +0 -0
- package/test/example/logs/sys10.log +0 -0
- package/test/example/logs/sys11.log +0 -0
- package/test/example/logs/sys4.log +0 -0
- package/test/example/logs/sys5.log +0 -0
- package/test/example/logs/sys6.log +0 -0
- package/test/example/logs/sys7.log +0 -0
- package/test/example/logs/sys8.log +0 -0
- package/test/example/logs/sys9.log +0 -0
- package/test/example/resource/application-test.yml +2 -0
- package/test/example/resource/other-test.yml +2 -0
- package/test/example/resource/other.yml +10 -0
- package/test/example/simple/app-test.ts +48 -0
- package/test/example/simple/app.ts +2 -0
package/annotation.d.ts
CHANGED
|
@@ -147,6 +147,9 @@ export function BaseFilePath(name: string): Ret;
|
|
|
147
147
|
//设置入口文件夹路径
|
|
148
148
|
export function BasePath(name: string): Ret;
|
|
149
149
|
|
|
150
|
+
//设置资源文件不是application的
|
|
151
|
+
export function BaseName(name: string): Ret;
|
|
152
|
+
|
|
150
153
|
//自定义程序内配置
|
|
151
154
|
export function ApplicationSetting(setting: { [key: string]: any }): Ret;
|
|
152
155
|
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -45,6 +45,7 @@ class FastCarApplication extends Events {
|
|
|
45
45
|
protected resourcePath: string = ""; //资源路径
|
|
46
46
|
protected delayHotIds: Map<string, { fp: string; loadType: number }>;
|
|
47
47
|
protected reloadTimerId: NodeJS.Timeout | null;
|
|
48
|
+
protected basename: string = CommonConstant.Application;
|
|
48
49
|
|
|
49
50
|
constructor() {
|
|
50
51
|
super();
|
|
@@ -97,7 +98,7 @@ class FastCarApplication extends Events {
|
|
|
97
98
|
});
|
|
98
99
|
|
|
99
100
|
this.on("sysReload", (fp: string) => {
|
|
100
|
-
if (fp.indexOf(
|
|
101
|
+
if (fp.indexOf(this.basename) != -1) {
|
|
101
102
|
this.addDelayHot(fp, 2);
|
|
102
103
|
}
|
|
103
104
|
});
|
|
@@ -165,16 +166,23 @@ class FastCarApplication extends Events {
|
|
|
165
166
|
return this.basePath;
|
|
166
167
|
}
|
|
167
168
|
|
|
169
|
+
/**
|
|
170
|
+
* @version 1.0 获取项目读取的基本配置路径
|
|
171
|
+
*/
|
|
172
|
+
getBaseName(): string {
|
|
173
|
+
return this.basename;
|
|
174
|
+
}
|
|
175
|
+
|
|
168
176
|
/***
|
|
169
177
|
* @version 1.0 加载系统配置 加载顺序为 default json < yaml < env
|
|
170
178
|
*
|
|
171
179
|
*/
|
|
172
180
|
loadSysConfig() {
|
|
173
|
-
this.sysConfig = FileUtil.getApplicationConfig(this.getResourcePath(),
|
|
181
|
+
this.sysConfig = FileUtil.getApplicationConfig(this.getResourcePath(), this.basename, this.sysConfig);
|
|
174
182
|
|
|
175
183
|
let env = (Reflect.get(this, CommonConstant.ENV) || this.sysConfig.application.env || "devlopment") as string;
|
|
176
184
|
|
|
177
|
-
this.sysConfig = FileUtil.getApplicationConfig(this.getResourcePath(), `${
|
|
185
|
+
this.sysConfig = FileUtil.getApplicationConfig(this.getResourcePath(), `${this.basename}-${env}`, this.sysConfig);
|
|
178
186
|
|
|
179
187
|
//自定义环境变量设置
|
|
180
188
|
process.env.NODE_ENV = env;
|
package/src/annotation.ts
CHANGED
|
@@ -47,6 +47,7 @@ import ApplicationDestory from "./annotation/lifeCycle/ApplicationDestory";
|
|
|
47
47
|
import ApplicationSetting from "./annotation/env/ApplicationSetting";
|
|
48
48
|
import AliasInjection from "./annotation/bind/AliasInjection";
|
|
49
49
|
import ResourcePath from "./annotation/env/ResourcePath";
|
|
50
|
+
import BaseName from "./annotation/env/BaseName";
|
|
50
51
|
|
|
51
52
|
//注解暴露出去
|
|
52
53
|
export {
|
|
@@ -100,4 +101,4 @@ export {
|
|
|
100
101
|
Transactional, //事务管理
|
|
101
102
|
};
|
|
102
103
|
|
|
103
|
-
export { ENV, BaseFilePath, BasePath, ApplicationSetting };
|
|
104
|
+
export { ENV, BaseFilePath, BasePath, BaseName, ApplicationSetting };
|
package/src/db.ts
CHANGED
package/src/utils/CryptoUtil.ts
CHANGED
|
@@ -60,11 +60,11 @@ export default class CryptoUtil {
|
|
|
60
60
|
let pwd = Buffer.from(password, "hex");
|
|
61
61
|
|
|
62
62
|
//读取数组
|
|
63
|
-
let iv = tmpSerect.
|
|
63
|
+
let iv = tmpSerect.subarray(0, 12);
|
|
64
64
|
let cipher = crypto.createDecipheriv("aes-128-gcm", pwd, iv);
|
|
65
65
|
|
|
66
66
|
//这边的数据为 去除头的iv12位和尾部的tags的16位
|
|
67
|
-
let msg = cipher.update(tmpSerect.
|
|
67
|
+
let msg = cipher.update(tmpSerect.subarray(12, tmpSerect.length - 16));
|
|
68
68
|
|
|
69
69
|
return msg.toString("utf8");
|
|
70
70
|
} catch (e) {
|
package/src/utils/DataFormat.ts
CHANGED
|
@@ -34,6 +34,7 @@ let FastCarApplication = FastCarApplication_1 = class FastCarApplication extends
|
|
|
34
34
|
constructor() {
|
|
35
35
|
super();
|
|
36
36
|
this.resourcePath = ""; //资源路径
|
|
37
|
+
this.basename = CommonConstant_1.CommonConstant.Application;
|
|
37
38
|
this.sysConfig = SysConfig_1.SYSDefaultConfig;
|
|
38
39
|
this.componentMap = new Map();
|
|
39
40
|
this.componentDeatils = new Map();
|
|
@@ -76,7 +77,7 @@ let FastCarApplication = FastCarApplication_1 = class FastCarApplication extends
|
|
|
76
77
|
this.addDelayHot(fp, 1);
|
|
77
78
|
});
|
|
78
79
|
this.on("sysReload", (fp) => {
|
|
79
|
-
if (fp.indexOf(
|
|
80
|
+
if (fp.indexOf(this.basename) != -1) {
|
|
80
81
|
this.addDelayHot(fp, 2);
|
|
81
82
|
}
|
|
82
83
|
});
|
|
@@ -138,14 +139,20 @@ let FastCarApplication = FastCarApplication_1 = class FastCarApplication extends
|
|
|
138
139
|
getBasePath() {
|
|
139
140
|
return this.basePath;
|
|
140
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* @version 1.0 获取项目读取的基本配置路径
|
|
144
|
+
*/
|
|
145
|
+
getBaseName() {
|
|
146
|
+
return this.basename;
|
|
147
|
+
}
|
|
141
148
|
/***
|
|
142
149
|
* @version 1.0 加载系统配置 加载顺序为 default json < yaml < env
|
|
143
150
|
*
|
|
144
151
|
*/
|
|
145
152
|
loadSysConfig() {
|
|
146
|
-
this.sysConfig = FileUtil_1.default.getApplicationConfig(this.getResourcePath(),
|
|
153
|
+
this.sysConfig = FileUtil_1.default.getApplicationConfig(this.getResourcePath(), this.basename, this.sysConfig);
|
|
147
154
|
let env = (Reflect.get(this, CommonConstant_1.CommonConstant.ENV) || this.sysConfig.application.env || "devlopment");
|
|
148
|
-
this.sysConfig = FileUtil_1.default.getApplicationConfig(this.getResourcePath(), `${
|
|
155
|
+
this.sysConfig = FileUtil_1.default.getApplicationConfig(this.getResourcePath(), `${this.basename}-${env}`, this.sysConfig);
|
|
149
156
|
//自定义环境变量设置
|
|
150
157
|
process.env.NODE_ENV = env;
|
|
151
158
|
//判断程序内是否有配置
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const CommonConstant_1 = require("../../constant/CommonConstant");
|
|
4
|
+
function BaseName(name) {
|
|
5
|
+
return function (target) {
|
|
6
|
+
Reflect.set(target.prototype, CommonConstant_1.CommonConstant.BaseName, name);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
exports.default = BaseName;
|
package/target/annotation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApplicationSetting = exports.BasePath = exports.BaseFilePath = exports.ENV = exports.Transactional = exports.SqlSession = exports.Entity = exports.Table = exports.PrimaryKey = exports.Field = exports.DBType = exports.DSIndex = exports.DS = exports.ResourcePath = exports.Rule = exports.ValidForm = exports.ValidCustom = exports.Type = exports.Size = exports.NotNull = exports.DefaultVal = exports.AddChildValid = exports.AddRequireModule = exports.Log = exports.Readonly = exports.Override = exports.NotImplemented = exports.Deprecate = exports.ExceptionMonitor = exports.AliasInjection = exports.CallDependency = exports.Autowired = exports.Application = exports.Injection = exports.Repository = exports.Service = exports.Controller = exports.Configure = exports.BeanName = exports.Hotter = exports.ComponentInjection = exports.Component = exports.ComponentScanExclusion = exports.ComponentScan = exports.ApplicationDestory = exports.ApplicationInit = exports.ApplicationRunner = exports.ApplicationStop = exports.ApplicationStart = void 0;
|
|
3
|
+
exports.ApplicationSetting = exports.BaseName = exports.BasePath = exports.BaseFilePath = exports.ENV = exports.Transactional = exports.SqlSession = exports.Entity = exports.Table = exports.PrimaryKey = exports.Field = exports.DBType = exports.DSIndex = exports.DS = exports.ResourcePath = exports.Rule = exports.ValidForm = exports.ValidCustom = exports.Type = exports.Size = exports.NotNull = exports.DefaultVal = exports.AddChildValid = exports.AddRequireModule = exports.Log = exports.Readonly = exports.Override = exports.NotImplemented = exports.Deprecate = exports.ExceptionMonitor = exports.AliasInjection = exports.CallDependency = exports.Autowired = exports.Application = exports.Injection = exports.Repository = exports.Service = exports.Controller = exports.Configure = exports.BeanName = exports.Hotter = exports.ComponentInjection = exports.Component = exports.ComponentScanExclusion = exports.ComponentScan = exports.ApplicationDestory = exports.ApplicationInit = exports.ApplicationRunner = exports.ApplicationStop = exports.ApplicationStart = void 0;
|
|
4
4
|
const Application_1 = require("./annotation/Application");
|
|
5
5
|
exports.Application = Application_1.default;
|
|
6
6
|
const Autowired_1 = require("./annotation/bind/Autowired");
|
|
@@ -99,3 +99,5 @@ const AliasInjection_1 = require("./annotation/bind/AliasInjection");
|
|
|
99
99
|
exports.AliasInjection = AliasInjection_1.default;
|
|
100
100
|
const ResourcePath_1 = require("./annotation/env/ResourcePath");
|
|
101
101
|
exports.ResourcePath = ResourcePath_1.default;
|
|
102
|
+
const BaseName_1 = require("./annotation/env/BaseName");
|
|
103
|
+
exports.BaseName = BaseName_1.default;
|
package/target/db.js
CHANGED
|
@@ -21,6 +21,8 @@ var OperatorEnum;
|
|
|
21
21
|
OperatorEnum["dec"] = "-";
|
|
22
22
|
OperatorEnum["multiply"] = "*";
|
|
23
23
|
OperatorEnum["division"] = "/";
|
|
24
|
+
OperatorEnum["notin"] = "NOT IN";
|
|
25
|
+
OperatorEnum["custom"] = "CUSTOM";
|
|
24
26
|
})(OperatorEnum = exports.OperatorEnum || (exports.OperatorEnum = {}));
|
|
25
27
|
var JoinEnum;
|
|
26
28
|
(function (JoinEnum) {
|
|
@@ -45,10 +45,10 @@ class CryptoUtil {
|
|
|
45
45
|
let tmpSerect = Buffer.from(serect, "base64");
|
|
46
46
|
let pwd = Buffer.from(password, "hex");
|
|
47
47
|
//读取数组
|
|
48
|
-
let iv = tmpSerect.
|
|
48
|
+
let iv = tmpSerect.subarray(0, 12);
|
|
49
49
|
let cipher = crypto.createDecipheriv("aes-128-gcm", pwd, iv);
|
|
50
50
|
//这边的数据为 去除头的iv12位和尾部的tags的16位
|
|
51
|
-
let msg = cipher.update(tmpSerect.
|
|
51
|
+
let msg = cipher.update(tmpSerect.subarray(12, tmpSerect.length - 16));
|
|
52
52
|
return msg.toString("utf8");
|
|
53
53
|
}
|
|
54
54
|
catch (e) {
|
|
@@ -4,3 +4,6 @@
|
|
|
4
4
|
{"timestamp":"2023-10-11 09:56:00.302","level":"INFO","label":"fastcar-server.logger","message":"自定义的日志输出"}
|
|
5
5
|
{"timestamp":"2023-10-11 09:56:00.304","level":"WARN","label":"fastcar-server.logger","message":"自定义警告"}
|
|
6
6
|
{"timestamp":"2023-10-11 09:56:00.305","level":"ERROR","label":"fastcar-server.logger","message":"自定义报错"}
|
|
7
|
+
{"timestamp":"2023-10-25 14:34:00.264","level":"INFO","label":"fastcar-server.logger","message":"自定义的日志输出"}
|
|
8
|
+
{"timestamp":"2023-10-25 14:34:00.265","level":"WARN","label":"fastcar-server.logger","message":"自定义警告"}
|
|
9
|
+
{"timestamp":"2023-10-25 14:34:00.267","level":"ERROR","label":"fastcar-server.logger","message":"自定义报错"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{"timestamp":"2023-10-25 14:35:19.238","level":"INFO","label":"fastcar-server.logger","message":"自定义的日志输出"}
|
|
2
|
+
{"timestamp":"2023-10-25 14:35:19.239","level":"WARN","label":"fastcar-server.logger","message":"自定义警告"}
|
|
3
|
+
{"timestamp":"2023-10-25 14:35:19.240","level":"ERROR","label":"fastcar-server.logger","message":"自定义报错"}
|
|
4
|
+
{"timestamp":"2023-10-25 14:35:59.908","level":"INFO","label":"fastcar-server.logger","message":"自定义的日志输出"}
|
|
5
|
+
{"timestamp":"2023-10-25 14:35:59.909","level":"WARN","label":"fastcar-server.logger","message":"自定义警告"}
|
|
6
|
+
{"timestamp":"2023-10-25 14:35:59.910","level":"ERROR","label":"fastcar-server.logger","message":"自定义报错"}
|
|
7
|
+
{"timestamp":"2023-10-25 14:36:26.263","level":"INFO","label":"fastcar-server.logger","message":"自定义的日志输出"}
|
|
8
|
+
{"timestamp":"2023-10-25 14:36:26.264","level":"WARN","label":"fastcar-server.logger","message":"自定义警告"}
|
|
9
|
+
{"timestamp":"2023-10-25 14:36:26.265","level":"ERROR","label":"fastcar-server.logger","message":"自定义报错"}
|
|
@@ -1 +1,15 @@
|
|
|
1
1
|
{"timestamp":"2023-10-11 09:56:07.330","level":"INFO","label":"fastcar-server.sys","message":"application stop"}
|
|
2
|
+
{"timestamp":"2023-10-25 14:34:00.90","level":"INFO","label":"fastcar-server.sys","message":"Start scanning component"}
|
|
3
|
+
{"timestamp":"2023-10-25 14:34:00.248","level":"INFO","label":"fastcar-server.sys","message":"Complete component scan"}
|
|
4
|
+
{"timestamp":"2023-10-25 14:34:00.250","level":"INFO","label":"fastcar-server.sys","message":"Call application initialization method"}
|
|
5
|
+
{"timestamp":"2023-10-25 14:34:00.252","level":"INFO","label":"fastcar-server.sys","message":"start server app is run"}
|
|
6
|
+
{"timestamp":"2023-10-25 14:34:00.253","level":"INFO","label":"fastcar-server.sys","message":"version 1.0.0"}
|
|
7
|
+
{"timestamp":"2023-10-25 14:34:02.279","level":"INFO","label":"fastcar-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
8
|
+
{"timestamp":"2023-10-25 14:34:02.280","level":"INFO","label":"fastcar-server.sys","message":"Call the method before the application stops"}
|
|
9
|
+
{"timestamp":"2023-10-25 14:35:19.73","level":"INFO","label":"fastcar-server.sys","message":"Start scanning component"}
|
|
10
|
+
{"timestamp":"2023-10-25 14:35:19.226","level":"INFO","label":"fastcar-server.sys","message":"Complete component scan"}
|
|
11
|
+
{"timestamp":"2023-10-25 14:35:19.228","level":"INFO","label":"fastcar-server.sys","message":"Call application initialization method"}
|
|
12
|
+
{"timestamp":"2023-10-25 14:35:19.230","level":"INFO","label":"fastcar-server.sys","message":"start server app is run"}
|
|
13
|
+
{"timestamp":"2023-10-25 14:35:19.231","level":"INFO","label":"fastcar-server.sys","message":"version 1.0.0"}
|
|
14
|
+
{"timestamp":"2023-10-25 14:35:21.260","level":"INFO","label":"fastcar-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
15
|
+
{"timestamp":"2023-10-25 14:35:21.262","level":"INFO","label":"fastcar-server.sys","message":"Call the method before the application stops"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{"timestamp":"2023-10-25 14:36:01.919","level":"INFO","label":"fastcar-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
2
|
+
{"timestamp":"2023-10-25 14:36:01.920","level":"INFO","label":"fastcar-server.sys","message":"Call the method before the application stops"}
|
|
3
|
+
{"timestamp":"2023-10-25 14:36:01.920","level":"INFO","label":"fastcar-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
4
|
+
{"timestamp":"2023-10-25 14:36:01.921","level":"INFO","label":"fastcar-server.sys","message":"Call the method before the application stops"}
|
|
5
|
+
{"timestamp":"2023-10-25 14:36:06.933","level":"INFO","label":"fastcar-server.sys","message":"application stop"}
|
|
6
|
+
{"timestamp":"2023-10-25 14:36:28.275","level":"INFO","label":"fastcar-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
7
|
+
{"timestamp":"2023-10-25 14:36:28.275","level":"INFO","label":"fastcar-server.sys","message":"Call the method before the application stops"}
|
|
8
|
+
{"timestamp":"2023-10-25 14:36:28.276","level":"INFO","label":"fastcar-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
9
|
+
{"timestamp":"2023-10-25 14:36:28.277","level":"INFO","label":"fastcar-server.sys","message":"Call the method before the application stops"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"timestamp":"2023-10-25 14:36:33.280","level":"INFO","label":"fastcar-server.sys","message":"application stop"}
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{"timestamp":"2023-10-25 14:35:29.943","level":"INFO","label":"other-server.logger","message":"自定义的日志输出"}
|
|
2
|
+
{"timestamp":"2023-10-25 14:35:29.944","level":"WARN","label":"other-server.logger","message":"自定义警告"}
|
|
3
|
+
{"timestamp":"2023-10-25 14:35:29.945","level":"ERROR","label":"other-server.logger","message":"自定义报错"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{"timestamp":"2023-10-25 14:35:59.689","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
2
|
+
{"timestamp":"2023-10-25 14:36:26.34","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
3
|
+
{"timestamp":"2023-10-25 14:36:33.799","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
4
|
+
{"timestamp":"2023-10-25 14:36:34.84","level":"INFO","label":"other-server.sys","message":"Complete component scan"}
|
|
5
|
+
{"timestamp":"2023-10-25 14:36:34.86","level":"INFO","label":"other-server.sys","message":"Call application initialization method"}
|
|
6
|
+
{"timestamp":"2023-10-25 14:36:34.89","level":"INFO","label":"other-server.sys","message":"start server app is run"}
|
|
7
|
+
{"timestamp":"2023-10-25 14:36:34.90","level":"INFO","label":"other-server.sys","message":"version 1.0.0"}
|
|
8
|
+
{"timestamp":"2023-10-25 14:36:34.105","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
9
|
+
{"timestamp":"2023-10-25 14:36:34.106","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
10
|
+
{"timestamp":"2023-10-25 14:36:39.118","level":"INFO","label":"other-server.sys","message":"application stop"}
|
|
11
|
+
{"timestamp":"2023-10-25 14:41:43.901","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
12
|
+
{"timestamp":"2023-10-25 14:41:44.189","level":"INFO","label":"other-server.sys","message":"Complete component scan"}
|
|
13
|
+
{"timestamp":"2023-10-25 14:41:44.191","level":"INFO","label":"other-server.sys","message":"Call application initialization method"}
|
|
14
|
+
{"timestamp":"2023-10-25 14:41:44.193","level":"INFO","label":"other-server.sys","message":"start server app is run"}
|
|
15
|
+
{"timestamp":"2023-10-25 14:41:44.194","level":"INFO","label":"other-server.sys","message":"version 1.0.0"}
|
|
16
|
+
{"timestamp":"2023-10-25 14:41:44.199","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
17
|
+
{"timestamp":"2023-10-25 14:41:44.199","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
18
|
+
{"timestamp":"2023-10-25 14:41:49.209","level":"INFO","label":"other-server.sys","message":"application stop"}
|
|
19
|
+
{"timestamp":"2023-10-25 14:42:25.346","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
20
|
+
{"timestamp":"2023-10-25 14:42:25.643","level":"INFO","label":"other-server.sys","message":"Complete component scan"}
|
|
21
|
+
{"timestamp":"2023-10-25 14:42:25.645","level":"INFO","label":"other-server.sys","message":"Call application initialization method"}
|
|
22
|
+
{"timestamp":"2023-10-25 14:42:25.647","level":"INFO","label":"other-server.sys","message":"start server app is run"}
|
|
23
|
+
{"timestamp":"2023-10-25 14:42:25.648","level":"INFO","label":"other-server.sys","message":"version 1.0.0"}
|
|
24
|
+
{"timestamp":"2023-10-25 14:42:25.684","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
25
|
+
{"timestamp":"2023-10-25 14:42:25.685","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{"timestamp":"2023-10-25 14:35:31.960","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
2
|
+
{"timestamp":"2023-10-25 14:35:31.961","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
3
|
+
{"timestamp":"2023-10-25 14:35:31.961","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
4
|
+
{"timestamp":"2023-10-25 14:35:31.962","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
5
|
+
{"timestamp":"2023-10-25 14:41:29.283","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
6
|
+
{"timestamp":"2023-10-25 14:41:29.625","level":"INFO","label":"other-server.sys","message":"Complete component scan"}
|
|
7
|
+
{"timestamp":"2023-10-25 14:41:29.626","level":"INFO","label":"other-server.sys","message":"Call application initialization method"}
|
|
8
|
+
{"timestamp":"2023-10-25 14:41:29.629","level":"INFO","label":"other-server.sys","message":"start server app is run"}
|
|
9
|
+
{"timestamp":"2023-10-25 14:41:29.630","level":"INFO","label":"other-server.sys","message":"version 1.0.0"}
|
|
10
|
+
{"timestamp":"2023-10-25 14:41:29.647","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
11
|
+
{"timestamp":"2023-10-25 14:41:29.648","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
12
|
+
{"timestamp":"2023-10-25 14:41:34.666","level":"INFO","label":"other-server.sys","message":"application stop"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{"timestamp":"2023-10-25 14:46:34.128","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
2
|
+
{"timestamp":"2023-10-25 14:46:34.462","level":"INFO","label":"other-server.sys","message":"Complete component scan"}
|
|
3
|
+
{"timestamp":"2023-10-25 14:46:34.463","level":"INFO","label":"other-server.sys","message":"Call application initialization method"}
|
|
4
|
+
{"timestamp":"2023-10-25 14:46:34.466","level":"INFO","label":"other-server.sys","message":"start server app is run"}
|
|
5
|
+
{"timestamp":"2023-10-25 14:46:34.467","level":"INFO","label":"other-server.sys","message":"version 1.0.0"}
|
|
6
|
+
{"timestamp":"2023-10-25 14:46:34.471","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
7
|
+
{"timestamp":"2023-10-25 14:46:34.472","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
8
|
+
{"timestamp":"2023-10-25 14:46:39.478","level":"INFO","label":"other-server.sys","message":"application stop"}
|
|
9
|
+
{"timestamp":"2023-10-25 14:46:55.210","level":"INFO","label":"other-server.sys","message":"Start scanning component"}
|
|
10
|
+
{"timestamp":"2023-10-25 14:46:55.494","level":"INFO","label":"other-server.sys","message":"Complete component scan"}
|
|
11
|
+
{"timestamp":"2023-10-25 14:46:55.497","level":"INFO","label":"other-server.sys","message":"Call application initialization method"}
|
|
12
|
+
{"timestamp":"2023-10-25 14:46:55.500","level":"INFO","label":"other-server.sys","message":"start server app is run"}
|
|
13
|
+
{"timestamp":"2023-10-25 14:46:55.501","level":"INFO","label":"other-server.sys","message":"version 1.0.0"}
|
|
14
|
+
{"timestamp":"2023-10-25 14:46:55.507","level":"INFO","label":"other-server.sys","message":"exit reason","splat":"[\"beforeExit exit\"]"}
|
|
15
|
+
{"timestamp":"2023-10-25 14:46:55.508","level":"INFO","label":"other-server.sys","message":"Call the method before the application stops"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import Application from "../../../src/annotation/Application";
|
|
3
|
+
import ENV from "../../../src/annotation/env/ENV";
|
|
4
|
+
import FastCarApplication from "../../../src/FastCarApplication";
|
|
5
|
+
import BaseFilePath from "../../../src/annotation/env/BaseFilePath";
|
|
6
|
+
import BasePath from "../../../src/annotation/env/BasePath";
|
|
7
|
+
import ApplicationHook from "../../../src/interface/ApplicationHook";
|
|
8
|
+
import Log from "../../../src/annotation/stereotype/Log";
|
|
9
|
+
import Logger from "../../../src/interface/Logger";
|
|
10
|
+
import ApplicationSetting from "../../../src/annotation/env/ApplicationSetting";
|
|
11
|
+
import { ComponentScanExclusion } from "../../../src/annotation";
|
|
12
|
+
import BaseName from "../../../src/annotation/env/BaseName";
|
|
13
|
+
|
|
14
|
+
@Application
|
|
15
|
+
@ENV("test") //设置环境变量
|
|
16
|
+
@BasePath(__dirname) //直接运行ts文件时可不用
|
|
17
|
+
@BaseFilePath(__filename)
|
|
18
|
+
@ApplicationSetting({
|
|
19
|
+
appid: "other-server",
|
|
20
|
+
})
|
|
21
|
+
@BaseName("other")
|
|
22
|
+
@ComponentScanExclusion("app.ts")
|
|
23
|
+
class APP implements ApplicationHook {
|
|
24
|
+
app!: FastCarApplication;
|
|
25
|
+
|
|
26
|
+
@Log("app")
|
|
27
|
+
logger!: Logger;
|
|
28
|
+
|
|
29
|
+
beforeStartServer(): void {
|
|
30
|
+
this.logger.debug("beforeStartServer-----");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
startServer(): void {
|
|
34
|
+
this.logger.debug("startServer------");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
beforeStopServer(): void {
|
|
38
|
+
this.logger.debug("beforeStopServer-----");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
stopServer(): void {
|
|
42
|
+
this.logger.debug("stopServer-----");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let appInsatcne = new APP();
|
|
47
|
+
console.log("打印文件读取名称", appInsatcne.app.getBaseName());
|
|
48
|
+
console.log("打印文件内容", appInsatcne.app.getSetting("name"));
|
|
@@ -10,7 +10,9 @@ import ApplicationHook from "../../../src/interface/ApplicationHook";
|
|
|
10
10
|
import Log from "../../../src/annotation/stereotype/Log";
|
|
11
11
|
import Logger from "../../../src/interface/Logger";
|
|
12
12
|
import ApplicationSetting from "../../../src/annotation/env/ApplicationSetting";
|
|
13
|
+
import { ComponentScanExclusion } from "../../../src/annotation";
|
|
13
14
|
|
|
15
|
+
@ComponentScanExclusion("app-test.ts")
|
|
14
16
|
@Application
|
|
15
17
|
@ENV("test") //设置环境变量
|
|
16
18
|
@BasePath(__dirname) //直接运行ts文件时可不用
|