@fastcar/core 0.2.62 → 0.2.64

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 (234) hide show
  1. package/package.json +1 -1
  2. package/src/FastCarApplication.ts +30 -9
  3. package/src/utils/ValidationUtil.ts +1 -1
  4. package/target/FastCarApplication.js +708 -692
  5. package/target/annotation/Application.js +45 -45
  6. package/target/annotation/ExceptionMonitor.js +16 -16
  7. package/target/annotation/bind/AddRequireModule.js +21 -21
  8. package/target/annotation/bind/AliasInjection.js +23 -23
  9. package/target/annotation/bind/Autowired.js +13 -13
  10. package/target/annotation/bind/CallDependency.js +23 -23
  11. package/target/annotation/data/DBType.js +11 -11
  12. package/target/annotation/data/DS.js +54 -54
  13. package/target/annotation/data/DSIndex.js +9 -9
  14. package/target/annotation/data/Entity.js +10 -10
  15. package/target/annotation/data/Field.js +18 -18
  16. package/target/annotation/data/PrimaryKey.js +9 -9
  17. package/target/annotation/data/SqlSession.js +9 -9
  18. package/target/annotation/data/Table.js +35 -35
  19. package/target/annotation/data/Transactional.js +52 -52
  20. package/target/annotation/env/ApplicationSetting.js +25 -25
  21. package/target/annotation/env/BaseFilePath.js +14 -14
  22. package/target/annotation/env/BaseName.js +9 -9
  23. package/target/annotation/env/BasePath.js +14 -14
  24. package/target/annotation/env/ENV.js +10 -10
  25. package/target/annotation/env/ResourcePath.js +9 -9
  26. package/target/annotation/lifeCycle/AddLifeCycleItem.js +18 -18
  27. package/target/annotation/lifeCycle/ApplicationDestory.js +15 -15
  28. package/target/annotation/lifeCycle/ApplicationInit.js +15 -15
  29. package/target/annotation/lifeCycle/ApplicationRunner.js +7 -7
  30. package/target/annotation/lifeCycle/ApplicationStart.js +24 -24
  31. package/target/annotation/lifeCycle/ApplicationStop.js +20 -20
  32. package/target/annotation/property/Deprecate.js +19 -19
  33. package/target/annotation/property/NotImplemented.js +8 -8
  34. package/target/annotation/property/Override.js +7 -7
  35. package/target/annotation/property/Readonly.js +16 -16
  36. package/target/annotation/scan/ComponentInjection.js +21 -21
  37. package/target/annotation/scan/ComponentScan.js +9 -9
  38. package/target/annotation/scan/ComponentScanExclusion.js +25 -25
  39. package/target/annotation/scan/ComponentScanMust.js +25 -25
  40. package/target/annotation/scan/Hotter.js +8 -8
  41. package/target/annotation/stereotype/BeanName.js +11 -11
  42. package/target/annotation/stereotype/Component.js +8 -8
  43. package/target/annotation/stereotype/Configure.js +14 -14
  44. package/target/annotation/stereotype/Controller.js +9 -9
  45. package/target/annotation/stereotype/Injection.js +12 -12
  46. package/target/annotation/stereotype/Log.js +17 -17
  47. package/target/annotation/stereotype/Repository.js +9 -9
  48. package/target/annotation/stereotype/Service.js +9 -9
  49. package/target/annotation/valid/AddChildValid.js +56 -56
  50. package/target/annotation/valid/CustomType.js +11 -11
  51. package/target/annotation/valid/DefaultVal.js +10 -10
  52. package/target/annotation/valid/NotNull.js +8 -8
  53. package/target/annotation/valid/Rule.js +100 -100
  54. package/target/annotation/valid/Size.js +10 -10
  55. package/target/annotation/valid/Type.js +10 -10
  56. package/target/annotation/valid/ValidCustom.js +17 -17
  57. package/target/annotation/valid/ValidForm.js +133 -133
  58. package/target/annotation.js +108 -108
  59. package/target/config/ApplicationConfig.js +2 -2
  60. package/target/config/SysConfig.js +19 -19
  61. package/target/constant/AppStatusEnum.js +9 -9
  62. package/target/constant/BootPriority.js +11 -11
  63. package/target/constant/CommonConstant.js +18 -18
  64. package/target/constant/ComponentKind.js +11 -11
  65. package/target/constant/DataTypes.js +19 -19
  66. package/target/constant/FastCarMetaData.js +31 -31
  67. package/target/constant/LifeCycleModule.js +9 -9
  68. package/target/db.js +49 -49
  69. package/target/index.js +21 -21
  70. package/target/interface/ApplicationHook.js +2 -2
  71. package/target/interface/ApplicationInterface.js +2 -2
  72. package/target/interface/ApplicationRunnerService.js +2 -2
  73. package/target/interface/DataSourceManager.js +2 -2
  74. package/target/interface/Logger.js +5 -5
  75. package/target/model/BaseMapper.js +98 -98
  76. package/target/model/DataMap.js +87 -87
  77. package/target/model/FormRuleModel.js +2 -2
  78. package/target/model/ValidError.js +5 -5
  79. package/target/model/WinstonLogger.js +96 -96
  80. package/target/type/ComponentDesc.js +2 -2
  81. package/target/type/DesignMeta.js +15 -15
  82. package/target/type/FileHotterDesc.js +2 -2
  83. package/target/type/MapperType.js +2 -2
  84. package/target/type/ProcessType.js +2 -2
  85. package/target/type/SqlError.js +5 -5
  86. package/target/type/WinstonLoggerType.js +9 -9
  87. package/target/utils/ClassLoader.js +65 -65
  88. package/target/utils/ClassUtils.js +35 -35
  89. package/target/utils/CryptoUtil.js +86 -86
  90. package/target/utils/DataFormat.js +88 -88
  91. package/target/utils/DateUtil.js +71 -71
  92. package/target/utils/FileUtil.js +153 -153
  93. package/target/utils/FormatStr.js +14 -14
  94. package/target/utils/IPUtils.js +34 -34
  95. package/target/utils/Id.js +9 -9
  96. package/target/utils/Mix.js +62 -62
  97. package/target/utils/ReflectUtil.js +22 -22
  98. package/target/utils/TypeUtil.js +53 -53
  99. package/target/utils/ValidationUtil.js +123 -123
  100. package/target/utils.js +25 -25
  101. package/test/unit/decorators-test.ts +3 -3
  102. package/test/unit/valid-test.ts +49 -54
  103. package/target/src/FastCarApplication.js +0 -704
  104. package/target/src/annotation/Application.js +0 -45
  105. package/target/src/annotation/ExceptionMonitor.js +0 -16
  106. package/target/src/annotation/bind/AddRequireModule.js +0 -21
  107. package/target/src/annotation/bind/AliasInjection.js +0 -23
  108. package/target/src/annotation/bind/Autowired.js +0 -13
  109. package/target/src/annotation/bind/CallDependency.js +0 -23
  110. package/target/src/annotation/data/DBType.js +0 -11
  111. package/target/src/annotation/data/DS.js +0 -54
  112. package/target/src/annotation/data/DSIndex.js +0 -9
  113. package/target/src/annotation/data/Entity.js +0 -10
  114. package/target/src/annotation/data/Field.js +0 -18
  115. package/target/src/annotation/data/PrimaryKey.js +0 -9
  116. package/target/src/annotation/data/SqlSession.js +0 -9
  117. package/target/src/annotation/data/Table.js +0 -35
  118. package/target/src/annotation/data/Transactional.js +0 -52
  119. package/target/src/annotation/env/ApplicationSetting.js +0 -25
  120. package/target/src/annotation/env/BaseFilePath.js +0 -14
  121. package/target/src/annotation/env/BaseName.js +0 -9
  122. package/target/src/annotation/env/BasePath.js +0 -14
  123. package/target/src/annotation/env/ENV.js +0 -10
  124. package/target/src/annotation/env/ResourcePath.js +0 -9
  125. package/target/src/annotation/lifeCycle/AddLifeCycleItem.js +0 -18
  126. package/target/src/annotation/lifeCycle/ApplicationDestory.js +0 -15
  127. package/target/src/annotation/lifeCycle/ApplicationInit.js +0 -15
  128. package/target/src/annotation/lifeCycle/ApplicationRunner.js +0 -7
  129. package/target/src/annotation/lifeCycle/ApplicationStart.js +0 -24
  130. package/target/src/annotation/lifeCycle/ApplicationStop.js +0 -20
  131. package/target/src/annotation/property/Deprecate.js +0 -19
  132. package/target/src/annotation/property/NotImplemented.js +0 -8
  133. package/target/src/annotation/property/Override.js +0 -7
  134. package/target/src/annotation/property/Readonly.js +0 -16
  135. package/target/src/annotation/scan/ComponentInjection.js +0 -21
  136. package/target/src/annotation/scan/ComponentScan.js +0 -9
  137. package/target/src/annotation/scan/ComponentScanExclusion.js +0 -25
  138. package/target/src/annotation/scan/ComponentScanMust.js +0 -25
  139. package/target/src/annotation/scan/Hotter.js +0 -8
  140. package/target/src/annotation/stereotype/BeanName.js +0 -11
  141. package/target/src/annotation/stereotype/Component.js +0 -8
  142. package/target/src/annotation/stereotype/Configure.js +0 -14
  143. package/target/src/annotation/stereotype/Controller.js +0 -9
  144. package/target/src/annotation/stereotype/Injection.js +0 -12
  145. package/target/src/annotation/stereotype/Log.js +0 -22
  146. package/target/src/annotation/stereotype/Repository.js +0 -9
  147. package/target/src/annotation/stereotype/Service.js +0 -9
  148. package/target/src/annotation/valid/AddChildValid.js +0 -56
  149. package/target/src/annotation/valid/CustomType.js +0 -11
  150. package/target/src/annotation/valid/DefaultVal.js +0 -10
  151. package/target/src/annotation/valid/NotNull.js +0 -8
  152. package/target/src/annotation/valid/Rule.js +0 -100
  153. package/target/src/annotation/valid/Size.js +0 -10
  154. package/target/src/annotation/valid/Type.js +0 -10
  155. package/target/src/annotation/valid/ValidCustom.js +0 -17
  156. package/target/src/annotation/valid/ValidForm.js +0 -133
  157. package/target/src/annotation.js +0 -108
  158. package/target/src/config/ApplicationConfig.js +0 -2
  159. package/target/src/config/SysConfig.js +0 -19
  160. package/target/src/constant/AppStatusEnum.js +0 -9
  161. package/target/src/constant/BootPriority.js +0 -11
  162. package/target/src/constant/CommonConstant.js +0 -18
  163. package/target/src/constant/ComponentKind.js +0 -11
  164. package/target/src/constant/DataTypes.js +0 -19
  165. package/target/src/constant/FastCarMetaData.js +0 -31
  166. package/target/src/constant/LifeCycleModule.js +0 -9
  167. package/target/src/db.js +0 -49
  168. package/target/src/index.js +0 -21
  169. package/target/src/interface/ApplicationHook.js +0 -2
  170. package/target/src/interface/ApplicationInterface.js +0 -2
  171. package/target/src/interface/ApplicationRunnerService.js +0 -2
  172. package/target/src/interface/DataSourceManager.js +0 -2
  173. package/target/src/interface/Logger.js +0 -5
  174. package/target/src/model/BaseMapper.js +0 -103
  175. package/target/src/model/DataMap.js +0 -87
  176. package/target/src/model/FormRuleModel.js +0 -2
  177. package/target/src/model/ValidError.js +0 -5
  178. package/target/src/model/WinstonLogger.js +0 -97
  179. package/target/src/type/ComponentDesc.js +0 -2
  180. package/target/src/type/DesignMeta.js +0 -15
  181. package/target/src/type/FileHotterDesc.js +0 -2
  182. package/target/src/type/MapperType.js +0 -2
  183. package/target/src/type/ProcessType.js +0 -2
  184. package/target/src/type/SqlError.js +0 -5
  185. package/target/src/type/WinstonLoggerType.js +0 -9
  186. package/target/src/utils/ClassLoader.js +0 -65
  187. package/target/src/utils/ClassUtils.js +0 -35
  188. package/target/src/utils/CryptoUtil.js +0 -86
  189. package/target/src/utils/DataFormat.js +0 -88
  190. package/target/src/utils/DateUtil.js +0 -71
  191. package/target/src/utils/FileUtil.js +0 -153
  192. package/target/src/utils/FormatStr.js +0 -14
  193. package/target/src/utils/IPUtils.js +0 -34
  194. package/target/src/utils/Id.js +0 -9
  195. package/target/src/utils/Mix.js +0 -62
  196. package/target/src/utils/ReflectUtil.js +0 -22
  197. package/target/src/utils/TypeUtil.js +0 -53
  198. package/target/src/utils/ValidationUtil.js +0 -118
  199. package/target/src/utils.js +0 -25
  200. package/target/test/example/simple/app-test.js +0 -57
  201. package/target/test/example/simple/app.js +0 -116
  202. package/target/test/example/simple/component/StartRunner.js +0 -19
  203. package/target/test/example/simple/component/StopRunner.js +0 -23
  204. package/target/test/example/simple/config/EnvConfig.js +0 -16
  205. package/target/test/example/simple/config/HelloConfig.js +0 -16
  206. package/target/test/example/simple/config/HotConfig.js +0 -18
  207. package/target/test/example/simple/controller/AliasController.js +0 -17
  208. package/target/test/example/simple/controller/HelloController.js +0 -55
  209. package/target/test/example/simple/controller/NotFoundController.js +0 -36
  210. package/target/test/example/simple/noclude/excludeApp.js +0 -17
  211. package/target/test/example/simple/service/CallService.js +0 -24
  212. package/target/test/example/simple/service/HelloService.js +0 -18
  213. package/target/test/example/simple/service/LogService.js +0 -32
  214. package/target/test/multi/app.js +0 -29
  215. package/target/test/multi/service/aService.js +0 -33
  216. package/target/test/multi/service/bService.js +0 -35
  217. package/target/test/multi/service/cService.js +0 -40
  218. package/target/test/unit/dataMap-test.js +0 -35
  219. package/target/test/unit/decorators-test.js +0 -59
  220. package/target/test/unit/ds-test.js +0 -58
  221. package/target/test/unit/reflectMetadata-test.js +0 -27
  222. package/target/test/unit/valid-test.js +0 -99
  223. package/target/test/unit/winston-test.js +0 -15
  224. package/test/example/logs/fastcar-server.sys.log +0 -3
  225. package/test/example/logs/other-server.app.log +0 -0
  226. package/test/example/logs/other-server.sys.log +0 -0
  227. package/test/example/logs/other-server.sys1.log +0 -0
  228. package/test/example/logs/other-server.sys2.log +0 -0
  229. package/test/example/logs/other-server.sys3.log +0 -6
  230. package/test/example/logs/other-server.sys4.log +0 -0
  231. package/test/example/logs/other-server.sys5.log +0 -0
  232. package/test/example/logs/other-server.sys6.log +0 -2
  233. package/test/logs/logger.log +0 -0
  234. package/test/logs/sys.log +0 -227
