@fastcar/core 0.2.38
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/LICENSE +20 -0
- package/README.md +379 -0
- package/annotation.d.ts +157 -0
- package/db.d.ts +272 -0
- package/index.d.ts +262 -0
- package/package.json +53 -0
- package/src/FastCarApplication.ts +761 -0
- package/src/annotation/Application.ts +46 -0
- package/src/annotation/ExceptionMonitor.ts +15 -0
- package/src/annotation/bind/AddRequireModule.ts +18 -0
- package/src/annotation/bind/AliasInjection.ts +24 -0
- package/src/annotation/bind/Autowired.ts +11 -0
- package/src/annotation/bind/CallDependency.ts +24 -0
- package/src/annotation/data/DBType.ts +9 -0
- package/src/annotation/data/DS.ts +58 -0
- package/src/annotation/data/DSIndex.ts +7 -0
- package/src/annotation/data/Entity.ts +8 -0
- package/src/annotation/data/Field.ts +15 -0
- package/src/annotation/data/PrimaryKey.ts +7 -0
- package/src/annotation/data/SqlSession.ts +7 -0
- package/src/annotation/data/Table.ts +37 -0
- package/src/annotation/data/Transactional.ts +60 -0
- package/src/annotation/env/ApplicationSetting.ts +24 -0
- package/src/annotation/env/BaseFilePath.ts +12 -0
- package/src/annotation/env/BasePath.ts +12 -0
- package/src/annotation/env/ENV.ts +8 -0
- package/src/annotation/env/ResourcePath.ts +7 -0
- package/src/annotation/lifeCycle/AddLifeCycleItem.ts +25 -0
- package/src/annotation/lifeCycle/ApplicationDestory.ts +13 -0
- package/src/annotation/lifeCycle/ApplicationInit.ts +13 -0
- package/src/annotation/lifeCycle/ApplicationRunner.ts +5 -0
- package/src/annotation/lifeCycle/ApplicationStart.ts +23 -0
- package/src/annotation/lifeCycle/ApplicationStop.ts +18 -0
- package/src/annotation/property/Deprecate.ts +17 -0
- package/src/annotation/property/NotImplemented.ts +5 -0
- package/src/annotation/property/Override.ts +4 -0
- package/src/annotation/property/Readonly.ts +12 -0
- package/src/annotation/scan/ComponentInjection.ts +22 -0
- package/src/annotation/scan/ComponentScan.ts +7 -0
- package/src/annotation/scan/ComponentScanExclusion.ts +26 -0
- package/src/annotation/scan/Hotter.ts +6 -0
- package/src/annotation/stereotype/BeanName.ts +9 -0
- package/src/annotation/stereotype/Component.ts +6 -0
- package/src/annotation/stereotype/Configure.ts +12 -0
- package/src/annotation/stereotype/Controller.ts +7 -0
- package/src/annotation/stereotype/Injection.ts +10 -0
- package/src/annotation/stereotype/Log.ts +17 -0
- package/src/annotation/stereotype/Repository.ts +7 -0
- package/src/annotation/stereotype/Service.ts +7 -0
- package/src/annotation/valid/AddChildValid.ts +61 -0
- package/src/annotation/valid/DefaultVal.ts +8 -0
- package/src/annotation/valid/NotNull.ts +7 -0
- package/src/annotation/valid/Rule.ts +104 -0
- package/src/annotation/valid/Size.ts +13 -0
- package/src/annotation/valid/Type.ts +8 -0
- package/src/annotation/valid/ValidCustom.ts +21 -0
- package/src/annotation/valid/ValidForm.ts +146 -0
- package/src/annotation.ts +103 -0
- package/src/config/ApplicationConfig.ts +5 -0
- package/src/config/SysConfig.ts +28 -0
- package/src/constant/AppStatusEnum.ts +5 -0
- package/src/constant/BootPriority.ts +7 -0
- package/src/constant/CommonConstant.ts +14 -0
- package/src/constant/ComponentKind.ts +7 -0
- package/src/constant/DataTypes.ts +15 -0
- package/src/constant/FastCarMetaData.ts +25 -0
- package/src/constant/LifeCycleModule.ts +5 -0
- package/src/db.ts +182 -0
- package/src/index.ts +11 -0
- package/src/interface/ApplicationHook.ts +9 -0
- package/src/interface/ApplicationRunnerService.ts +3 -0
- package/src/interface/DataSourceManager.ts +14 -0
- package/src/interface/Logger.ts +9 -0
- package/src/model/BaseMapper.ts +115 -0
- package/src/model/DataMap.ts +103 -0
- package/src/model/FormRuleModel.ts +23 -0
- package/src/model/ValidError.ts +1 -0
- package/src/model/WinstonLogger.ts +119 -0
- package/src/type/ComponentDesc.ts +5 -0
- package/src/type/DesignMeta.ts +11 -0
- package/src/type/FileHotterDesc.ts +4 -0
- package/src/type/MapperType.ts +8 -0
- package/src/type/ProcessType.ts +12 -0
- package/src/type/SqlError.ts +3 -0
- package/src/type/WinstonLoggerType.ts +18 -0
- package/src/utils/ClassLoader.ts +72 -0
- package/src/utils/ClassUtils.ts +38 -0
- package/src/utils/CryptoUtil.ts +106 -0
- package/src/utils/DataFormat.ts +97 -0
- package/src/utils/DateUtil.ts +85 -0
- package/src/utils/FileUtil.ts +172 -0
- package/src/utils/FormatStr.ts +13 -0
- package/src/utils/Mix.ts +69 -0
- package/src/utils/ReflectUtil.ts +22 -0
- package/src/utils/TypeUtil.ts +56 -0
- package/src/utils/ValidationUtil.ts +138 -0
- package/src/utils.ts +13 -0
- package/target/FastCarApplication.js +661 -0
- package/target/annotation/AddRequireModule.js +21 -0
- package/target/annotation/Application.js +45 -0
- package/target/annotation/Autowired.js +15 -0
- package/target/annotation/Calldependency.js +18 -0
- package/target/annotation/ExceptionMonitor.js +16 -0
- package/target/annotation/bind/AddRequireModule.js +21 -0
- package/target/annotation/bind/AliasInjection.js +23 -0
- package/target/annotation/bind/Autowired.js +13 -0
- package/target/annotation/bind/CallDependency.js +23 -0
- package/target/annotation/data/DBType.js +11 -0
- package/target/annotation/data/DS.js +54 -0
- package/target/annotation/data/DSIndex.js +9 -0
- package/target/annotation/data/Entity.js +10 -0
- package/target/annotation/data/Field.js +18 -0
- package/target/annotation/data/PrimaryKey.js +9 -0
- package/target/annotation/data/SqlSession.js +9 -0
- package/target/annotation/data/Table.js +34 -0
- package/target/annotation/data/Transactional.js +52 -0
- package/target/annotation/env/ApplicationSetting.js +25 -0
- package/target/annotation/env/BaseFilePath.js +14 -0
- package/target/annotation/env/BasePath.js +14 -0
- package/target/annotation/env/ENV.js +10 -0
- package/target/annotation/env/ResourcePath.js +9 -0
- package/target/annotation/lifeCycle/AddLifeCycleItem.js +18 -0
- package/target/annotation/lifeCycle/ApplicationDestory.js +15 -0
- package/target/annotation/lifeCycle/ApplicationInit.js +15 -0
- package/target/annotation/lifeCycle/ApplicationRunner.js +7 -0
- package/target/annotation/lifeCycle/ApplicationStart.js +24 -0
- package/target/annotation/lifeCycle/ApplicationStop.js +20 -0
- package/target/annotation/property/Deprecate.js +19 -0
- package/target/annotation/property/NotImplemented.js +8 -0
- package/target/annotation/property/Override.js +7 -0
- package/target/annotation/property/Readonly.js +16 -0
- package/target/annotation/scan/ComponentInjection.js +21 -0
- package/target/annotation/scan/ComponentScan.js +9 -0
- package/target/annotation/scan/ComponentScanExclusion.js +25 -0
- package/target/annotation/scan/Hotter.js +8 -0
- package/target/annotation/stereotype/BeanName.js +11 -0
- package/target/annotation/stereotype/Component.js +8 -0
- package/target/annotation/stereotype/Configure.js +14 -0
- package/target/annotation/stereotype/Controller.js +9 -0
- package/target/annotation/stereotype/Injection.js +12 -0
- package/target/annotation/stereotype/Log.js +16 -0
- package/target/annotation/stereotype/Repository.js +9 -0
- package/target/annotation/stereotype/Service.js +9 -0
- package/target/annotation/valid/AddChildValid.js +56 -0
- package/target/annotation/valid/DefaultVal.js +10 -0
- package/target/annotation/valid/NotNull.js +8 -0
- package/target/annotation/valid/Rule.js +100 -0
- package/target/annotation/valid/Size.js +10 -0
- package/target/annotation/valid/Type.js +10 -0
- package/target/annotation/valid/ValidCustom.js +17 -0
- package/target/annotation/valid/ValidForm.js +131 -0
- package/target/annotation.js +101 -0
- package/target/config/ApplicationConfig.js +2 -0
- package/target/config/SysConfig.js +19 -0
- package/target/constant/AppStatusEnum.js +9 -0
- package/target/constant/BootPriority.js +11 -0
- package/target/constant/CommonConstant.js +16 -0
- package/target/constant/ComponentKind.js +11 -0
- package/target/constant/DataTypes.js +19 -0
- package/target/constant/FastCarMetaData.js +29 -0
- package/target/constant/LifeCycleModule.js +9 -0
- package/target/db.js +46 -0
- package/target/index.js +21 -0
- package/target/interface/ApplicationHook.js +2 -0
- package/target/interface/ApplicationRunnerService.js +2 -0
- package/target/interface/DataSourceManager.js +2 -0
- package/target/interface/Logger.js +5 -0
- package/target/model/BaseMapper.js +98 -0
- package/target/model/DataMap.js +87 -0
- package/target/model/FormRuleModel.js +2 -0
- package/target/model/ValidError.js +5 -0
- package/target/model/WinstonLogger.js +95 -0
- package/target/type/ComponentDesc.js +2 -0
- package/target/type/DesignMeta.js +15 -0
- package/target/type/FileHotterDesc.js +2 -0
- package/target/type/MapperType.js +2 -0
- package/target/type/ProcessType.js +2 -0
- package/target/type/SqlError.js +5 -0
- package/target/type/WinstonLoggerType.js +9 -0
- package/target/utils/ClassUtils.js +35 -0
- package/target/utils/CryptoUtil.js +84 -0
- package/target/utils/DataFormat.js +84 -0
- package/target/utils/DateUtil.js +71 -0
- package/target/utils/FileUtil.js +153 -0
- package/target/utils/FormatStr.js +14 -0
- package/target/utils/Mix.js +62 -0
- package/target/utils/ReflectUtil.js +22 -0
- package/target/utils/TypeUtil.js +47 -0
- package/target/utils/ValidationUtil.js +118 -0
- package/target/utils/classLoader.js +65 -0
- package/target/utils.js +23 -0
- package/test/example/logs/app.log +0 -0
- package/test/example/logs/logger.log +12 -0
- package/test/example/logs/logger1.log +12 -0
- package/test/example/logs/logger2.log +12 -0
- package/test/example/logs/logger3.log +12 -0
- package/test/example/logs/logger4.log +12 -0
- package/test/example/logs/logger5.log +6 -0
- package/test/example/logs/sys.log +7 -0
- package/test/example/logs/sys1.log +14 -0
- package/test/example/logs/sys10.log +12 -0
- package/test/example/logs/sys11.log +5 -0
- package/test/example/logs/sys13.log +5 -0
- package/test/example/logs/sys2.log +3 -0
- package/test/example/logs/sys4.log +15 -0
- package/test/example/logs/sys5.log +9 -0
- package/test/example/logs/sys6.log +10 -0
- package/test/example/logs/sys7.log +15 -0
- package/test/example/logs/sys8.log +11 -0
- package/test/example/logs/sys9.log +10 -0
- package/test/example/resource/application-test.yml +0 -0
- package/test/example/resource/application.yml +7 -0
- package/test/example/resource/evnconfig-test.yml +1 -0
- package/test/example/resource/hello.yml +1 -0
- package/test/example/simple/app.ts +99 -0
- package/test/example/simple/component/StartRunner.ts +10 -0
- package/test/example/simple/component/StopRunner.ts +14 -0
- package/test/example/simple/config/EnvConfig.ts +6 -0
- package/test/example/simple/config/HelloConfig.ts +8 -0
- package/test/example/simple/controller/AliasController.ts +6 -0
- package/test/example/simple/controller/HelloController.ts +39 -0
- package/test/example/simple/controller/NotFoundController.ts +20 -0
- package/test/example/simple/service/CallService.ts +11 -0
- package/test/example/simple/service/HelloService.ts +10 -0
- package/test/example/simple/service/LogService.ts +19 -0
- package/test/logs/logger.log +0 -0
- package/test/logs/sys.log +227 -0
- package/test/multi/app.ts +15 -0
- package/test/multi/service/aService.ts +16 -0
- package/test/multi/service/bService.ts +18 -0
- package/test/multi/service/cService.ts +21 -0
- package/test/unit/dataMap-test.ts +48 -0
- package/test/unit/decorators-test.ts +38 -0
- package/test/unit/ds-test.ts +33 -0
- package/test/unit/logs/sys.log +24 -0
- package/test/unit/reflectMetadata-test.ts +15 -0
- package/test/unit/valid-test.ts +65 -0
- package/test/unit/winston-test.ts +15 -0
- package/utils.d.ts +166 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
|
|
6
|
+
function ComponentInjection(target, ...names) {
|
|
7
|
+
let ScanPathList = FastCarMetaData_1.FastCarMetaData.ComponentScan;
|
|
8
|
+
let list = Reflect.get(target.prototype, ScanPathList) || [];
|
|
9
|
+
for (let name of names) {
|
|
10
|
+
//可支持绝对路径
|
|
11
|
+
let p = path.join(require.main?.path || "", name);
|
|
12
|
+
if (fs.existsSync(name)) {
|
|
13
|
+
p = name;
|
|
14
|
+
}
|
|
15
|
+
if (!list.includes(p)) {
|
|
16
|
+
list.push(p);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
Reflect.set(target.prototype, ScanPathList, list);
|
|
20
|
+
}
|
|
21
|
+
exports.default = ComponentInjection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ComponentInjection_1 = require("./ComponentInjection");
|
|
4
|
+
function ComponentScan(...names) {
|
|
5
|
+
return function (target) {
|
|
6
|
+
(0, ComponentInjection_1.default)(target, ...names);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
exports.default = ComponentScan;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
|
|
7
|
+
//和本包的相对路径
|
|
8
|
+
function ComponentScanExclusion(...names) {
|
|
9
|
+
return function (target) {
|
|
10
|
+
let ScanPathList = FastCarMetaData_1.FastCarMetaData.ComponentScanExclusion;
|
|
11
|
+
let list = Reflect.get(target.prototype, ScanPathList) || [];
|
|
12
|
+
for (let name of names) {
|
|
13
|
+
//可支持绝对路径
|
|
14
|
+
let p = path.join(require.main?.path || "", name);
|
|
15
|
+
if (fs.existsSync(name)) {
|
|
16
|
+
p = name;
|
|
17
|
+
}
|
|
18
|
+
if (!list.includes(p)) {
|
|
19
|
+
list.push(p);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
Reflect.set(target.prototype, ScanPathList, list);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.default = ComponentScanExclusion;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
function Hotter(target) {
|
|
6
|
+
Reflect.defineMetadata(__1.FastCarMetaData.Hotter, true, target.prototype);
|
|
7
|
+
}
|
|
8
|
+
exports.default = Hotter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
|
|
4
|
+
//应用别名声明
|
|
5
|
+
function BeanName(name) {
|
|
6
|
+
return function (target) {
|
|
7
|
+
//生成别名 用于逻辑识别
|
|
8
|
+
Reflect.defineMetadata(FastCarMetaData_1.FastCarMetaData.Alias, name, target.prototype); //放入至原型中
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
exports.default = BeanName;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ComponentKind_1 = require("../../constant/ComponentKind");
|
|
4
|
+
const Injection_1 = require("./Injection");
|
|
5
|
+
function Component(target) {
|
|
6
|
+
(0, Injection_1.default)(target, ComponentKind_1.ComponentKind.Component);
|
|
7
|
+
}
|
|
8
|
+
exports.default = Component;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Component_1 = require("./Component");
|
|
4
|
+
const LifeCycleModule_1 = require("../../constant/LifeCycleModule");
|
|
5
|
+
//配置文件层
|
|
6
|
+
function Configure(name) {
|
|
7
|
+
return function (target) {
|
|
8
|
+
//配置对象也为组件
|
|
9
|
+
(0, Component_1.default)(target);
|
|
10
|
+
//当实例化时 加载默认配置并进行赋值
|
|
11
|
+
Reflect.defineMetadata(LifeCycleModule_1.LifeCycleModule.LoadConfigure, name, target);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.default = Configure;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ComponentKind_1 = require("../../constant/ComponentKind");
|
|
4
|
+
const Injection_1 = require("./Injection");
|
|
5
|
+
//业务逻辑层
|
|
6
|
+
function Controller(target) {
|
|
7
|
+
(0, Injection_1.default)(target, ComponentKind_1.ComponentKind.Controller);
|
|
8
|
+
}
|
|
9
|
+
exports.default = Controller;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
4
|
+
const CryptoUtil_1 = require("../../utils/CryptoUtil");
|
|
5
|
+
const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
|
|
6
|
+
function Injection(target, name) {
|
|
7
|
+
//生成别名 避免名称重复的情况
|
|
8
|
+
let key = `${name}:${CryptoUtil_1.default.getHashStr()}`;
|
|
9
|
+
Reflect.defineMetadata(name, true, target.prototype);
|
|
10
|
+
Reflect.defineMetadata(FastCarMetaData_1.FastCarMetaData.InjectionUniqueKey, key, target); //放入至原型中
|
|
11
|
+
}
|
|
12
|
+
exports.default = Injection;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const CommonConstant_1 = require("../../constant/CommonConstant");
|
|
4
|
+
//日志实例
|
|
5
|
+
function Log(category) {
|
|
6
|
+
return function (target, propertyKey) {
|
|
7
|
+
let m = category || propertyKey;
|
|
8
|
+
Reflect.defineProperty(target, propertyKey, {
|
|
9
|
+
get: () => {
|
|
10
|
+
let app = Reflect.get(global, CommonConstant_1.CommonConstant.FastcarApp);
|
|
11
|
+
return app ? app.getLogger(m) : console;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.default = Log;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ComponentKind_1 = require("../../constant/ComponentKind");
|
|
4
|
+
const Injection_1 = require("./Injection");
|
|
5
|
+
//数据逻辑层(表明和数据库相关)
|
|
6
|
+
function Repository(target) {
|
|
7
|
+
(0, Injection_1.default)(target, ComponentKind_1.ComponentKind.Repository);
|
|
8
|
+
}
|
|
9
|
+
exports.default = Repository;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ComponentKind_1 = require("../../constant/ComponentKind");
|
|
4
|
+
const Injection_1 = require("./Injection");
|
|
5
|
+
//中间服务层
|
|
6
|
+
function Service(target) {
|
|
7
|
+
(0, Injection_1.default)(target, ComponentKind_1.ComponentKind.Service);
|
|
8
|
+
}
|
|
9
|
+
exports.default = Service;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
4
|
+
const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
|
|
5
|
+
const TypeUtil_1 = require("../../utils/TypeUtil");
|
|
6
|
+
const ValidationUtil_1 = require("../../utils/ValidationUtil");
|
|
7
|
+
//添加子元素的校验规则
|
|
8
|
+
function AddChildValid(target, name, value, index) {
|
|
9
|
+
let childMap;
|
|
10
|
+
let paramsFlag = ValidationUtil_1.default.isNumber(index);
|
|
11
|
+
let alias = paramsFlag ? `${name}-${index}` : name;
|
|
12
|
+
if (paramsFlag) {
|
|
13
|
+
childMap = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.ValidChildFormRules, target, alias);
|
|
14
|
+
if (!childMap) {
|
|
15
|
+
childMap = new Map();
|
|
16
|
+
Reflect.defineMetadata(FastCarMetaData_1.FastCarMetaData.ValidChildFormRules, childMap, target, alias);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
childMap = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.ValidChildFormRules, target);
|
|
21
|
+
if (!childMap) {
|
|
22
|
+
childMap = new Map();
|
|
23
|
+
Reflect.defineMetadata(FastCarMetaData_1.FastCarMetaData.ValidChildFormRules, childMap, target);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
let item = childMap.get(alias);
|
|
27
|
+
if (!item) {
|
|
28
|
+
let proto = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.designType, target, name);
|
|
29
|
+
if (paramsFlag) {
|
|
30
|
+
//修改为方法获取原型
|
|
31
|
+
let paramsTypes = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.paramTypes, target, name);
|
|
32
|
+
if (typeof index == "number") {
|
|
33
|
+
proto = paramsTypes[index];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
let typeName = proto.name.toLowerCase();
|
|
37
|
+
if (!TypeUtil_1.default.isBasic(typeName)) {
|
|
38
|
+
typeName = typeName == "array" ? "array" : "object";
|
|
39
|
+
}
|
|
40
|
+
item = {
|
|
41
|
+
type: typeName,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//自定义方法合并
|
|
45
|
+
if (Reflect.has(value, "filters")) {
|
|
46
|
+
if (Array.isArray(item.filters)) {
|
|
47
|
+
item.filters.forEach((f) => {
|
|
48
|
+
value.filters.push(f);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//合并所有属性
|
|
53
|
+
Object.assign(item, value);
|
|
54
|
+
childMap.set(alias, item);
|
|
55
|
+
}
|
|
56
|
+
exports.default = AddChildValid;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AddChildValid_1 = require("./AddChildValid");
|
|
4
|
+
//默认值获取
|
|
5
|
+
function DefaultVal(val) {
|
|
6
|
+
return function (target, propertyKey, index) {
|
|
7
|
+
(0, AddChildValid_1.default)(target, propertyKey, { defaultVal: val }, index);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.default = DefaultVal;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AddChildValid_1 = require("./AddChildValid");
|
|
4
|
+
//是否为非空字段
|
|
5
|
+
function NotNull(target, propertyKey, index) {
|
|
6
|
+
(0, AddChildValid_1.default)(target, propertyKey, { required: true }, index);
|
|
7
|
+
}
|
|
8
|
+
exports.default = NotNull;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Rule = void 0;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
|
|
6
|
+
const TypeUtil_1 = require("../../utils/TypeUtil");
|
|
7
|
+
function Rule(rules = {}) {
|
|
8
|
+
return function (target, method, index) {
|
|
9
|
+
//获取设计类型
|
|
10
|
+
//获取增强类型的增加严格校验
|
|
11
|
+
let paramsTypes = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.paramTypes, target, method);
|
|
12
|
+
//对rules进行进一步的补充
|
|
13
|
+
let designObj = paramsTypes[index];
|
|
14
|
+
let basicFlag = false;
|
|
15
|
+
if (!designObj) {
|
|
16
|
+
console.warn(`Design type not found by ${method} in ${index}`);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
basicFlag = TypeUtil_1.default.isBasic(designObj.name);
|
|
20
|
+
//获取表单类型
|
|
21
|
+
let childMap = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.ValidChildFormRules, target, `${method}-${index}`);
|
|
22
|
+
//进行合并添加
|
|
23
|
+
if (TypeUtil_1.default.isClass(designObj)) {
|
|
24
|
+
let appendMap = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.ValidChildFormRules, designObj.prototype);
|
|
25
|
+
if (appendMap) {
|
|
26
|
+
if (!childMap) {
|
|
27
|
+
childMap = new Map();
|
|
28
|
+
}
|
|
29
|
+
appendMap.forEach((v, key) => {
|
|
30
|
+
if (!childMap.has(key)) {
|
|
31
|
+
childMap.set(key, v);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
//进行覆盖更新
|
|
36
|
+
let item = childMap.get(key);
|
|
37
|
+
if (Reflect.has(v, "filters")) {
|
|
38
|
+
if (Array.isArray(item?.filters)) {
|
|
39
|
+
v.filters?.forEach(f => {
|
|
40
|
+
item?.filters?.push(f);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//合并所有属性
|
|
45
|
+
item = Object.assign(v, item);
|
|
46
|
+
childMap.set(key, item);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (childMap && childMap.size > 0) {
|
|
52
|
+
//补充表单
|
|
53
|
+
childMap.forEach((citem, prop) => {
|
|
54
|
+
if (Reflect.has(rules, prop)) {
|
|
55
|
+
//优先取表单里的
|
|
56
|
+
rules[prop] = Object.assign(citem, rules[prop]);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
Reflect.set(rules, prop, citem);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
let rulesMap = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.ValidFormRules, target, method);
|
|
65
|
+
if (!rulesMap) {
|
|
66
|
+
rulesMap = new Map();
|
|
67
|
+
Reflect.defineMetadata(FastCarMetaData_1.FastCarMetaData.ValidFormRules, rulesMap, target, method);
|
|
68
|
+
}
|
|
69
|
+
//补全消息
|
|
70
|
+
Object.keys(rules).forEach(prop => {
|
|
71
|
+
let r = rules[prop];
|
|
72
|
+
//根据增强型补全type
|
|
73
|
+
if (basicFlag && !Reflect.has(r, "type")) {
|
|
74
|
+
if (designObj) {
|
|
75
|
+
r.type = designObj.name.toLowerCase();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
r.type = "string";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (r.message) {
|
|
82
|
+
if (r.required) {
|
|
83
|
+
r.nullMessage = r.nullMessage ? r.nullMessage : r.message;
|
|
84
|
+
}
|
|
85
|
+
if (r.maxSize || r.minSize) {
|
|
86
|
+
r.sizeMessgae = r.sizeMessgae ? r.sizeMessgae : r.message;
|
|
87
|
+
}
|
|
88
|
+
r.typeMessage = r.typeMessage ? r.typeMessage : r.message;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
if (r.required) {
|
|
92
|
+
r.nullMessage = `${prop} is required`;
|
|
93
|
+
}
|
|
94
|
+
r.typeMessage = `${prop} type is ${r.type}`;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
rulesMap.set(index, { rules, basicFlag, index });
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
exports.Rule = Rule;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AddChildValid_1 = require("./AddChildValid");
|
|
4
|
+
//校验长度
|
|
5
|
+
function Size(m = { minSize: 0, maxSize: 0 }) {
|
|
6
|
+
return function (target, propertyKey, index) {
|
|
7
|
+
(0, AddChildValid_1.default)(target, propertyKey, m, index);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.default = Size;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AddChildValid_1 = require("./AddChildValid");
|
|
4
|
+
//表明类型
|
|
5
|
+
function Type(type) {
|
|
6
|
+
return function (target, propertyKey, index) {
|
|
7
|
+
(0, AddChildValid_1.default)(target, propertyKey, { type: type.toLowerCase() }, index);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.default = Type;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AddChildValid_1 = require("./AddChildValid");
|
|
4
|
+
//自定义表单校验
|
|
5
|
+
function ValidCustom(fn, message) {
|
|
6
|
+
return function (target, propertyKey, index) {
|
|
7
|
+
(0, AddChildValid_1.default)(target, propertyKey, {
|
|
8
|
+
filters: [
|
|
9
|
+
{
|
|
10
|
+
fn,
|
|
11
|
+
message,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
}, index);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.default = ValidCustom;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ValidError_1 = require("../../model/ValidError");
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const ValidationUtil_1 = require("../../utils/ValidationUtil");
|
|
6
|
+
const DataFormat_1 = require("../../utils/DataFormat");
|
|
7
|
+
const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
|
|
8
|
+
function throwErrMsg(rule, prop, msg) {
|
|
9
|
+
let showMsg = msg;
|
|
10
|
+
if (!showMsg) {
|
|
11
|
+
showMsg = rule.message ? rule.message : `The ${prop} parameter is invalid `;
|
|
12
|
+
}
|
|
13
|
+
throw new ValidError_1.default(showMsg);
|
|
14
|
+
}
|
|
15
|
+
function getFormValue(value, prop, defaultValue) {
|
|
16
|
+
//查看是否校验子属性
|
|
17
|
+
if (ValidationUtil_1.default.isNotNull(value)) {
|
|
18
|
+
if (utils_1.TypeUtil.isObject(value)) {
|
|
19
|
+
if (Reflect.has(value, prop)) {
|
|
20
|
+
let propValue = Reflect.get(value, prop);
|
|
21
|
+
if (ValidationUtil_1.default.isNotNull(propValue)) {
|
|
22
|
+
return propValue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (ValidationUtil_1.default.isNotNull(defaultValue)) {
|
|
31
|
+
return defaultValue;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function setFormValue(obj, prop, val) {
|
|
36
|
+
//查看是否校验子属性
|
|
37
|
+
if (ValidationUtil_1.default.isNotNull(obj) || utils_1.TypeUtil.isObject(obj)) {
|
|
38
|
+
//修正为{}对象时无法赋值错误
|
|
39
|
+
if (utils_1.TypeUtil.isObject(obj)) {
|
|
40
|
+
Reflect.set(obj, prop, val);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
obj = val;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return obj;
|
|
47
|
+
}
|
|
48
|
+
function delFormValue(value, prop) {
|
|
49
|
+
if (ValidationUtil_1.default.isNotNull(value)) {
|
|
50
|
+
if (utils_1.TypeUtil.isObject(value)) {
|
|
51
|
+
if (Reflect.has(value, prop)) {
|
|
52
|
+
Reflect.deleteProperty(value, prop);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/***
|
|
58
|
+
* @version 1.0 校验表单 支持校验大小 类型 和自定义方法
|
|
59
|
+
* @param rules key - value的形式 通常一个参数一个校验方式
|
|
60
|
+
* @param paramIndex 位于第几个参数的校验表单
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
function ValidForm(target, methodName, descriptor) {
|
|
64
|
+
let next = descriptor.value;
|
|
65
|
+
descriptor.value = function (...args) {
|
|
66
|
+
let rulesMap = Reflect.getMetadata(FastCarMetaData_1.FastCarMetaData.ValidFormRules, target, methodName);
|
|
67
|
+
if (rulesMap && rulesMap.size > 0) {
|
|
68
|
+
rulesMap.forEach((item, paramIndex) => {
|
|
69
|
+
let { rules, basicFlag } = item;
|
|
70
|
+
let currObj = args[paramIndex];
|
|
71
|
+
if (ValidationUtil_1.default.isNull(currObj)) {
|
|
72
|
+
currObj = basicFlag ? "" : {};
|
|
73
|
+
}
|
|
74
|
+
for (let prop in rules) {
|
|
75
|
+
let rule = rules[prop];
|
|
76
|
+
//进行取值
|
|
77
|
+
let val = getFormValue(currObj, prop, rule.defaultVal);
|
|
78
|
+
//判断关键字是否相同
|
|
79
|
+
if (`${methodName}-${paramIndex}` == prop) {
|
|
80
|
+
val = currObj || rule.defaultVal;
|
|
81
|
+
}
|
|
82
|
+
//优先判断是否为必填项
|
|
83
|
+
if (ValidationUtil_1.default.isNull(val)) {
|
|
84
|
+
if (rule.required) {
|
|
85
|
+
throwErrMsg(rule, prop, rule.nullMessage);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
delFormValue(currObj, prop);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
//进行类型判断并赋值
|
|
93
|
+
let checkType = rule.type || "string";
|
|
94
|
+
val = DataFormat_1.default.formatValue(val, checkType);
|
|
95
|
+
//调用check的方法
|
|
96
|
+
if (!ValidationUtil_1.default.checkType(val, checkType)) {
|
|
97
|
+
throwErrMsg(rule, prop, rule.typeMessage);
|
|
98
|
+
}
|
|
99
|
+
//判断长度
|
|
100
|
+
if (rule?.minSize) {
|
|
101
|
+
if (!ValidationUtil_1.default.isNotMinSize(val, rule.minSize)) {
|
|
102
|
+
throwErrMsg(rule, prop, rule.sizeMessgae ? rule.sizeMessgae : `${prop} should be greater than ${rule.minSize} `);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (rule?.maxSize) {
|
|
106
|
+
if (!ValidationUtil_1.default.isNotMaxSize(val, rule.maxSize)) {
|
|
107
|
+
throwErrMsg(rule, prop, rule.sizeMessgae ? rule.sizeMessgae : `${prop} should be less than ${rule.maxSize} `);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//自定义方法校验
|
|
111
|
+
if (Array.isArray(rule.filters)) {
|
|
112
|
+
for (let fnItem of rule.filters) {
|
|
113
|
+
let fn = fnItem.fn;
|
|
114
|
+
let flag = Reflect.apply(fn, this, [val]);
|
|
115
|
+
if (!flag) {
|
|
116
|
+
//抛出错误提示
|
|
117
|
+
throwErrMsg(rule, prop, fnItem.message || rule.message);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//进行赋值
|
|
122
|
+
currObj = setFormValue(currObj, prop, val);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
args[paramIndex] = currObj;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return Reflect.apply(next, this, args);
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
exports.default = ValidForm;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
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;
|
|
4
|
+
const Application_1 = require("./annotation/Application");
|
|
5
|
+
exports.Application = Application_1.default;
|
|
6
|
+
const Autowired_1 = require("./annotation/bind/Autowired");
|
|
7
|
+
exports.Autowired = Autowired_1.default;
|
|
8
|
+
const ENV_1 = require("./annotation/env/ENV");
|
|
9
|
+
exports.ENV = ENV_1.default;
|
|
10
|
+
const ExceptionMonitor_1 = require("./annotation/ExceptionMonitor");
|
|
11
|
+
exports.ExceptionMonitor = ExceptionMonitor_1.default;
|
|
12
|
+
const ApplicationStart_1 = require("./annotation/lifeCycle/ApplicationStart");
|
|
13
|
+
exports.ApplicationStart = ApplicationStart_1.default;
|
|
14
|
+
const ApplicationStop_1 = require("./annotation/lifeCycle/ApplicationStop");
|
|
15
|
+
exports.ApplicationStop = ApplicationStop_1.default;
|
|
16
|
+
const Deprecate_1 = require("./annotation/property/Deprecate");
|
|
17
|
+
exports.Deprecate = Deprecate_1.default;
|
|
18
|
+
const NotImplemented_1 = require("./annotation/property/NotImplemented");
|
|
19
|
+
exports.NotImplemented = NotImplemented_1.default;
|
|
20
|
+
const Override_1 = require("./annotation/property/Override");
|
|
21
|
+
exports.Override = Override_1.default;
|
|
22
|
+
const Readonly_1 = require("./annotation/property/Readonly");
|
|
23
|
+
exports.Readonly = Readonly_1.default;
|
|
24
|
+
const ComponentScan_1 = require("./annotation/scan/ComponentScan");
|
|
25
|
+
exports.ComponentScan = ComponentScan_1.default;
|
|
26
|
+
const ComponentScanExclusion_1 = require("./annotation/scan/ComponentScanExclusion");
|
|
27
|
+
exports.ComponentScanExclusion = ComponentScanExclusion_1.default;
|
|
28
|
+
const Component_1 = require("./annotation/stereotype/Component");
|
|
29
|
+
exports.Component = Component_1.default;
|
|
30
|
+
const Configure_1 = require("./annotation/stereotype/Configure");
|
|
31
|
+
exports.Configure = Configure_1.default;
|
|
32
|
+
const Controller_1 = require("./annotation/stereotype/Controller");
|
|
33
|
+
exports.Controller = Controller_1.default;
|
|
34
|
+
const Injection_1 = require("./annotation/stereotype/Injection");
|
|
35
|
+
exports.Injection = Injection_1.default;
|
|
36
|
+
const Service_1 = require("./annotation/stereotype/Service");
|
|
37
|
+
exports.Service = Service_1.default;
|
|
38
|
+
const Repository_1 = require("./annotation/stereotype/Repository");
|
|
39
|
+
exports.Repository = Repository_1.default;
|
|
40
|
+
const AddRequireModule_1 = require("./annotation/bind/AddRequireModule");
|
|
41
|
+
exports.AddRequireModule = AddRequireModule_1.default;
|
|
42
|
+
const DS_1 = require("./annotation/data/DS");
|
|
43
|
+
exports.DS = DS_1.default;
|
|
44
|
+
const DSIndex_1 = require("./annotation/data/DSIndex");
|
|
45
|
+
exports.DSIndex = DSIndex_1.default;
|
|
46
|
+
const AddChildValid_1 = require("./annotation/valid/AddChildValid");
|
|
47
|
+
exports.AddChildValid = AddChildValid_1.default;
|
|
48
|
+
const DefaultVal_1 = require("./annotation/valid/DefaultVal");
|
|
49
|
+
exports.DefaultVal = DefaultVal_1.default;
|
|
50
|
+
const NotNull_1 = require("./annotation/valid/NotNull");
|
|
51
|
+
exports.NotNull = NotNull_1.default;
|
|
52
|
+
const Size_1 = require("./annotation/valid/Size");
|
|
53
|
+
exports.Size = Size_1.default;
|
|
54
|
+
const Type_1 = require("./annotation/valid/Type");
|
|
55
|
+
exports.Type = Type_1.default;
|
|
56
|
+
const ValidCustom_1 = require("./annotation/valid/ValidCustom");
|
|
57
|
+
exports.ValidCustom = ValidCustom_1.default;
|
|
58
|
+
const ValidForm_1 = require("./annotation/valid/ValidForm");
|
|
59
|
+
exports.ValidForm = ValidForm_1.default;
|
|
60
|
+
const Rule_1 = require("./annotation/valid/Rule");
|
|
61
|
+
Object.defineProperty(exports, "Rule", { enumerable: true, get: function () { return Rule_1.Rule; } });
|
|
62
|
+
const BeanName_1 = require("./annotation/stereotype/BeanName");
|
|
63
|
+
exports.BeanName = BeanName_1.default;
|
|
64
|
+
const ComponentInjection_1 = require("./annotation/scan/ComponentInjection");
|
|
65
|
+
exports.ComponentInjection = ComponentInjection_1.default;
|
|
66
|
+
const DBType_1 = require("./annotation/data/DBType");
|
|
67
|
+
exports.DBType = DBType_1.default;
|
|
68
|
+
const Field_1 = require("./annotation/data/Field");
|
|
69
|
+
exports.Field = Field_1.default;
|
|
70
|
+
const PrimaryKey_1 = require("./annotation/data/PrimaryKey");
|
|
71
|
+
exports.PrimaryKey = PrimaryKey_1.default;
|
|
72
|
+
const Table_1 = require("./annotation/data/Table");
|
|
73
|
+
exports.Table = Table_1.default;
|
|
74
|
+
const Entity_1 = require("./annotation/data/Entity");
|
|
75
|
+
exports.Entity = Entity_1.default;
|
|
76
|
+
const SqlSession_1 = require("./annotation/data/SqlSession");
|
|
77
|
+
exports.SqlSession = SqlSession_1.default;
|
|
78
|
+
const Transactional_1 = require("./annotation/data/Transactional");
|
|
79
|
+
exports.Transactional = Transactional_1.default;
|
|
80
|
+
const Log_1 = require("./annotation/stereotype/Log");
|
|
81
|
+
exports.Log = Log_1.default;
|
|
82
|
+
const BaseFilePath_1 = require("./annotation/env/BaseFilePath");
|
|
83
|
+
exports.BaseFilePath = BaseFilePath_1.default;
|
|
84
|
+
const BasePath_1 = require("./annotation/env/BasePath");
|
|
85
|
+
exports.BasePath = BasePath_1.default;
|
|
86
|
+
const CallDependency_1 = require("./annotation/bind/CallDependency");
|
|
87
|
+
exports.CallDependency = CallDependency_1.default;
|
|
88
|
+
const Hotter_1 = require("./annotation/scan/Hotter");
|
|
89
|
+
exports.Hotter = Hotter_1.default;
|
|
90
|
+
const ApplicationRunner_1 = require("./annotation/lifeCycle/ApplicationRunner");
|
|
91
|
+
exports.ApplicationRunner = ApplicationRunner_1.default;
|
|
92
|
+
const ApplicationInit_1 = require("./annotation/lifeCycle/ApplicationInit");
|
|
93
|
+
exports.ApplicationInit = ApplicationInit_1.default;
|
|
94
|
+
const ApplicationDestory_1 = require("./annotation/lifeCycle/ApplicationDestory");
|
|
95
|
+
exports.ApplicationDestory = ApplicationDestory_1.default;
|
|
96
|
+
const ApplicationSetting_1 = require("./annotation/env/ApplicationSetting");
|
|
97
|
+
exports.ApplicationSetting = ApplicationSetting_1.default;
|
|
98
|
+
const AliasInjection_1 = require("./annotation/bind/AliasInjection");
|
|
99
|
+
exports.AliasInjection = AliasInjection_1.default;
|
|
100
|
+
const ResourcePath_1 = require("./annotation/env/ResourcePath");
|
|
101
|
+
exports.ResourcePath = ResourcePath_1.default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogDefaultConfig = exports.SYSDefaultConfig = void 0;
|
|
4
|
+
exports.SYSDefaultConfig = {
|
|
5
|
+
application: {
|
|
6
|
+
name: "app",
|
|
7
|
+
env: "development",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
},
|
|
10
|
+
settings: new Map(), //自定义配置
|
|
11
|
+
};
|
|
12
|
+
exports.LogDefaultConfig = {
|
|
13
|
+
consoleLevel: "info",
|
|
14
|
+
fileLevel: "info",
|
|
15
|
+
rootPath: __dirname,
|
|
16
|
+
maxsize: 1024 * 1024 * 10,
|
|
17
|
+
maxFiles: 30,
|
|
18
|
+
printConsole: true,
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppStatusEnum = void 0;
|
|
4
|
+
var AppStatusEnum;
|
|
5
|
+
(function (AppStatusEnum) {
|
|
6
|
+
AppStatusEnum["READY"] = "ready";
|
|
7
|
+
AppStatusEnum["RUN"] = "run";
|
|
8
|
+
AppStatusEnum["STOP"] = "stop";
|
|
9
|
+
})(AppStatusEnum = exports.AppStatusEnum || (exports.AppStatusEnum = {}));
|