Ver Fonte

添加表

lrf há 3 anos atrás
pai
commit
b75ac811c4

+ 13 - 0
app/controller/assessment.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./config/.assessment.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+// 价值评估
+class AssessmentController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.assessment;
+  }
+}
+module.exports = CrudController(AssessmentController, meta);

+ 86 - 0
app/controller/config/.assessment.js

@@ -0,0 +1,86 @@
+module.exports = {
+  create: {
+    requestBody: [
+      'user_id',
+      'user_name',
+      'patent_id',
+      'create_number',
+      'name',
+      'inventor',
+      'type',
+      'contact',
+      'phone',
+      'email',
+      'abstract',
+      'field',
+      'explain',
+      'shared_value',
+      'techol_stable',
+      'techol_advanced',
+      'is_money',
+      'status',
+      'file',
+    ],
+  },
+  destroy: {
+    params: ['!id'],
+    service: 'delete',
+  },
+  update: {
+    params: ['!id'],
+    requestBody: [
+      'user_id',
+      'user_name',
+      'patent_id',
+      'create_number',
+      'name',
+      'inventor',
+      'type',
+      'contact',
+      'phone',
+      'email',
+      'abstract',
+      'field',
+      'explain',
+      'shared_value',
+      'techol_stable',
+      'techol_advanced',
+      'is_money',
+      'status',
+      'file',
+    ],
+  },
+  show: {
+    parameters: {
+      params: ['!id'],
+    },
+    service: 'fetch',
+  },
+  index: {
+    parameters: {
+      query: {
+        'meta.createdAt@start': 'meta.createdAt@start',
+        'meta.createdAt@end': 'meta.createdAt@end',
+        user_id: 'user_id',
+        user_name: 'user_name',
+        create_number: 'create_number',
+        name: 'name',
+        type: 'type',
+        phone: 'phone',
+        email: 'email',
+        is_money: 'is_money',
+        status: 'status',
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: 'query',
+    options: {
+      query: ['skip', 'limit'],
+      sort: ['meta.createdAt'],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 43 - 0
app/controller/config/.early.js

@@ -0,0 +1,43 @@
+module.exports = {
+  create: {
+    requestBody: ['patent_id', 'name', 'inventor', 'lose_date', 'content', 'num', 'receive_id', 'receive_name'],
+  },
+  destroy: {
+    params: ['!id'],
+    service: 'delete',
+  },
+  update: {
+    params: ['!id'],
+    requestBody: ['patent_id', 'name', 'inventor', 'lose_date', 'content', 'num', 'receive_id', 'receive_name'],
+  },
+  show: {
+    parameters: {
+      params: ['!id'],
+    },
+    service: 'fetch',
+  },
+  index: {
+    parameters: {
+      query: {
+        'meta.createdAt@start': 'meta.createdAt@start',
+        'meta.createdAt@end': 'meta.createdAt@end',
+        patent_id: 'patent_id',
+        name: 'name',
+        lose_date: 'lose_date',
+        num: 'num',
+        receive_id: 'receive_id',
+        receive_name: 'receive_name',
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: 'query',
+    options: {
+      query: ['skip', 'limit'],
+      sort: ['meta.createdAt'],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 79 - 0
app/controller/config/.safe.js

@@ -0,0 +1,79 @@
+module.exports = {
+  create: {
+    requestBody: [
+      'user_id',
+      'user_name',
+      'patent_id',
+      'create_number',
+      'name',
+      'apply_personal',
+      'type',
+      'inventor',
+      'contact',
+      'phone',
+      'email',
+      'appeal',
+      'fact',
+      'questions',
+      'status',
+      'file',
+    ],
+  },
+  destroy: {
+    params: ['!id'],
+    service: 'delete',
+  },
+  update: {
+    params: ['!id'],
+    requestBody: [
+      'user_id',
+      'user_name',
+      'patent_id',
+      'create_number',
+      'name',
+      'apply_personal',
+      'type',
+      'inventor',
+      'contact',
+      'phone',
+      'email',
+      'appeal',
+      'fact',
+      'questions',
+      'status',
+      'file',
+    ],
+  },
+  show: {
+    parameters: {
+      params: ['!id'],
+    },
+    service: 'fetch',
+  },
+  index: {
+    parameters: {
+      query: {
+        'meta.createdAt@start': 'meta.createdAt@start',
+        'meta.createdAt@end': 'meta.createdAt@end',
+        user_id: 'user_id',
+        user_name: 'user_name',
+        patent_id: 'patent_id',
+        create_number: 'create_number',
+        name: 'name',
+        type: 'type',
+        contact: 'contact',
+        phone: 'phone',
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: 'query',
+    options: {
+      query: ['skip', 'limit'],
+      sort: ['meta.createdAt'],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 89 - 0
app/controller/config/.trans.js

@@ -0,0 +1,89 @@
+module.exports = {
+  create: {
+    requestBody: [
+      'user_id',
+      'user_name',
+      'patent_id',
+      'name',
+      'create_number',
+      'on_obligee',
+      'contact',
+      'phone',
+      'email',
+      'money_type',
+      'money_min',
+      'money_max',
+      'type',
+      'is_report',
+      'file',
+      'abstract',
+      'requirementdesc',
+      'expect',
+      'condition',
+      'on_afterobligee',
+      'transfer_date',
+      'contract_type',
+      'contract',
+      'contract_file',
+      'status',
+    ],
+  },
+  destroy: {
+    params: ['!id'],
+    service: 'delete',
+  },
+  update: {
+    params: ['!id'],
+    requestBody: [
+      'user_id',
+      'user_name',
+      'patent_id',
+      'name',
+      'create_number',
+      'on_obligee',
+      'contact',
+      'phone',
+      'email',
+      'money_type',
+      'money_min',
+      'money_max',
+      'type',
+      'is_report',
+      'file',
+      'abstract',
+      'requirementdesc',
+      'expect',
+      'condition',
+      'on_afterobligee',
+      'transfer_date',
+      'contract_type',
+      'contract',
+      'contract_file',
+      'status',
+    ],
+  },
+  show: {
+    parameters: {
+      params: ['!id'],
+    },
+    service: 'fetch',
+  },
+  index: {
+    parameters: {
+      query: {
+        'meta.createdAt@start': 'meta.createdAt@start',
+        'meta.createdAt@end': 'meta.createdAt@end',
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: 'query',
+    options: {
+      query: ['skip', 'limit'],
+      sort: ['meta.createdAt'],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 13 - 0
app/controller/early.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./config/.early.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+// 专利预警
+class EarlyController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.early;
+  }
+}
+module.exports = CrudController(EarlyController, meta);

+ 13 - 0
app/controller/safe.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./config/.safe.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+// 专利维权
+class SafeController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.safe;
+  }
+}
+module.exports = CrudController(SafeController, meta);

+ 13 - 0
app/controller/trans.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./config/.trans.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+// 专利交易
+class TransController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.trans;
+  }
+}
+module.exports = CrudController(TransController, meta);

+ 44 - 0
app/model/assessment.js

@@ -0,0 +1,44 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+
+// 价值评估
+const assessment = {
+  user_id: { type: String, required: false }, // 申请人id
+  user_name: { type: String, required: false }, // 申请人姓名
+  patent_id: { type: String, required: false }, // 专利id
+  create_number: { type: String, required: false }, // 申请号
+  name: { type: String, required: false }, // 专利名称
+  inventor: { type: String, required: false }, // 发明人
+  type: { type: String, required: false }, // 专利类型
+  contact: { type: String, required: false }, // 联系人
+  phone: { type: String, required: false }, // 联系电话
+  email: { type: String, required: false }, // 电子邮箱
+  abstract: { type: String, required: false }, // 摘要
+  field: { type: String, required: false }, // 应用领域
+  explain: { type: String, required: false }, // 技术说明
+  shared_value: { type: String, required: false }, // 合享价值度
+  techol_stable: { type: String, required: false }, // 技术稳定性
+  techol_advanced: { type: String, required: false }, // 技术先进性
+  is_money: { type: String, required: false }, // 是否缴费
+  status: { type: String, required: false }, // 状态,0:待审中,1:审核通过,待发报告文件,-1:审核未通过,2:文件已发,请及时下载
+  file: { type: Array, required: false }, // 报告文件
+};
+const schema = new Schema(assessment, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ 'meta.createdAt': 1 });
+schema.index({ user_id: 1 });
+schema.index({ user_name: 1 });
+schema.index({ create_number: 1 });
+schema.index({ name: 1 });
+schema.index({ type: 1 });
+schema.index({ phone: 1 });
+schema.index({ email: 1 });
+schema.index({ is_money: 1 });
+schema.index({ status: 1 });
+
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Assessment', schema, 'assessment');
+};

+ 30 - 0
app/model/early.js

@@ -0,0 +1,30 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+
+// 专利预警
+const early = {
+  patent_id: { type: String, required: false }, // 专利id
+  name: { type: String, required: false }, // 专利名称
+  inventor: { type: String, required: false }, // 发明人
+  lose_date: { type: String, required: false }, // 截止日期
+  content: { type: String, required: false }, // 预警信息
+  num: { type: String, required: false }, // 预警次数
+  receive_id: { type: String, required: false }, // 接收人id
+  receive_name: { type: String, required: false }, // 接收人姓名
+};
+const schema = new Schema(early, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ 'meta.createdAt': 1 });
+schema.index({ patent_id: 1 });
+schema.index({ name: 1 });
+schema.index({ lose_date: 1 });
+schema.index({ num: 1 });
+schema.index({ receive_id: 1 });
+schema.index({ receive_name: 1 });
+
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Early', schema, 'early');
+};

+ 40 - 0
app/model/safe.js

@@ -0,0 +1,40 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+
+// 专利维权
+const safe = {
+  user_id: { type: String, required: false }, // 申请人id
+  user_name: { type: String, required: false }, // 申请人姓名
+  patent_id: { type: String, required: false }, // 专利id
+  create_number: { type: String, required: false }, // 申请号
+  name: { type: String, required: false }, // 专利名称
+  apply_personal: { type: String, required: false }, // 专利申请人
+  type: { type: String, required: false }, // 专利类型
+  inventor: { type: String, required: false }, // 发明人
+  contact: { type: String, required: false }, // 联系人
+  phone: { type: String, required: false }, // 联系电话
+  email: { type: String, required: false }, // 电子邮箱
+  appeal: { type: String, required: false }, // 诉求
+  fact: { type: String, required: false }, // 侵权事实
+  questions: { type: Object, required: false }, // 其他内容合集
+  status: { type: String, required: false }, // 状态,0:待审中,1:审核通过,待发报告文件,-1:审核未通过,2:文件已发,请及时下载
+  file: { type: Array, required: false }, // 报告文件
+};
+const schema = new Schema(safe, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ 'meta.createdAt': 1 });
+schema.index({ user_id: 1 });
+schema.index({ user_name: 1 });
+schema.index({ patent_id: 1 });
+schema.index({ create_number: 1 });
+schema.index({ name: 1 });
+schema.index({ type: 1 });
+schema.index({ contact: 1 });
+schema.index({ phone: 1 });
+
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Safe', schema, 'safe');
+};

+ 41 - 0
app/model/trans.js

@@ -0,0 +1,41 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+
+// 专利交易
+const trans = {
+  user_id: { type: String, required: false }, // 申请人id
+  user_name: { type: String, required: false }, // 申请人姓名
+  patent_id: { type: String, required: false }, // 专利id
+  name: { type: String, required: false }, // 专利名称
+  create_number: { type: String, required: false }, // 申请号
+  on_obligee: { type: String, required: false }, // 当前权利人(变更前权利人)
+  contact: { type: String, required: false }, // 联系人
+  phone: { type: String, required: false }, // 联系电话
+  email: { type: String, required: false }, // 电子邮箱
+  money_type: { type: String, required: false }, // 价格类型
+  money_min: { type: String, required: false }, // 最小价格
+  money_max: { type: String, required: false }, // 最大价格
+  type: { type: String, required: false }, // 交易类型
+  is_report: { type: Boolean, required: false }, // 是否有评估报告
+  file: { type: Array, required: false }, // 报告文件
+  abstract: { type: String, required: false }, // 摘要
+  requirementdesc: { type: String, required: false }, // 技术说明
+  expect: { type: String, required: false }, // 商业预期
+  condition: { type: String, required: false }, // 合作条件及要求
+  on_afterobligee: { type: String, required: false }, // 变更后专利权人
+  transfer_date: { type: String, required: false }, // 专利权转移日期
+  contract_type: { type: String, required: false }, // 合同类型
+  contract: { type: Object, required: false }, // 线上合同内容
+  contract_file: { type: Array, required: false }, // 线下合同文件
+  status: { type: String, required: false }, // 0:待审中,1:审核通过,-1:审核未通过,2:合同审核中,3:交易合同审核通过,待用户确认,-3:交易合同审核拒绝,4:用户确定,5:交易完成
+};
+const schema = new Schema(trans, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ 'meta.createdAt': 1 });
+
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Trans', schema, 'trans');
+};

+ 4 - 0
app/router.js

@@ -30,4 +30,8 @@ module.exports = app => {
   require('./z_router/apply')(app); // 申请信息
   require('./z_router/applyRecord')(app); // 审核记录
   require('./z_router/analysis')(app); // 查新检索
+  require('./z_router/trans')(app); // 专利交易
+  require('./z_router/early')(app); // 专利预警
+  require('./z_router/safe')(app); // 专利维权
+  require('./z_router/assessment')(app); // 价值评估
 };

+ 15 - 0
app/service/assessment.js

@@ -0,0 +1,15 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const assert = require('assert');
+
+// 价值评估
+class AssessmentService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'assessment');
+    this.model = this.ctx.model.Assessment;
+  }
+}
+
+module.exports = AssessmentService;

+ 15 - 0
app/service/early.js

@@ -0,0 +1,15 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const assert = require('assert');
+
+// 专利预警
+class EarlyService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'early');
+    this.model = this.ctx.model.Early;
+  }
+}
+
+module.exports = EarlyService;