@@ -5,7 +5,7 @@ describe("装饰器测试", () => {
5
5
  it("只读装饰器测试", () => {
6
6
  class TestModel {
7
7
  @Readonly
8
- info!: string;
8
+ info: string;
9
9
 
10
10
  @Readonly
11
11
  setInfo(s: string) {
@@ -25,13 +25,13 @@ describe("装饰器测试", () => {
25
25
  class TestModel {
26
26
  @Deprecate("hello is Deprecate")
27
27
  async hello() {
28
- return new Promise((resolve) => {
28
+ return new Promise(resolve => {
29
29
  resolve("hello is Deprecate");
30
30
  });
31
31
  }
32
32
  }
33
33
 
34
- new TestModel().hello().then((res) => {
34
+ new TestModel().hello().then(res => {
35
35
  console.log(res);
36
36
  });
37
37
  });
@@ -7,71 +7,66 @@ import { ValidationUtil } from "../../src/utils";
7
7
 
8
8
  describe("表单校验测试", () => {
9
9
  it("表单单个测试", () => {
10
+ class A {
11
+ //简单类型
12
+ @ValidForm
13
+ test(@Rule() @NotNull a?: string) {
14
+ console.log(a);
15
+ }
16
+ }
17
+ let instance = new A();
18
+ instance.test("");
19
+ });
20
+
21
+ it("表单复合型测试", () => {
22
+ type B = {
23
+ c: string;
24
+ d?: number;
25
+ };
10
26
  class A {
11
27
  //简单类型
12
28
  @ValidForm
13
29
  test(
14
30
  @Rule({
15
- a: { required: true, type: "int" },
31
+ a: { required: true },
32
+ })
33
+ a: string,
34
+ @Rule({
35
+ c: { required: true },
36
+ d: { type: "number", minSize: 1, maxSize: 10 },
16
37
  })
17
- { a }: { a: any }
38
+ b: B
18
39
  ) {
19
- console.log(a);
40
+ console.log(a, b);
20
41
  }
21
42
  }
22
- console.log("");
23
- new A().test({ a: [] });
43
+ let instance = new A();
44
+ instance.test("a", { c: "c", d: 6 }); // 校验通过
45
+ instance.test("a", { c: "c", d: 13 }); //校验失败
24
46
  });
25
47
 
26
- // it("表单复合型测试", () => {
27
- // type B = {
28
- // c: string;
29
- // d?: number;
30
- // };
31
- // class A {
32
- // //简单类型
33
- // @ValidForm
34
- // test(
35
- // @Rule({
36
- // a: { required: true },
37
- // })
38
- // a: string,
39
- // @Rule({
40
- // c: { required: true },
41
- // d: { type: "number", minSize: 1, maxSize: 10 },
42
- // })
43
- // b: B
44
- // ) {
45
- // console.log(a, b);
46
- // }
47
- // }
48
- // let instance = new A();
49
- // instance.test("a", { c: "c", d: 6 }); // 校验通过
50
- // instance.test("a", { c: "c", d: 13 }); //校验失败
51
- // });
52
-
53
- // it("表单类测试", () => {
54
- // class B {
55
- // @NotNull
56
- // c!: string;
48
+ it("表单类测试", () => {
49
+ class B {
50
+ @NotNull
51
+ c!: string;
57
52
 
58
- // @Size({ minSize: 1, maxSize: 10 })
59
- // d?: number;
60
- // }
61
- // class A {
62
- // //简单类型
63
- // @ValidForm
64
- // test(a: string, @Rule() @NotNull b: B) {
65
- // console.log(a, b);
66
- // }
67
- // }
68
- // let instance = new A();
69
- // instance.test("a", { c: "c", d: 13 }); //校验失败
70
- // });
53
+ @Size({ minSize: 1, maxSize: 10 })
54
+ d?: number;
55
+ }
56
+ class A {
57
+ //简单类型
58
+ @ValidForm
59
+ test(a: string, @Rule() @NotNull b: B) {
60
+ console.log(a, b);
61
+ }
62
+ }
63
+ let instance = new A();
64
+ instance.test("a", { c: "c", d: 13 }); //校验失败
65
+ });
71
66
 
72
- // it("测试map是否为空", () => {
73
- // let d = new Map();
74
- // d.set("hello", "world");
75
- // console.log(ValidationUtil.isNotNull(d) == true);
76
- // });
67
+ it("测试map是否为空", () => {
68
+ let d = new Map();
69
+ d.set("hello", "world");
70
+ console.log(ValidationUtil.isNotNull(d) == true);
71
+ });
77
72
  });