@fastcar/core 0.2.62 → 0.2.63

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.
Files changed (233) hide show
  1. package/package.json +1 -1
  2. package/src/FastCarApplication.ts +30 -9
  3. package/target/FastCarApplication.js +708 -692
  4. package/target/annotation/Application.js +45 -45
  5. package/target/annotation/ExceptionMonitor.js +16 -16
  6. package/target/annotation/bind/AddRequireModule.js +21 -21
  7. package/target/annotation/bind/AliasInjection.js +23 -23
  8. package/target/annotation/bind/Autowired.js +13 -13
  9. package/target/annotation/bind/CallDependency.js +23 -23
  10. package/target/annotation/data/DBType.js +11 -11
  11. package/target/annotation/data/DS.js +54 -54
  12. package/target/annotation/data/DSIndex.js +9 -9
  13. package/target/annotation/data/Entity.js +10 -10
  14. package/target/annotation/data/Field.js +18 -18
  15. package/target/annotation/data/PrimaryKey.js +9 -9
  16. package/target/annotation/data/SqlSession.js +9 -9
  17. package/target/annotation/data/Table.js +35 -35
  18. package/target/annotation/data/Transactional.js +52 -52
  19. package/target/annotation/env/ApplicationSetting.js +25 -25
  20. package/target/annotation/env/BaseFilePath.js +14 -14
  21. package/target/annotation/env/BaseName.js +9 -9
  22. package/target/annotation/env/BasePath.js +14 -14
  23. package/target/annotation/env/ENV.js +10 -10
  24. package/target/annotation/env/ResourcePath.js +9 -9
  25. package/target/annotation/lifeCycle/AddLifeCycleItem.js +18 -18
  26. package/target/annotation/lifeCycle/ApplicationDestory.js +15 -15
  27. package/target/annotation/lifeCycle/ApplicationInit.js +15 -15
  28. package/target/annotation/lifeCycle/ApplicationRunner.js +7 -7
  29. package/target/annotation/lifeCycle/ApplicationStart.js +24 -24
  30. package/target/annotation/lifeCycle/ApplicationStop.js +20 -20
  31. package/target/annotation/property/Deprecate.js +19 -19
  32. package/target/annotation/property/NotImplemented.js +8 -8
  33. package/target/annotation/property/Override.js +7 -7
  34. package/target/annotation/property/Readonly.js +16 -16
  35. package/target/annotation/scan/ComponentInjection.js +21 -21
  36. package/target/annotation/scan/ComponentScan.js +9 -9
  37. package/target/annotation/scan/ComponentScanExclusion.js +25 -25
  38. package/target/annotation/scan/ComponentScanMust.js +25 -25
  39. package/target/annotation/scan/Hotter.js +8 -8
  40. package/target/annotation/stereotype/BeanName.js +11 -11
  41. package/target/annotation/stereotype/Component.js +8 -8
  42. package/target/annotation/stereotype/Configure.js +14 -14
  43. package/target/annotation/stereotype/Controller.js +9 -9
  44. package/target/annotation/stereotype/Injection.js +12 -12
  45. package/target/annotation/stereotype/Log.js +17 -17
  46. package/target/annotation/stereotype/Repository.js +9 -9
  47. package/target/annotation/stereotype/Service.js +9 -9
  48. package/target/annotation/valid/AddChildValid.js +56 -56
  49. package/target/annotation/valid/CustomType.js +11 -11
  50. package/target/annotation/valid/DefaultVal.js +10 -10
  51. package/target/annotation/valid/NotNull.js +8 -8
  52. package/target/annotation/valid/Rule.js +100 -100
  53. package/target/annotation/valid/Size.js +10 -10
  54. package/target/annotation/valid/Type.js +10 -10
  55. package/target/annotation/valid/ValidCustom.js +17 -17
  56. package/target/annotation/valid/ValidForm.js +133 -133
  57. package/target/annotation.js +108 -108
  58. package/target/config/ApplicationConfig.js +2 -2
  59. package/target/config/SysConfig.js +19 -19
  60. package/target/constant/AppStatusEnum.js +9 -9
  61. package/target/constant/BootPriority.js +11 -11
  62. package/target/constant/CommonConstant.js +18 -18
  63. package/target/constant/ComponentKind.js +11 -11
  64. package/target/constant/DataTypes.js +19 -19
  65. package/target/constant/FastCarMetaData.js +31 -31
  66. package/target/constant/LifeCycleModule.js +9 -9
  67. package/target/db.js +49 -49
  68. package/target/index.js +21 -21
  69. package/target/interface/ApplicationHook.js +2 -2
  70. package/target/interface/ApplicationInterface.js +2 -2
  71. package/target/interface/ApplicationRunnerService.js +2 -2
  72. package/target/interface/DataSourceManager.js +2 -2
  73. package/target/interface/Logger.js +5 -5
  74. package/target/model/BaseMapper.js +98 -98
  75. package/target/model/DataMap.js +87 -87
  76. package/target/model/FormRuleModel.js +2 -2
  77. package/target/model/ValidError.js +5 -5
  78. package/target/model/WinstonLogger.js +96 -96
  79. package/target/type/ComponentDesc.js +2 -2
  80. package/target/type/DesignMeta.js +15 -15
  81. package/target/type/FileHotterDesc.js +2 -2
  82. package/target/type/MapperType.js +2 -2
  83. package/target/type/ProcessType.js +2 -2
  84. package/target/type/SqlError.js +5 -5
  85. package/target/type/WinstonLoggerType.js +9 -9
  86. package/target/utils/ClassLoader.js +65 -65
  87. package/target/utils/ClassUtils.js +35 -35
  88. package/target/utils/CryptoUtil.js +86 -86
  89. package/target/utils/DataFormat.js +88 -88
  90. package/target/utils/DateUtil.js +71 -71
  91. package/target/utils/FileUtil.js +153 -153
  92. package/target/utils/FormatStr.js +14 -14
  93. package/target/utils/IPUtils.js +34 -34
  94. package/target/utils/Id.js +9 -9
  95. package/target/utils/Mix.js +62 -62
  96. package/target/utils/ReflectUtil.js +22 -22
  97. package/target/utils/TypeUtil.js +53 -53
  98. package/target/utils/ValidationUtil.js +123 -123
  99. package/target/utils.js +25 -25
  100. package/test/unit/decorators-test.ts +3 -3
  101. package/test/unit/valid-test.ts +49 -54
  102. package/target/src/FastCarApplication.js +0 -704
  103. package/target/src/annotation/Application.js +0 -45
  104. package/target/src/annotation/ExceptionMonitor.js +0 -16
  105. package/target/src/annotation/bind/AddRequireModule.js +0 -21
  106. package/target/src/annotation/bind/AliasInjection.js +0 -23
  107. package/target/src/annotation/bind/Autowired.js +0 -13
  108. package/target/src/annotation/bind/CallDependency.js +0 -23
  109. package/target/src/annotation/data/DBType.js +0 -11
  110. package/target/src/annotation/data/DS.js +0 -54
  111. package/target/src/annotation/data/DSIndex.js +0 -9
  112. package/target/src/annotation/data/Entity.js +0 -10
  113. package/target/src/annotation/data/Field.js +0 -18
  114. package/target/src/annotation/data/PrimaryKey.js +0 -9
  115. package/target/src/annotation/data/SqlSession.js +0 -9
  116. package/target/src/annotation/data/Table.js +0 -35
  117. package/target/src/annotation/data/Transactional.js +0 -52
  118. package/target/src/annotation/env/ApplicationSetting.js +0 -25
  119. package/target/src/annotation/env/BaseFilePath.js +0 -14
  120. package/target/src/annotation/env/BaseName.js +0 -9
  121. package/target/src/annotation/env/BasePath.js +0 -14
  122. package/target/src/annotation/env/ENV.js +0 -10
  123. package/target/src/annotation/env/ResourcePath.js +0 -9
  124. package/target/src/annotation/lifeCycle/AddLifeCycleItem.js +0 -18
  125. package/target/src/annotation/lifeCycle/ApplicationDestory.js +0 -15
  126. package/target/src/annotation/lifeCycle/ApplicationInit.js +0 -15
  127. package/target/src/annotation/lifeCycle/ApplicationRunner.js +0 -7
  128. package/target/src/annotation/lifeCycle/ApplicationStart.js +0 -24
  129. package/target/src/annotation/lifeCycle/ApplicationStop.js +0 -20
  130. package/target/src/annotation/property/Deprecate.js +0 -19
  131. package/target/src/annotation/property/NotImplemented.js +0 -8
  132. package/target/src/annotation/property/Override.js +0 -7
  133. package/target/src/annotation/property/Readonly.js +0 -16
  134. package/target/src/annotation/scan/ComponentInjection.js +0 -21
  135. package/target/src/annotation/scan/ComponentScan.js +0 -9
  136. package/target/src/annotation/scan/ComponentScanExclusion.js +0 -25
  137. package/target/src/annotation/scan/ComponentScanMust.js +0 -25
  138. package/target/src/annotation/scan/Hotter.js +0 -8
  139. package/target/src/annotation/stereotype/BeanName.js +0 -11
  140. package/target/src/annotation/stereotype/Component.js +0 -8
  141. package/target/src/annotation/stereotype/Configure.js +0 -14
  142. package/target/src/annotation/stereotype/Controller.js +0 -9
  143. package/target/src/annotation/stereotype/Injection.js +0 -12
  144. package/target/src/annotation/stereotype/Log.js +0 -22
  145. package/target/src/annotation/stereotype/Repository.js +0 -9
  146. package/target/src/annotation/stereotype/Service.js +0 -9
  147. package/target/src/annotation/valid/AddChildValid.js +0 -56
  148. package/target/src/annotation/valid/CustomType.js +0 -11
  149. package/target/src/annotation/valid/DefaultVal.js +0 -10
  150. package/target/src/annotation/valid/NotNull.js +0 -8
  151. package/target/src/annotation/valid/Rule.js +0 -100
  152. package/target/src/annotation/valid/Size.js +0 -10
  153. package/target/src/annotation/valid/Type.js +0 -10
  154. package/target/src/annotation/valid/ValidCustom.js +0 -17
  155. package/target/src/annotation/valid/ValidForm.js +0 -133
  156. package/target/src/annotation.js +0 -108
  157. package/target/src/config/ApplicationConfig.js +0 -2
  158. package/target/src/config/SysConfig.js +0 -19
  159. package/target/src/constant/AppStatusEnum.js +0 -9
  160. package/target/src/constant/BootPriority.js +0 -11
  161. package/target/src/constant/CommonConstant.js +0 -18
  162. package/target/src/constant/ComponentKind.js +0 -11
  163. package/target/src/constant/DataTypes.js +0 -19
  164. package/target/src/constant/FastCarMetaData.js +0 -31
  165. package/target/src/constant/LifeCycleModule.js +0 -9
  166. package/target/src/db.js +0 -49
  167. package/target/src/index.js +0 -21
  168. package/target/src/interface/ApplicationHook.js +0 -2
  169. package/target/src/interface/ApplicationInterface.js +0 -2
  170. package/target/src/interface/ApplicationRunnerService.js +0 -2
  171. package/target/src/interface/DataSourceManager.js +0 -2
  172. package/target/src/interface/Logger.js +0 -5
  173. package/target/src/model/BaseMapper.js +0 -103
  174. package/target/src/model/DataMap.js +0 -87
  175. package/target/src/model/FormRuleModel.js +0 -2
  176. package/target/src/model/ValidError.js +0 -5
  177. package/target/src/model/WinstonLogger.js +0 -97
  178. package/target/src/type/ComponentDesc.js +0 -2
  179. package/target/src/type/DesignMeta.js +0 -15
  180. package/target/src/type/FileHotterDesc.js +0 -2
  181. package/target/src/type/MapperType.js +0 -2
  182. package/target/src/type/ProcessType.js +0 -2
  183. package/target/src/type/SqlError.js +0 -5
  184. package/target/src/type/WinstonLoggerType.js +0 -9
  185. package/target/src/utils/ClassLoader.js +0 -65
  186. package/target/src/utils/ClassUtils.js +0 -35
  187. package/target/src/utils/CryptoUtil.js +0 -86
  188. package/target/src/utils/DataFormat.js +0 -88
  189. package/target/src/utils/DateUtil.js +0 -71
  190. package/target/src/utils/FileUtil.js +0 -153
  191. package/target/src/utils/FormatStr.js +0 -14
  192. package/target/src/utils/IPUtils.js +0 -34
  193. package/target/src/utils/Id.js +0 -9
  194. package/target/src/utils/Mix.js +0 -62
  195. package/target/src/utils/ReflectUtil.js +0 -22
  196. package/target/src/utils/TypeUtil.js +0 -53
  197. package/target/src/utils/ValidationUtil.js +0 -118
  198. package/target/src/utils.js +0 -25
  199. package/target/test/example/simple/app-test.js +0 -57
  200. package/target/test/example/simple/app.js +0 -116
  201. package/target/test/example/simple/component/StartRunner.js +0 -19
  202. package/target/test/example/simple/component/StopRunner.js +0 -23
  203. package/target/test/example/simple/config/EnvConfig.js +0 -16
  204. package/target/test/example/simple/config/HelloConfig.js +0 -16
  205. package/target/test/example/simple/config/HotConfig.js +0 -18
  206. package/target/test/example/simple/controller/AliasController.js +0 -17
  207. package/target/test/example/simple/controller/HelloController.js +0 -55
  208. package/target/test/example/simple/controller/NotFoundController.js +0 -36
  209. package/target/test/example/simple/noclude/excludeApp.js +0 -17
  210. package/target/test/example/simple/service/CallService.js +0 -24
  211. package/target/test/example/simple/service/HelloService.js +0 -18
  212. package/target/test/example/simple/service/LogService.js +0 -32
  213. package/target/test/multi/app.js +0 -29
  214. package/target/test/multi/service/aService.js +0 -33
  215. package/target/test/multi/service/bService.js +0 -35
  216. package/target/test/multi/service/cService.js +0 -40
  217. package/target/test/unit/dataMap-test.js +0 -35
  218. package/target/test/unit/decorators-test.js +0 -59
  219. package/target/test/unit/ds-test.js +0 -58
  220. package/target/test/unit/reflectMetadata-test.js +0 -27
  221. package/target/test/unit/valid-test.js +0 -99
  222. package/target/test/unit/winston-test.js +0 -15
  223. package/test/example/logs/fastcar-server.sys.log +0 -3
  224. package/test/example/logs/other-server.app.log +0 -0
  225. package/test/example/logs/other-server.sys.log +0 -0
  226. package/test/example/logs/other-server.sys1.log +0 -0
  227. package/test/example/logs/other-server.sys2.log +0 -0
  228. package/test/example/logs/other-server.sys3.log +0 -6
  229. package/test/example/logs/other-server.sys4.log +0 -0
  230. package/test/example/logs/other-server.sys5.log +0 -0
  231. package/test/example/logs/other-server.sys6.log +0 -2
  232. package/test/logs/logger.log +0 -0
  233. package/test/logs/sys.log +0 -227
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const annotation_1 = require("../../../src/annotation");
13
- const Logger_1 = require("../../../src/interface/Logger");
14
- const bService_1 = require("./bService");
15
- let AService = class AService {
16
- logger;
17
- b;
18
- sayHello() {
19
- this.logger.debug("a---");
20
- }
21
- };
22
- __decorate([
23
- (0, annotation_1.Log)(),
24
- __metadata("design:type", Logger_1.default)
25
- ], AService.prototype, "logger", void 0);
26
- __decorate([
27
- annotation_1.Autowired,
28
- __metadata("design:type", bService_1.default)
29
- ], AService.prototype, "b", void 0);
30
- AService = __decorate([
31
- annotation_1.Service
32
- ], AService);
33
- exports.default = AService;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const annotation_1 = require("../../../src/annotation");
13
- const Logger_1 = require("../../../src/interface/Logger");
14
- const aService_1 = require("./aService");
15
- let BService = class BService {
16
- a;
17
- logger;
18
- sayHello() {
19
- // let aa = this.app.getComponentByTarget(AService);
20
- // aa.sayHello();
21
- this.a.sayHello();
22
- }
23
- };
24
- __decorate([
25
- annotation_1.Autowired,
26
- __metadata("design:type", aService_1.default)
27
- ], BService.prototype, "a", void 0);
28
- __decorate([
29
- (0, annotation_1.Log)(),
30
- __metadata("design:type", Logger_1.default)
31
- ], BService.prototype, "logger", void 0);
32
- BService = __decorate([
33
- annotation_1.Service
34
- ], BService);
35
- exports.default = BService;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const annotation_1 = require("../../../src/annotation");
13
- const Logger_1 = require("../../../src/interface/Logger");
14
- const bService_1 = require("./bService"); //如果a b颠倒则会出现 b调用a时无法找到依赖情况
15
- const aService_1 = require("./aService");
16
- let CService = class CService {
17
- logger;
18
- a;
19
- b;
20
- test() {
21
- this.a.sayHello();
22
- this.b.sayHello();
23
- }
24
- };
25
- __decorate([
26
- (0, annotation_1.Log)(),
27
- __metadata("design:type", Logger_1.default)
28
- ], CService.prototype, "logger", void 0);
29
- __decorate([
30
- annotation_1.Autowired,
31
- __metadata("design:type", aService_1.default)
32
- ], CService.prototype, "a", void 0);
33
- __decorate([
34
- annotation_1.Autowired,
35
- __metadata("design:type", bService_1.default)
36
- ], CService.prototype, "b", void 0);
37
- CService = __decorate([
38
- annotation_1.Service
39
- ], CService);
40
- exports.default = CService;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const DataMap_1 = require("../../src/model/DataMap");
4
- describe("数据集合测试", () => {
5
- it("数据集合", () => {
6
- let n = new DataMap_1.default();
7
- n.set(1, {
8
- uid: 1,
9
- name: "小明",
10
- });
11
- n.set(2, {
12
- uid: 2,
13
- name: "小王",
14
- desc: {
15
- detail: "住在隔壁",
16
- },
17
- });
18
- let xiaoming = n.get(1);
19
- console.log(xiaoming?.name == "小明");
20
- let oo = n.toObject();
21
- console.log(oo[1]);
22
- let searchList = n.findByAtts({ uid: 1 });
23
- console.log(searchList);
24
- //复合型查询
25
- let searchList2 = n.findByAtts({ "desc.detail": "住在隔壁" });
26
- console.log(searchList2);
27
- let sortList = n.sort([
28
- {
29
- field: "uid",
30
- order: true, //true为倒序
31
- },
32
- ]);
33
- console.log(sortList);
34
- });
35
- });
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const Deprecate_1 = require("../../src/annotation/property/Deprecate");
13
- const Readonly_1 = require("../../src/annotation/property/Readonly");
14
- describe("装饰器测试", () => {
15
- it("只读装饰器测试", () => {
16
- class TestModel {
17
- info;
18
- setInfo(s) {
19
- Reflect.defineProperty(this, "entree", {
20
- value: s,
21
- });
22
- }
23
- }
24
- __decorate([
25
- Readonly_1.default,
26
- __metadata("design:type", String)
27
- ], TestModel.prototype, "info", void 0);
28
- __decorate([
29
- Readonly_1.default,
30
- __metadata("design:type", Function),
31
- __metadata("design:paramtypes", [String]),
32
- __metadata("design:returntype", void 0)
33
- ], TestModel.prototype, "setInfo", null);
34
- var m = new TestModel();
35
- m.setInfo("111");
36
- m.setInfo = () => { };
37
- });
38
- it("弃用装饰器测试", () => {
39
- let TestModel = class TestModel {
40
- async hello() {
41
- return new Promise((resolve) => {
42
- resolve("hello is Deprecate");
43
- });
44
- }
45
- };
46
- __decorate([
47
- (0, Deprecate_1.default)("hello is Deprecate"),
48
- __metadata("design:type", Function),
49
- __metadata("design:paramtypes", []),
50
- __metadata("design:returntype", Promise)
51
- ], TestModel.prototype, "hello", null);
52
- TestModel = __decorate([
53
- (0, Deprecate_1.default)()
54
- ], TestModel);
55
- new TestModel().hello().then((res) => {
56
- console.log(res);
57
- });
58
- });
59
- });
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const DS_1 = require("../../src/annotation/data/DS");
16
- const DSIndex_1 = require("../../src/annotation/data/DSIndex");
17
- describe("数据源测试", () => {
18
- it("数据源类加载", () => {
19
- let A = class A {
20
- test(zs) {
21
- console.log(zs);
22
- }
23
- };
24
- __decorate([
25
- (0, DS_1.default)("bb"),
26
- __param(0, DSIndex_1.default),
27
- __metadata("design:type", Function),
28
- __metadata("design:paramtypes", [String]),
29
- __metadata("design:returntype", void 0)
30
- ], A.prototype, "test", null);
31
- A = __decorate([
32
- (0, DS_1.default)("aa")
33
- ], A);
34
- let testA = new A();
35
- testA.test();
36
- });
37
- it("数据源继承加载影响", () => {
38
- class A {
39
- test(zs) {
40
- console.log(zs);
41
- }
42
- }
43
- __decorate([
44
- __param(0, DSIndex_1.default),
45
- __metadata("design:type", Function),
46
- __metadata("design:paramtypes", [String]),
47
- __metadata("design:returntype", void 0)
48
- ], A.prototype, "test", null);
49
- let B = class B extends A {
50
- test2() { }
51
- };
52
- B = __decorate([
53
- (0, DS_1.default)("cc")
54
- ], B);
55
- let testB = new B();
56
- testB.test();
57
- });
58
- });
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- require("reflect-metadata");
13
- class Test {
14
- }
15
- describe("装饰器元数据测试", () => {
16
- it("元数据测试案例", () => {
17
- class A {
18
- hello;
19
- }
20
- __decorate([
21
- Reflect.metadata(undefined, undefined),
22
- __metadata("design:type", Test)
23
- ], A.prototype, "hello", void 0);
24
- let s = Reflect.getMetadata("design:type", A.prototype, "hello");
25
- console.log();
26
- });
27
- });
@@ -1,99 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- require("reflect-metadata");
16
- const ValidForm_1 = require("../../src/annotation/valid/ValidForm");
17
- const NotNull_1 = require("../../src/annotation/valid/NotNull");
18
- const Size_1 = require("../../src/annotation/valid/Size");
19
- const Rule_1 = require("../../src/annotation/valid/Rule");
20
- const utils_1 = require("../../src/utils");
21
- describe("表单校验测试", () => {
22
- it("表单单个测试", () => {
23
- class A {
24
- //简单类型
25
- test(a) {
26
- console.log(a);
27
- }
28
- }
29
- __decorate([
30
- ValidForm_1.default,
31
- __param(0, (0, Rule_1.Rule)()),
32
- __param(0, NotNull_1.default),
33
- __metadata("design:type", Function),
34
- __metadata("design:paramtypes", [String]),
35
- __metadata("design:returntype", void 0)
36
- ], A.prototype, "test", null);
37
- let instance = new A();
38
- instance.test("");
39
- });
40
- it("表单复合型测试", () => {
41
- class A {
42
- //简单类型
43
- test(a, b) {
44
- console.log(a, b);
45
- }
46
- }
47
- __decorate([
48
- ValidForm_1.default,
49
- __param(0, (0, Rule_1.Rule)({
50
- a: { required: true },
51
- })),
52
- __param(1, (0, Rule_1.Rule)({
53
- c: { required: true },
54
- d: { type: "number", minSize: 1, maxSize: 10 },
55
- })),
56
- __metadata("design:type", Function),
57
- __metadata("design:paramtypes", [String, Object]),
58
- __metadata("design:returntype", void 0)
59
- ], A.prototype, "test", null);
60
- let instance = new A();
61
- instance.test("a", { c: "c", d: 6 }); // 校验通过
62
- instance.test("a", { c: "c", d: 13 }); //校验失败
63
- });
64
- it("表单类测试", () => {
65
- class B {
66
- c;
67
- d;
68
- }
69
- __decorate([
70
- NotNull_1.default,
71
- __metadata("design:type", String)
72
- ], B.prototype, "c", void 0);
73
- __decorate([
74
- (0, Size_1.default)({ minSize: 1, maxSize: 10 }),
75
- __metadata("design:type", Number)
76
- ], B.prototype, "d", void 0);
77
- class A {
78
- //简单类型
79
- test(a, b) {
80
- console.log(a, b);
81
- }
82
- }
83
- __decorate([
84
- ValidForm_1.default,
85
- __param(1, (0, Rule_1.Rule)()),
86
- __param(1, NotNull_1.default),
87
- __metadata("design:type", Function),
88
- __metadata("design:paramtypes", [String, B]),
89
- __metadata("design:returntype", void 0)
90
- ], A.prototype, "test", null);
91
- let instance = new A();
92
- instance.test("a", { c: "c", d: 13 }); //校验失败
93
- });
94
- it("测试map是否为空", () => {
95
- let d = new Map();
96
- d.set("hello", "world");
97
- console.log(utils_1.ValidationUtil.isNotNull(d) == true);
98
- });
99
- });
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const WinstonLogger_1 = require("../../src/model/WinstonLogger");
4
- let factoryLogger = new WinstonLogger_1.default({
5
- consoleLevel: "info",
6
- fileLevel: "info",
7
- rootPath: __dirname,
8
- maxsize: 1024,
9
- maxFiles: 5,
10
- printConsole: true,
11
- });
12
- let sys = factoryLogger.addLogger("sys");
13
- sys.info({ hello: "world" });
14
- sys.info("1", "2", "3");
15
- sys.error(new Error("error ~"));
@@ -1,3 +0,0 @@
1
- {"timestamp":"2023-12-12 17:19:09.403","level":"INFO","label":"fastcar-server.sys","message":"Start scanning component"}
2
- {"timestamp":"2023-12-12 17:27:52.139","level":"INFO","label":"fastcar-server.sys","message":"Start scanning component"}
3
- {"timestamp":"2023-12-12 17:30:11.153","level":"INFO","label":"fastcar-server.sys","message":"Start scanning component"}
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +0,0 @@
1
- {"timestamp":"2023-12-12 17:28:02.565","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
2
- {"timestamp":"2023-12-12 17:28:02.568","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
3
- {"timestamp":"2023-12-12 17:28:15.591","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
4
- {"timestamp":"2023-12-12 17:28:15.595","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
5
- {"timestamp":"2023-12-12 17:29:27.969","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
6
- {"timestamp":"2023-12-12 17:29:50.728","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
File without changes
File without changes
@@ -1,2 +0,0 @@
1
- {"timestamp":"2023-12-12 17:30:21.379","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
2
- {"timestamp":"2023-12-12 17:30:21.382","level":"INFO","label":"other-server.sys","message":"hot update---D:\\code\\fast-car\\fast-car\\fastcar-core\\test\\example\\simple\\config\\HotConfig.ts"}
File without changes