+ 15 - 0
app/service/safe.js

@@ -0,0 +1,15 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const assert = require('assert');
+
+// 专利维权
+class SafeService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'safe');
+    this.model = this.ctx.model.Safe;
+  }
+}
+
+module.exports = SafeService;

+ 15 - 0
app/service/trans.js

@@ -0,0 +1,15 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const assert = require('assert');
+
+// 专利交易
+class TransService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'trans');
+    this.model = this.ctx.model.Trans;
+  }
+}
+
+module.exports = TransService;

+ 29 - 0
app/z_router/assessment.js

@@ -0,0 +1,29 @@
+'use strict';
+// 路由配置
+const rkey = 'assessment';
+const ckey = 'assessment';
+const keyZh = '价值评估';
+const routes = [
+  { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
+  { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
+  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: [ 'password' ], name: `${ckey}Create`, zh: `创建${keyZh}` },
+  { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
+  { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
+];
+
+module.exports = app => {
+  const { router, config } = app;
+  const mwares = app.middleware;
+  console.log(`${keyZh}:  ${rkey}`);
+  for (const route of routes) {
+    const { method, path, controller: ctl, zh } = route;
+    let { middleware = [] } = route;
+    if (!method || !path || !ctl) continue;
+    // 拼全路径
+    const allPath = `${config.routePrefix}/${path}`;
+    // 处理中间件
+    if (middleware.length > 0) middleware = middleware.map(i => mwares[i]({ enable: true }));
+    // 注册路由
+    router[method](zh, allPath, ...middleware, ctl);
+  }
+};

+ 29 - 0
app/z_router/early.js

@@ -0,0 +1,29 @@
+'use strict';
+// 路由配置
+const rkey = 'early';
+const ckey = 'early';
+const keyZh = '专利预警';
+const routes = [
+  { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
+  { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
+  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: [ 'password' ], name: `${ckey}Create`, zh: `创建${keyZh}` },
+  { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
+  { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
+];
+
+module.exports = app => {
+  const { router, config } = app;
+  const mwares = app.middleware;
+  console.log(`${keyZh}:  ${rkey}`);
+  for (const route of routes) {
+    const { method, path, controller: ctl, zh } = route;
+    let { middleware = [] } = route;
+    if (!method || !path || !ctl) continue;
+    // 拼全路径
+    const allPath = `${config.routePrefix}/${path}`;
+    // 处理中间件
+    if (middleware.length > 0) middleware = middleware.map(i => mwares[i]({ enable: true }));
+    // 注册路由
+    router[method](zh, allPath, ...middleware, ctl);
+  }
+};

+ 29 - 0
app/z_router/safe.js

@@ -0,0 +1,29 @@
+'use strict';
+// 路由配置
+const rkey = 'safe';
+const ckey = 'safe';
+const keyZh = '专利维权';
+const routes = [
+  { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
+  { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
+  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: [ 'password' ], name: `${ckey}Create`, zh: `创建${keyZh}` },
+  { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
+  { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
+];
+
+module.exports = app => {
+  const { router, config } = app;
+  const mwares = app.middleware;
+  console.log(`${keyZh}:  ${rkey}`);
+  for (const route of routes) {
+    const { method, path, controller: ctl, zh } = route;
+    let { middleware = [] } = route;
+    if (!method || !path || !ctl) continue;
+    // 拼全路径
+    const allPath = `${config.routePrefix}/${path}`;
+    // 处理中间件
+    if (middleware.length > 0) middleware = middleware.map(i => mwares[i]({ enable: true }));
+    // 注册路由
+    router[method](zh, allPath, ...middleware, ctl);
+  }
+};

+ 29 - 0
app/z_router/trans.js

@@ -0,0 +1,29 @@
+'use strict';
+// 路由配置
+const rkey = 'trans';
+const ckey = 'trans';
+const keyZh = '专利交易';
+const routes = [
+  { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
+  { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
+  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: [ 'password' ], name: `${ckey}Create`, zh: `创建${keyZh}` },
+  { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
+  { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
+];
+
+module.exports = app => {
+  const { router, config } = app;
+  const mwares = app.middleware;
+  console.log(`${keyZh}:  ${rkey}`);
+  for (const route of routes) {
+    const { method, path, controller: ctl, zh } = route;
+    let { middleware = [] } = route;
+    if (!method || !path || !ctl) continue;
+    // 拼全路径
+    const allPath = `${config.routePrefix}/${path}`;
+    // 处理中间件
+    if (middleware.length > 0) middleware = middleware.map(i => mwares[i]({ enable: true }));
+    // 注册路由
+    router[method](zh, allPath, ...middleware, ctl);
+  }
+};