浏览代码

feat(connect): 修改model扫描路径

zhangweicheng 4 年之前
父节点
当前提交
d42514d93a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      wise-cost-connect/src/configuration.ts

+ 5 - 1
wise-cost-connect/src/configuration.ts

@@ -19,6 +19,9 @@ export class AutoConfiguration implements ILifeCycle {
   @Config('baseDir')
   baseDir: string;
 
+  @Config('modelPath')
+  modelPath: string;
+
   @Logger()
   logger;
 
@@ -29,7 +32,8 @@ export class AutoConfiguration implements ILifeCycle {
   }
 
   loadModelFile() {
-    const dir = path.join(this.baseDir, 'app/model');
+    const modelPath = this.modelPath ? this.modelPath : 'app/model';
+    const dir = path.join(this.baseDir, modelPath);
     const files: string[] = globby.sync(['**/*.(js|ts)', '!**/*.d.ts'], {
       cwd: dir,
     });