lrf402788946 4 年之前
當前提交
136f18a9a7
共有 100 個文件被更改,包括 3075 次插入0 次删除
  1. 29 0
      .autod.conf.js
  2. 1 0
      .eslintignore
  3. 3 0
      .eslintrc
  4. 42 0
      .github/workflows/nodejs.yml
  5. 14 0
      .gitignore
  6. 12 0
      .travis.yml
  7. 7 0
      README.md
  8. 16 0
      app.js
  9. 45 0
      app/controller/dock/.channel.js
  10. 39 0
      app/controller/dock/.channel_video.js
  11. 38 0
      app/controller/dock/.dock_pw.js
  12. 64 0
      app/controller/dock/.dock_user.js
  13. 80 0
      app/controller/dock/.index.js
  14. 59 0
      app/controller/dock/.interview.js
  15. 85 0
      app/controller/dock/.patent.js
  16. 64 0
      app/controller/dock/.road_show.js
  17. 102 0
      app/controller/dock/.train_live.js
  18. 70 0
      app/controller/dock/.transaction.js
  19. 13 0
      app/controller/dock/channel.js
  20. 13 0
      app/controller/dock/channel_video.js
  21. 13 0
      app/controller/dock/dock_pw.js
  22. 14 0
      app/controller/dock/dock_user.js
  23. 13 0
      app/controller/dock/index.js
  24. 13 0
      app/controller/dock/interview.js
  25. 16 0
      app/controller/dock/patent.js
  26. 13 0
      app/controller/dock/road_show.js
  27. 13 0
      app/controller/dock/train_live.js
  28. 13 0
      app/controller/dock/transaction.js
  29. 16 0
      app/controller/home.js
  30. 50 0
      app/controller/statistics/index.js
  31. 39 0
      app/controller/system/.category.js
  32. 53 0
      app/controller/system/.code.js
  33. 39 0
      app/controller/system/.invite_code.js
  34. 37 0
      app/controller/system/.menu.js
  35. 41 0
      app/controller/system/.notice.js
  36. 60 0
      app/controller/system/.survey.js
  37. 13 0
      app/controller/system/category.js
  38. 13 0
      app/controller/system/code.js
  39. 13 0
      app/controller/system/invite_code.js
  40. 13 0
      app/controller/system/menu.js
  41. 13 0
      app/controller/system/notice.js
  42. 13 0
      app/controller/system/survey.js
  43. 39 0
      app/controller/tecinfo/.column.js
  44. 68 0
      app/controller/tecinfo/.news.js
  45. 57 0
      app/controller/tecinfo/.science.js
  46. 13 0
      app/controller/tecinfo/column.js
  47. 13 0
      app/controller/tecinfo/news.js
  48. 13 0
      app/controller/tecinfo/science.js
  49. 78 0
      app/controller/users/.admin.js
  50. 76 0
      app/controller/users/.expert.js
  51. 99 0
      app/controller/users/.organization.js
  52. 99 0
      app/controller/users/.personal.js
  53. 110 0
      app/controller/users/.product.js
  54. 13 0
      app/controller/users/admin.js
  55. 17 0
      app/controller/users/expert.js
  56. 13 0
      app/controller/users/organization.js
  57. 13 0
      app/controller/users/personal.js
  58. 17 0
      app/controller/users/product.js
  59. 33 0
      app/model/admin.js
  60. 19 0
      app/model/category.js
  61. 25 0
      app/model/channel.js
  62. 23 0
      app/model/channel_video.js
  63. 21 0
      app/model/code.js
  64. 19 0
      app/model/column.js
  65. 48 0
      app/model/dock.js
  66. 23 0
      app/model/dock_pw.js
  67. 28 0
      app/model/dock_user.js
  68. 40 0
      app/model/expert.js
  69. 27 0
      app/model/interview.js
  70. 21 0
      app/model/invite_code.js
  71. 20 0
      app/model/menu.js
  72. 36 0
      app/model/news.js
  73. 27 0
      app/model/notice.js
  74. 46 0
      app/model/organization.js
  75. 30 0
      app/model/patent.js
  76. 34 0
      app/model/personal.js
  77. 69 0
      app/model/product.js
  78. 31 0
      app/model/road_show.js
  79. 24 0
      app/model/science.js
  80. 30 0
      app/model/survey.js
  81. 46 0
      app/model/train_live.js
  82. 39 0
      app/model/transaction.js
  83. 37 0
      app/router.js
  84. 13 0
      app/router/dock/channel.js
  85. 12 0
      app/router/dock/channel_video.js
  86. 12 0
      app/router/dock/dock_pw.js
  87. 14 0
      app/router/dock/dock_user.js
  88. 14 0
      app/router/dock/index.js
  89. 12 0
      app/router/dock/interview.js
  90. 18 0
      app/router/dock/patent.js
  91. 12 0
      app/router/dock/road_show.js
  92. 27 0
      app/router/dock/train_live.js
  93. 13 0
      app/router/dock/transaction.js
  94. 15 0
      app/router/statistics/index.js
  95. 12 0
      app/router/system/category.js
  96. 14 0
      app/router/system/code.js
  97. 12 0
      app/router/system/invite_code.js
  98. 12 0
      app/router/system/menu.js
  99. 12 0
      app/router/system/notice.js
  100. 0 0
      app/router/system/survey.js

+ 29 - 0
.autod.conf.js

@@ -0,0 +1,29 @@
+'use strict';
+
+module.exports = {
+  write: true,
+  prefix: '^',
+  plugin: 'autod-egg',
+  test: [
+    'test',
+    'benchmark',
+  ],
+  dep: [
+    'egg',
+    'egg-scripts',
+  ],
+  devdep: [
+    'egg-ci',
+    'egg-bin',
+    'egg-mock',
+    'autod',
+    'autod-egg',
+    'eslint',
+    'eslint-config-egg',
+  ],
+  exclude: [
+    './test/fixtures',
+    './dist',
+  ],
+};
+

+ 1 - 0
.eslintignore

@@ -0,0 +1 @@
+coverage

+ 3 - 0
.eslintrc

@@ -0,0 +1,3 @@
+{
+  "extends": "eslint-config-egg"
+}

+ 42 - 0
.github/workflows/nodejs.yml

@@ -0,0 +1,42 @@
+# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
+
+name: Node.js CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+  schedule:
+    - cron: '0 2 * * *'
+
+jobs:
+  build:
+    runs-on: ${{ matrix.os }}
+
+    strategy:
+      fail-fast: false
+      matrix:
+        node-version: [10]
+        os: [ubuntu-latest, windows-latest, macos-latest]
+
+    steps:
+    - name: Checkout Git Source
+      uses: actions/checkout@v2
+
+    - name: Use Node.js ${{ matrix.node-version }}
+      uses: actions/setup-node@v1
+      with:
+        node-version: ${{ matrix.node-version }}
+
+    - name: Install Dependencies
+      run: npm i -g npminstall && npminstall
+
+    - name: Continuous Integration
+      run: npm run ci
+
+    - name: Code Coverage
+      uses: codecov/codecov-action@v1
+      with:
+        token: ${{ secrets.CODECOV_TOKEN }}

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+logs/
+npm-debug.log
+yarn-error.log
+node_modules/
+package-lock.json
+yarn.lock
+coverage/
+.idea/
+run/
+.DS_Store
+*.sw*
+*.un~
+typings/
+.nyc_output/

+ 12 - 0
.travis.yml

@@ -0,0 +1,12 @@
+
+language: node_js
+node_js:
+  - '10'
+before_install:
+  - npm i npminstall -g
+install:
+  - npminstall
+script:
+  - npm run ci
+after_script:
+  - npminstall codecov && codecov

+ 7 - 0
README.md

@@ -0,0 +1,7 @@
+# service-live
+
+直播平台服务端重构
+
+# postman
+
+https://documenter.getpostman.com/view/8287131/TVzYhF2t

+ 16 - 0
app.js

@@ -0,0 +1,16 @@
+'use strict';
+class AppBootHook {
+  constructor(app) {
+    this.app = app;
+  }
+
+  async didReady() {
+    // 应用已经启动完毕
+    const ctx = await this.app.createAnonymousContext();
+    // 检查种子
+    await ctx.service.install.index();
+    // await ctx.service.rabbitmq.receiveQueueMsg('user_bind');
+  }
+
+}
+module.exports = AppBootHook;

+ 45 - 0
app/controller/dock/.channel.js

@@ -0,0 +1,45 @@
+module.exports = {
+  create: {
+    requestBody: ["user_id", "title", "origin", "type", "desc"],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: ["user_id", "title", "origin", "type", "desc"],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        user_id:"user_id",
+        room_id:"room_id",
+        type:"type",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  // 登陆
+  login: {
+    requestBody: ["room_id", "passwd"],
+    service: "login",
+  },
+};

+ 39 - 0
app/controller/dock/.channel_video.js

@@ -0,0 +1,39 @@
+module.exports = {
+  create: {
+    requestBody: ["channel_id", "title", "start_time", "end_time", "file_path"],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: ["channel_id", "title", "start_time", "end_time", "file_path"],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        channel_id: "channel_id",
+        title: "title",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 38 - 0
app/controller/dock/.dock_pw.js

@@ -0,0 +1,38 @@
+module.exports = {
+  create: {
+    requestBody: ["!dock_id", "content", "!url", "file_path", "remark"],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: ["dock_id", "content", "url", "file_path", "remark"],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        dock_id: "dock_id",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 64 - 0
app/controller/dock/.dock_user.js

@@ -0,0 +1,64 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "!dock_id",
+      "!user_id",
+      "!user_name",
+      "goodsList",
+      "contact_tel",
+      "apply_time",
+      "status",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "user_id",
+      "user_name",
+      "goodsList",
+      "contact_tel",
+      "apply_time",
+      "status",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        dock_id: "dock_id",
+        status: "status",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  goodsCheck: {
+    params: ["!id"],
+    requestBody: ["!status"],
+    service: "goodsCheck",
+  },
+  userCheck: {
+    params: ["!id"],
+    requestBody: ["!status"],
+    service: "userCheck",
+  },
+};

+ 80 - 0
app/controller/dock/.index.js

@@ -0,0 +1,80 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "!title",
+      "!start_time",
+      "!end_time",
+      "province",
+      "place",
+      "adminuser",
+      "phone",
+      "sponsor",
+      "organizer",
+      "videodata",
+      "vipuser",
+      "desc",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "title",
+      "start_time",
+      "end_time",
+      "province",
+      "place",
+      "adminuser",
+      "phone",
+      "sponsor",
+      "organizer",
+      "videodata",
+      "vipuser",
+      "desc",
+      "status",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        title: "title",
+        room_id: "room_id",
+        status:"status",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["room_id"],
+      desc: true,
+      count: true,
+    },
+  },
+  // 登陆
+  login: {
+    requestBody: ["room_phone", "password"],
+    service: "login",
+  },
+  // vip登陆
+  vipLogin: {
+    params: ["!id"],
+    requestBody: ["room_phone", "password"],
+    service: "vipLogin",
+  }
+};

+ 59 - 0
app/controller/dock/.interview.js

@@ -0,0 +1,59 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "dock_id",
+      "title",
+      "publish_time",
+      "origin",
+      "brief",
+      "picture",
+      "filepath",
+      "content",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "dock_id",
+      "title",
+      "publish_time",
+      "origin",
+      "brief",
+      "picture",
+      "filepath",
+      "content",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        dock_id: "dock_id",
+        title: "%title%",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 85 - 0
app/controller/dock/.patent.js

@@ -0,0 +1,85 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "create_number",
+      "create_date",
+      "success_number",
+      "success_date",
+      "name",
+      "inventor",
+      "address",
+      "apply_personal",
+      "term",
+      "type",
+      "agent_personal",
+      "agent",
+      "abstract",
+      "img_url",
+      "origin",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "create_number",
+      "create_date",
+      "success_number",
+      "success_date",
+      "name",
+      "inventor",
+      "address",
+      "apply_personal",
+      "term",
+      "type",
+      "agent_personal",
+      "agent",
+      "abstract",
+      "img_url",
+      "origin",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        create_number: "create_number",
+        create_date: "create_date",
+        create_number: "create_number",
+        success_date: "success_date",
+        name: "%name%",
+        inventor: "inventor",
+        address: "address",
+        apply_personal: "%apply_personal%",
+        term: "term",
+        type: "type",
+        agent_personal: "agent_personal",
+        agent: "agent",
+        origin: "%origin%",
+      },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  toImport: {
+    requestBody: ["uri", "origin"],
+    service: "toImport",
+  },
+  toExport: {
+    requestBody: ["user"],
+    service: "toExport",
+  },
+};

+ 64 - 0
app/controller/dock/.road_show.js

@@ -0,0 +1,64 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "user_id",
+      "dock_id",
+      "title",
+      "brief",
+      "origin",
+      "publish_time",
+      "content",
+      "picture",
+      "filepath",
+      "remark"
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "user_id",
+      "dock_id",
+      "title",
+      "brief",
+      "origin",
+      "publish_time",
+      "content",
+      "picture",
+      "filepath",
+      "remark"
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        dock_id:"dock_id",
+        title:"%title%",
+        origin:"origin",
+        "publish_time@start":"publish_time@start",
+        "publish_time@end":"publish_time@end",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 102 - 0
app/controller/dock/.train_live.js

@@ -0,0 +1,102 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "title",
+      "province",
+      "place",
+      "sponsor",
+      "brief",
+      "user",
+      "phone",
+      "video_data",
+      "user_data",
+      "start_date",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "title",
+      "province",
+      "place",
+      "sponsor",
+      "brief",
+      "user",
+      "phone",
+      "video_data",
+      "user_data",
+      "start_date",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        title: "title",
+        province: "province",
+        place: "place",
+        sponsor: "sponsor",
+        brief: "brief",
+        user: "user",
+        phone: "phone",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.status": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  userData: {
+    params: ["!id"],
+    service: "userData",
+  },
+  addUser: {
+    params: ["!id"],
+    requestBody: ["users"],
+    service: "addUser",
+  },
+  updateUser: {
+    params: ["!id"],
+    requestBody: ["users"],
+    service: "updateUser",
+  },
+  deleteUser: {
+    params: ["!id"],
+    requestBody: ["users"],
+    service: "deleteUser",
+  },
+  userLogin: {
+    params: ["!id"],
+    requestBody: ["user_phone", "user_password"],
+    service: "userLogin",
+  },
+  userLogout: {
+    params: ["!id"],
+    service: "userLogout",
+  },
+  login: {
+    requestBody: ["room_id", "password"],
+    service: "login",
+  },
+  userLonger: {
+    params: ["!id"],
+    service: "userLonger",
+  },
+};

+ 70 - 0
app/controller/dock/.transaction.js

@@ -0,0 +1,70 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "dock_id",
+      "!supplier",
+      "!s_name",
+      "!s_phone",
+      "!demander",
+      "!d_name",
+      "!d_phone",
+      "!product_id",
+      "!product",
+      "pact",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "dock_id",
+      "!supplier",
+      "!s_name",
+      "!s_phone",
+      "!demander",
+      "!d_name",
+      "!d_phone",
+      "!product_id",
+      "!product",
+      "pact",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        dock_id: "dock_id",
+        supplier: "supplier",
+        demander: "demander",
+        product: "%product%",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  step: {
+    params: ["!id"],
+    requestBody: ["!status", "pact"],
+    service: "step",
+  },
+};

+ 13 - 0
app/controller/dock/channel.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.channel.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 科技频道
+class ChannelController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.channel;
+  }
+}
+module.exports = CrudController(ChannelController, meta);

+ 13 - 0
app/controller/dock/channel_video.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.channel_video.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 科技频道-视频
+class Channel_videoController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.channelVideo;
+  }
+}
+module.exports = CrudController(Channel_videoController, meta);

+ 13 - 0
app/controller/dock/dock_pw.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.dock_pw.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 展会-图文
+class Dock_pwController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.dockPw;
+  }
+}
+module.exports = CrudController(Dock_pwController, meta);

+ 14 - 0
app/controller/dock/dock_user.js

@@ -0,0 +1,14 @@
+'use strict';
+const meta = require('./.dock_user.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 展会-用户
+class Dock_userController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.dockUser;
+  }
+
+}
+module.exports = CrudController(Dock_userController, meta);

+ 13 - 0
app/controller/dock/index.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.index.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 展会
+class IndexController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.index;
+  }
+}
+module.exports = CrudController(IndexController, meta);

+ 13 - 0
app/controller/dock/interview.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.interview.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 嘉宾访谈
+class InterviewController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.interview;
+  }
+}
+module.exports = CrudController(InterviewController, meta);

+ 16 - 0
app/controller/dock/patent.js

@@ -0,0 +1,16 @@
+'use strict';
+
+const _ = require('lodash');
+const meta = require('./.patent.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 专利表
+class PatentController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.patent;
+  }
+}
+
+module.exports = CrudController(PatentController, meta);

+ 13 - 0
app/controller/dock/road_show.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.road_show.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 项目路演
+class Road_showController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.roadShow;
+  }
+}
+module.exports = CrudController(Road_showController, meta);

+ 13 - 0
app/controller/dock/train_live.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.train_live.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 培训问诊
+class Train_liveController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.dock.trainLive;
+  }
+}
+module.exports = CrudController(Train_liveController, meta);

+ 13 - 0
app/controller/dock/transaction.js

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

+ 16 - 0
app/controller/home.js

@@ -0,0 +1,16 @@
+'use strict';
+
+const Controller = require('egg').Controller;
+
+class HomeController extends Controller {
+  async index() {
+    const { ctx } = this;
+    ctx.body = 'hi, egg';
+  }
+  async utilMethod() {
+    const data = await this.ctx.service.util.util.utilMethod(this.ctx.query, this.ctx.request.body);
+    this.ctx.ok({ data });
+  }
+}
+
+module.exports = HomeController;

+ 50 - 0
app/controller/statistics/index.js

@@ -0,0 +1,50 @@
+'use strict';
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 首页-数据动态统计
+class IndexController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.statistics.index;
+  }
+  async index() {
+    const patent = await this.service.patent(this.ctx.query);
+    const product = await this.service.product(this.ctx.query);
+    const expert = await this.service.expert(this.ctx.query);
+    const circle = await this.service.circle(this.ctx.query);
+    this.ctx.ok({ data: { patent, product, expert, circle } });
+  }
+
+  /**
+   * 首页专利统计
+   */
+  async patent() {
+    const data = await this.service.patent(this.ctx.query);
+    this.ctx.ok({ data });
+  }
+
+  /**
+   * 首页成果统计
+   */
+  async product() {
+    const data = await this.service.product(this.ctx.query);
+    this.ctx.ok({ data });
+  }
+
+  /**
+   * 首页成果统计
+   */
+  async expert() {
+    const data = await this.service.expert(this.ctx.query);
+    this.ctx.ok({ data });
+  }
+  /**
+   * 首页数据统计
+   */
+  async circle() {
+    const data = await this.service.circle(this.ctx.query);
+    this.ctx.ok({ data });
+  }
+}
+module.exports = CrudController(IndexController, {});

+ 39 - 0
app/controller/system/.category.js

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

+ 53 - 0
app/controller/system/.code.js

@@ -0,0 +1,53 @@
+module.exports = {
+  create: {
+    requestBody: ["code", "name", "category", "sort"],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: ["code", "name", "category", "sort"],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        code: "code",
+        name: "name",
+        category: "category",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+
+  xzqh: {
+    parameters: {
+      query: {
+        code: "code",
+      },
+    },
+    service: "xzqh",
+  },
+  codeName: {
+    requestBody: ["code"],
+    service: "codeName",
+  },
+};

+ 39 - 0
app/controller/system/.invite_code.js

@@ -0,0 +1,39 @@
+module.exports = {
+  create: {
+    requestBody: [],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        code:"code",
+        user_id:"user_id",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 37 - 0
app/controller/system/.menu.js

@@ -0,0 +1,37 @@
+module.exports = {
+  create: {
+    requestBody: ["title", "index", "sort", "icon"],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: ["title", "index", "sort", "icon"],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["sort"],
+      asc: true,
+      count: true,
+    },
+  },
+};

+ 41 - 0
app/controller/system/.notice.js

@@ -0,0 +1,41 @@
+module.exports = {
+  create: {
+    requestBody: ["title", "source", "content", "isenable", "user_id", "code"],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: ["title", "source", "content", "isenable", "user_id", "code"],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        title: "%title%",
+        source: "%source%",
+        code: "code",
+        user_id: "user_id",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 60 - 0
app/controller/system/.survey.js

@@ -0,0 +1,60 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "!user_id",
+      "resource",
+      "nickname",
+      "name",
+      "phone",
+      "work",
+      "address",
+      "title",
+      "proposal",
+      "remark"
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "!user_id",
+      "resource",
+      "nickname",
+      "name",
+      "phone",
+      "work",
+      "address",
+      "title",
+      "proposal",
+      "remark"
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        user_id:"user_id",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 13 - 0
app/controller/system/category.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.category.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 字典类别
+class CategoryController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.system.category;
+  }
+}
+module.exports = CrudController(CategoryController, meta);

+ 13 - 0
app/controller/system/code.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.code.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 字典表
+class CodeController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.system.code;
+  }
+}
+module.exports = CrudController(CodeController, meta);

+ 13 - 0
app/controller/system/invite_code.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.invite_code.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 邀请码
+class Invite_codeController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.system.inviteCode;
+  }
+}
+module.exports = CrudController(Invite_codeController, meta);

+ 13 - 0
app/controller/system/menu.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.menu.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 菜单
+class MenuController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.system.menu;
+  }
+}
+module.exports = CrudController(MenuController, meta);

+ 13 - 0
app/controller/system/notice.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.notice.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 通知管理
+class NoticeController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.system.notice;
+  }
+}
+module.exports = CrudController(NoticeController, meta);

+ 13 - 0
app/controller/system/survey.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.survey.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 建言献策,网上调查
+class SurveyController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.system.survey;
+  }
+}
+module.exports = CrudController(SurveyController, meta);

+ 39 - 0
app/controller/tecinfo/.column.js

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

+ 68 - 0
app/controller/tecinfo/.news.js

@@ -0,0 +1,68 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "user_id",
+      "column_id",
+      "column_name",
+      "title",
+      "publish_time",
+      "origin",
+      "brief",
+      "picture",
+      "filepath",
+      "video",
+      "content",
+      "type",
+      "remark"
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "user_id",
+      "column_id",
+      "column_name",
+      "title",
+      "publish_time",
+      "origin",
+      "brief",
+      "picture",
+      "video",
+      "filepath",
+      "content",
+      "type",
+      "remark"
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        title:"%title%",
+        type:"type",
+        column_id:"column_id",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 57 - 0
app/controller/tecinfo/.science.js

@@ -0,0 +1,57 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "user_id",
+      "title",
+      "publish_time",
+      "origin",
+      "picture",
+      "filepath",
+      "content",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "user_id",
+      "title",
+      "publish_time",
+      "origin",
+      "picture",
+      "filepath",
+      "content",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        title: "title",
+        origin: "origin",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 13 - 0
app/controller/tecinfo/column.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.column.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 栏目
+class ColumnController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.tecinfo.column;
+  }
+}
+module.exports = CrudController(ColumnController, meta);

+ 13 - 0
app/controller/tecinfo/news.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.news.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 信息
+class NewsController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.tecinfo.news;
+  }
+}
+module.exports = CrudController(NewsController, meta);

+ 13 - 0
app/controller/tecinfo/science.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.science.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 科技新闻
+class ScienceController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.tecinfo.science;
+  }
+}
+module.exports = CrudController(ScienceController, meta);

+ 78 - 0
app/controller/users/.admin.js

@@ -0,0 +1,78 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "!name",
+      "!phone",
+      "!passwd",
+      "openid",
+      "!role",
+      "menus",
+      "!pid",
+      "deptname",
+      "code",
+      "isdel",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "name",
+      "phone",
+      "openid",
+      "role",
+      "menus",
+      "pid",
+      "deptname",
+      "code",
+      "isdel",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        name: "%name%",
+        phone: "phone",
+        role: "role",
+        pid: "pid",
+        deptname: "%deptname%",
+        code: "code",
+        isdel: "isdel",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  //修改密码
+  password: {
+    params: ["!id"],
+    requestBody: ["passwd"],
+    service: "password",
+  },
+  // 登陆
+  login: {
+    requestBody: ["code_phone", "passwd"],
+    service: "login",
+  }
+};

+ 76 - 0
app/controller/users/.expert.js

@@ -0,0 +1,76 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "code",
+      "education",
+      "school",
+      "birthDate",
+      "qqwx",
+      "email",
+      "company",
+      "zwzc",
+      "expertise",
+      "img_path",
+      "workexperience",
+      "scientific",
+      "undertakingproject",
+      "scienceaward",
+      "social",
+      "status",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "education",
+      "school",
+      "birthDate",
+      "qqwx",
+      "email",
+      "company",
+      "zwzc",
+      "expertise",
+      "img_path",
+      "workexperience",
+      "scientific",
+      "undertakingproject",
+      "scienceaward",
+      "social",
+      "status",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!user_id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        name: "%name%",
+        phone: "phone",
+        code: "code",
+        status: "status",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      options: {
+        "isdel": '0' // 默认条件
+      },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 99 - 0
app/controller/users/.organization.js

@@ -0,0 +1,99 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "!name",
+      "!password",
+      "phone",
+      "email",
+      "addr",
+      "code",
+      "office_phone",
+      "profession",
+      'institution_code',
+      'companytype',
+      'companydate',
+      'companycapital',
+      'companyperson',
+      'sndqyzsr',
+      'sndyffy',
+      'companytotal',
+      'zjzyfrs',
+      'companybrief',
+      'mainproduct',
+      'qualifications',
+      'remark',
+      'status',
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "name",
+      "phone",
+      "email",
+      "addr",
+      "code",
+      "office_phone",
+      "profession",
+      'institution_code',
+      'companytype',
+      'companydate',
+      'companycapital',
+      'companyperson',
+      'sndqyzsr',
+      'sndyffy',
+      'companytotal',
+      'zjzyfrs',
+      'companybrief',
+      'mainproduct',
+      'qualifications',
+      'remark',
+      'status'
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        phone:"phone",
+        code:"code",
+        profession:"profession",
+        institution_code:"institution_code",
+        companyperson:"companyperson",
+        status:"status",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      options: {
+        "isdel": '0' // 默认条件
+      },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  //修改密码
+  password: {
+    params: ["!id"],
+    requestBody: ["password"],
+    service: "password",
+  },
+  // 登陆
+  login: {
+    requestBody: ["institution_code", "password"],
+    service: "login",
+  }
+};

+ 99 - 0
app/controller/users/.personal.js

@@ -0,0 +1,99 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "!name",
+      "!password",
+      "!phone",
+      "email",
+      "addr",
+      "office_phone",
+      "profession",
+      "code",
+      "openid",
+      "status",
+      "remark",
+      "create_time",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "name",
+      "phone",
+      "email",
+      "addr",
+      "office_phone",
+      "profession",
+      "code",
+      "openid",
+      "status",
+      "remark",
+      "create_time",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        phone: "phone",
+        code: "code",
+        status: "status",
+        profession: "profession",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      options: {
+        isdel: "0", // 默认条件
+      },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  //修改密码
+  password: {
+    params: ["!id"],
+    requestBody: ["password"],
+    service: "password",
+  },
+  // 登陆
+  login: {
+    requestBody: ["phone", "password"],
+    service: "login",
+  },
+  upgrade: {
+    requestBody: [
+      "education",
+      "school",
+      "birthDate",
+      "qqwx",
+      "email",
+      "company",
+      "zwzc",
+      "expertise",
+      "img_path",
+      "workexperience",
+      "scientific",
+      "undertakingproject",
+      "scienceaward",
+      "social",
+      "status",
+      "remark",
+      "!id",
+    ],
+    service: "upgrade",
+  },
+};

+ 110 - 0
app/controller/users/.product.js

@@ -0,0 +1,110 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "name",
+      "contacts",
+      "phone",
+      "qqwx",
+      "email",
+      "type",
+      "status",
+      "user_id",
+      "field",
+      "cooperation",
+      "company",
+      "condition",
+      "image",
+      "expect",
+      "demand",
+      "budget",
+      "requirementdesc",
+      "present",
+      "achievestatus",
+      "achieveown",
+      "achievesource",
+      "intentionprice",
+      "patent",
+      "roadshow",
+      "achievebrief",
+      "features",
+      "team",
+      "messattribute",
+      "informationdesc",
+      "coreelements",
+      "priceinfo",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "name",
+      "contacts",
+      "phone",
+      "qqwx",
+      "email",
+      "type",
+      "status",
+      "user_id",
+      "field",
+      "cooperation",
+      "company",
+      "condition",
+      "image",
+      "expect",
+      "demand",
+      "budget",
+      "requirementdesc",
+      "present",
+      "achievestatus",
+      "achieveown",
+      "achievesource",
+      "intentionprice",
+      "patent",
+      "roadshow",
+      "achievebrief",
+      "features",
+      "team",
+      "messattribute",
+      "informationdesc",
+      "coreelements",
+      "priceinfo",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        name: "%name%",
+        code:"code",
+        qqwx: "qqwx",
+        type: "type",
+        status: "status",
+        user_id: "user_id",
+        company: "company",
+        "create_time@start": "create_time@start",
+        "create_time@end": "create_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 13 - 0
app/controller/users/admin.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.admin.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 管理员
+class AdminController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.users.admin;
+  }
+}
+module.exports = CrudController(AdminController, meta);

+ 17 - 0
app/controller/users/expert.js

@@ -0,0 +1,17 @@
+'use strict';
+const meta = require('./.expert.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 专家
+class ExpertController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.users.expert;
+  }
+  async index() {
+    const { data, total } = await this.service.query(this.ctx.query);
+    this.ctx.ok({ data, total });
+  }
+}
+module.exports = CrudController(ExpertController, meta);

+ 13 - 0
app/controller/users/organization.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.organization.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 机构
+class OrganizationController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.users.organization;
+  }
+}
+module.exports = CrudController(OrganizationController, meta);

+ 13 - 0
app/controller/users/personal.js

@@ -0,0 +1,13 @@
+'use strict';
+const meta = require('./.personal.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 个人用户
+class PersonalController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.users.personal;
+  }
+}
+module.exports = CrudController(PersonalController, meta);

+ 17 - 0
app/controller/users/product.js

@@ -0,0 +1,17 @@
+'use strict';
+const meta = require('./.product.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
+
+// 产品
+class ProductController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.users.product;
+  }
+  async index() {
+    const { data, total } = await this.service.query(this.ctx.query);
+    this.ctx.ok({ data, total });
+  }
+}
+module.exports = CrudController(ProductController, meta);

+ 33 - 0
app/model/admin.js

@@ -0,0 +1,33 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+
+// 管理员表
+const admin = {
+  name: { type: String }, // 名称
+  phone: { type: String }, // 手机
+  passwd: { type: Secret, select: false }, // 注册密码
+  openid: { type: String }, // 微信openid
+  role: { type: String }, // 角色: 0:超级管理员;1:管理员;2:机构管理员;3:业务管理员
+  menus: { type: [ String ] }, // 菜单
+  pid: { type: String }, // 上级id
+  deptname: { type: String }, // 机构名称
+  code: { type: String }, // 邀请码
+  isdel: { type: Boolean, default: false }, // 是否删除
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(admin, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ name: 1 });
+schema.index({ phone: 1 });
+schema.index({ role: 1 });
+schema.index({ pid: 1 });
+schema.index({ code: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Admin', schema, 'admin');
+};

+ 19 - 0
app/model/category.js

@@ -0,0 +1,19 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+// 字典类别表
+const category = {
+  code: { type: String, required: true, maxLength: 500 }, // 类别code
+  name: { type: String, required: true, maxLength: 500 }, // 名称
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(category, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Category', schema, 'category');
+};

+ 25 - 0
app/model/channel.js

@@ -0,0 +1,25 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 科技频道表
+const channel = {
+  user_id: { type: ObjectId }, // 关联的personal的id
+  title: { type: String, required: false, maxLength: 200 }, // 标题
+  origin: { type: String, required: false, maxLength: 200 }, // 来源
+  type: { type: String, required: false, maxLength: 200 }, // 类别
+  room_id: { type: Number, required: false, maxLength: 200 }, // 房间id,服务生成,从2001开始
+  passwd: { type: Secret, required: false, maxLength: 200, select: false }, // 密码,房间号
+  desc: { type: String, maxLength: 1000 }, // 简介
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(channel, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Channel', schema, 'channel');
+};

+ 23 - 0
app/model/channel_video.js

@@ -0,0 +1,23 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 科技频道-视频表
+const channel_video = {
+  channel_id: { type: ObjectId }, // 关联的personal的id
+  title: { type: String, required: false, maxLength: 200 }, // 标题
+  start_time: { type: String, required: false, maxLength: 200 }, // 开始时间
+  end_time: { type: String, required: false, maxLength: 200 }, // 结束时间
+  file_path: { type: String, required: false, maxLength: 200 }, // 视频路径
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(channel_video, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('ChannelVideo', schema, 'channel_video');
+};

+ 21 - 0
app/model/code.js

@@ -0,0 +1,21 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+// 字典表
+const code = {
+  code: { type: String, required: true, maxLength: 500 }, // code
+  name: { type: String, required: true, maxLength: 500 }, // 名称
+  category: { type: String, required: true, maxLength: 500 }, // 类别code
+  sort: { type: Number, required: false, maxLength: 500 }, // 排序
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(code, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Code', schema, 'code');
+};

+ 19 - 0
app/model/column.js

@@ -0,0 +1,19 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+// 栏目表
+const column = {
+  name: { type: String, required: true, maxLength: 500 }, // 栏目名称
+  site: { type: String, required: false, maxLength: 500 }, // 栏目位置
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(column, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Column', schema, 'column');
+};

+ 48 - 0
app/model/dock.js

@@ -0,0 +1,48 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+// 展会视频表
+const videos = new Schema({
+  file_path: { type: String, required: true }, // 视频路径
+  videointro: { type: String, required: false, maxLength: 200 }, // 视频文件标题
+  videointroinfo: { type: String, required: false, maxLength: 200 }, // 视频文件简介
+});
+// vip用户
+const vipuser = new Schema({
+  vipname: { type: String, required: false, maxLength: 200 }, // 用户名称
+  vipphone: { type: String, required: false, maxLength: 200 }, // 联系人手机
+  email: { type: String, required: false, maxLength: 20 }, // 郵箱
+  content: { type: String, required: false }, // 内容
+  password: { type: Secret, select: false }, // 密码
+});
+
+vipuser.index({ id: 1 });
+// 展会表
+const dock = {
+  room_id: { type: Number, required: true, maxLength: 10 }, // 房间号
+  password: { type: Secret, select: false }, // 密码
+  title: { type: String, required: false, maxLength: 200 }, // 对接会标题
+  start_time: { type: String, required: true, maxLength: 200 }, // 开始时间
+  end_time: { type: String, required: true, maxLength: 200 }, // 结束时间
+  province: { type: String, required: false }, // 省
+  place: { type: String, required: false }, // 市
+  adminuser: { type: String, required: false, maxLength: 200 }, // 负责人
+  phone: { type: String, required: false, maxLength: 200 }, // 负责人电话
+  sponsor: { type: String, required: false, maxLength: 200 }, // 主办方
+  organizer: { type: String, required: false, maxLength: 200 }, // 承办方
+  videodata: { type: [ videos ], select: true }, // 视频路径
+  vipuser: { type: [ vipuser ], default: [] }, // vip用户
+  desc: { type: String, maxLength: 1000 }, // 简介
+  status: { type: String, default: '0' }, // 状态:0准备中;1已开始;2已结束
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(dock, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Dock', schema, 'dock');
+};

+ 23 - 0
app/model/dock_pw.js

@@ -0,0 +1,23 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+
+// 展会-图文表
+const dockpw = {
+  dock_id: { type: ObjectId }, // 展会id
+  content: { type: String, maxLength: 500 }, // 信息内容
+  url: { type: Array }, // 图片路径
+  file_path: { type: String }, // 视频路径
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(dockpw, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Dock_pw', schema, 'dock_pw');
+};

+ 28 - 0
app/model/dock_user.js

@@ -0,0 +1,28 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 展会-用户表
+const dockUser = {
+  dock_id: { type: ObjectId }, // 展会id
+  user_id: { type: ObjectId, required: true }, // 用户id
+  user_name: { type: String, required: true, maxLength: 200 }, // 用户名称
+  goodsList: { type: [ Object ], default: [] }, // 产品列表
+  contact_tel: { type: String, required: false, maxLength: 200 }, // 联系人电话
+  apply_time: { type: String, maxLength: 200 }, // 申请时间
+  // role: { type: String, maxLength: 200 }, // 申请人类型
+  status: { type: String, default: '0', maxLength: 1 }, // 申请状态 (0未审核;1已通过;2已拒绝)
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(dockUser, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ dock_id: 1 });
+schema.index({ status: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Dock_user', schema, 'dock_user');
+};

+ 40 - 0
app/model/expert.js

@@ -0,0 +1,40 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+
+// 专家表
+const expert = {
+  user_id: { type: ObjectId }, // 关联的personal的id
+  education: { type: String, required: false, maxLength: 200 }, // 最高学历
+  school: { type: String, required: false, maxLength: 200 }, // 毕业院校
+  birthDate: { type: String, required: false, maxLength: 200 }, // 出生日期
+  qqwx: { type: String, required: false, maxLength: 200 }, // qq&微信
+  email: { type: String, required: false, maxLength: 200 }, // 邮箱
+  company: { type: String, required: false, maxLength: 500 }, // 单位名称
+  zwzc: { type: String, required: false, maxLength: 200 }, // 职务职称
+  expertise: { type: String, required: false, maxLength: 200 }, // 擅长领域
+  img_path: { type: String, required: false }, // 头像图片
+  workexperience: { type: String, required: false, maxLength: 500 }, // 工作经历
+  scientific: { type: String, required: false, maxLength: 300 }, // 科研综述
+  undertakingproject: { type: String, required: false, maxLength: 200 }, // 承担项目
+  scienceaward: { type: String, required: false, maxLength: 200 }, // 科技奖励
+  social: { type: String, required: false, maxLength: 200 }, // 社会任职
+  status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
+
+  isdel: { type: String, required: false, default: '0' }, // 0=>未删除;1=>已删除
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(expert, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ phone: 1 });
+schema.index({ code: 1 });
+schema.index({ status: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Expert', schema, 'expert');
+};

+ 27 - 0
app/model/interview.js

@@ -0,0 +1,27 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 访谈表
+const interview = {
+  dock_id: { type: ObjectId },
+  title: { type: String, required: false, maxLength: 500 }, // 标题
+  publish_time: { type: String, required: false, maxLength: 500 }, // 时间
+  origin: { type: String, required: false, maxLength: 500, default: '网站管理员' }, // 来源
+  brief: { type: String, maxLength: 100 }, // 简介
+  picture: { type: String, required: false }, // 图片
+  filepath: { type: String, required: false }, // 视频
+  content: { type: String, required: false }, // 正文内容
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(interview, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ title: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Interview', schema, 'interview');
+};

+ 21 - 0
app/model/invite_code.js

@@ -0,0 +1,21 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { ObjectId } = require('mongoose').Types;
+// 邀请码表
+const invite_code = {
+  code: { type: String, required: true, unique: true }, // 邀请码
+  user_id: { type: ObjectId, required: true }, // 用户id
+  user_name: { type: String }, // 用户名
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(invite_code, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ code: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Invite_code', schema, 'invite_code');
+};

+ 20 - 0
app/model/menu.js

@@ -0,0 +1,20 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+// 菜单表
+const menu = {
+  title: { type: String }, // 名称
+  index: { type: String }, // 路由
+  sort: { type: Number }, // 菜单顺序,正序 asc
+  icon: { type: String }, // 图表
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(menu, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Menu', schema, 'menu');
+};

+ 36 - 0
app/model/news.js

@@ -0,0 +1,36 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 文件链接
+const filelinks = new Schema({
+  title: { type: String, required: false, maxLength: 500 }, // 名称,
+  url: { type: String, required: false, maxLength: 500 }, // 链接地址,
+});
+// 信息表
+const news = {
+  user_id: { type: ObjectId },
+  column_id: { type: String, required: false, maxLength: 500 }, // 栏目id
+  column_name: { type: String, required: false, maxLength: 500 }, // 栏目名称
+  title: { type: String, required: false, maxLength: 500 }, // 标题
+  publish_time: { type: String, required: false, maxLength: 500 }, // 时间
+  origin: { type: String, required: false, maxLength: 500, default: '网站管理员' }, // 来源
+  brief: { type: String, maxLength: 100 }, // 简介
+  picture: { type: String, required: false }, // 图片
+  filepath: { type: String, required: false }, // 附件
+  video: { type: String }, // 视频
+  content: { type: String, required: false }, // 正文内容
+  type: { type: String, required: false, maxLength: 200 }, // 类型,国家,科学院
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(news, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ title: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('News', schema, 'news');
+};

+ 27 - 0
app/model/notice.js

@@ -0,0 +1,27 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 通知管理表
+const notice = {
+  title: { type: String, required: true, maxLength: 500 }, // 标题
+  source: { type: String, required: false, maxLength: 500 }, // 来源
+  content: { type: String, required: false, maxLength: 500 }, // 内容
+  isenable: { type: String, required: false, maxLength: 500, default: '0' }, // 是否启用(0:未启用 1:启用 2:禁用)
+  user_id: { type: ObjectId, required: false, maxLength: 500 }, // 发布人id
+  code: { type: String, required: false, maxLength: 500 }, // 所属机构代码
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') }, // 发布时间
+};
+const schema = new Schema(notice, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ title: 1 });
+schema.index({ user_id: 1 });
+schema.index({ code: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Notice', schema, 'notice');
+};

+ 46 - 0
app/model/organization.js

@@ -0,0 +1,46 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+
+// 机构表
+const organization = {
+  name: { type: String, required: true, maxLength: 200 }, // 用户名
+  password: { type: Secret, required: true, select: false }, // 登录密码
+  phone: { type: String, required: false, maxLength: 200 }, // 电话号码
+  email: { type: String, required: false, maxLength: 200 }, // 邮箱
+  addr: { type: String, required: false, maxLength: 500 }, // 地址
+  office_phone: { type: String, required: false, maxLength: 500 }, // 办公电话
+  profession: { type: String, required: false, maxLength: 500 }, // 所属行业
+  institution_code: { type: String, required: false, maxLength: 500 }, // 机构代码
+  code: { type: String, required: false, default: 'INVESTORS' }, // 邀请码
+
+  companytype: { type: String, required: false, maxLength: 300 }, // 注册类型
+  companydate: { type: String, required: false, maxLength: 300 }, // 注册时间
+  companycapital: { type: String, required: false, maxLength: 300 }, // 注册资金
+  companyperson: { type: String, required: false, maxLength: 300 }, // 企业法人
+  sndqyzsr: { type: String, required: false, maxLength: 300 }, // 上年度企业总收入
+  sndyffy: { type: String, required: false, maxLength: 300 }, // 上年度研发费用
+  companytotal: { type: String, required: false, maxLength: 300 }, // 企业总人数
+  zjzyfrs: { type: String, required: false, maxLength: 300 }, // 专&兼职研发人数
+  companybrief: { type: String, required: false }, // 企业简介
+  mainproduct: { type: String, required: false, maxLength: 300 }, // 主要产品
+  qualifications: { type: String, required: false, maxLength: 300 }, // 企业资质&荣誉
+  status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
+
+  isdel: { type: String, required: false, default: '0' }, // 0=>未删除;1=>已删除
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(organization, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ phone: 1 });
+schema.index({ profession: 1 });
+schema.index({ institution_code: 1 });
+schema.index({ companyperson: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Organization', schema, 'organization');
+};

+ 30 - 0
app/model/patent.js

@@ -0,0 +1,30 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+// 专利表
+const PatentSchema = {
+  create_number: { type: String, required: false, maxLength: 500 }, // 申请号
+  create_date: { type: String, required: false, maxLength: 500 }, // 申请日
+  success_number: { type: String, required: false, maxLength: 500 }, // 公开(公告)号
+  success_date: { type: String, required: false, maxLength: 500 }, //  公开(公告)日
+  name: { type: String, required: false, maxLength: 500 }, // 标题
+  inventor: { type: String, required: false, maxLength: 500 }, // 发明人
+  address: { type: String, required: false, maxLength: 500 }, // 发明人地址
+  apply_personal: { type: String, required: false, maxLength: 500 }, // 申请人
+  term: { type: String, required: false, maxLength: 500 }, // 专利有效性
+  type: { type: String, required: false, maxLength: 500 }, // 专利类型
+  agent_personal: { type: String, required: false, maxLength: 500 }, // 代理人
+  agent: { type: String, required: false, maxLength: 500 }, // 代理机构
+  abstract: { type: String, required: false, maxLength: 1000 }, // 摘要
+  img_url: { type: String, required: false, maxLength: 500 }, // 图片
+  origin: { type: String, maxLength: 200 }, // 数据来源(手写的)
+};
+
+const schema = new Schema(PatentSchema, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Patent', schema, 'patent');
+};

+ 34 - 0
app/model/personal.js

@@ -0,0 +1,34 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+
+// 个人用户表
+const personal = {
+  name: { type: String, required: true }, // 用户名
+  password: { type: Secret, required: true, select: false }, // 登录密码
+  phone: { type: String, required: false, maxLength: 200 }, // 电话号码
+  email: { type: String, required: false, maxLength: 200 }, // 邮箱
+  addr: { type: String, required: false, maxLength: 500 }, // 地址
+  office_phone: { type: String, required: false, maxLength: 500 }, // 办公电话
+  profession: { type: String, required: false, maxLength: 500 }, // 所属行业
+  code: { type: String, required: false, default: 'INVESTORS' }, // 邀请码
+  openid: { type: String, required: false }, // 微信openid
+  status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
+  isdel: { type: String, required: false, maxLength: 200, default: '0' }, // 是否删除,0-否,1-是
+  remark: { type: String, maxLength: 200 },
+  is_expert: { type: Boolean, default: false }, // 是否是专家
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(personal, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ phone: 1 });
+schema.index({ code: 1 });
+schema.index({ status: 1 });
+schema.index({ profession: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Personal', schema, 'personal');
+};

+ 69 - 0
app/model/product.js

@@ -0,0 +1,69 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+// 产品图片表
+const images = new Schema({
+  url: { type: String, required: true, maxLength: 500 }, // 图片路径
+});
+// 专利信息
+const patents = new Schema({
+  patentinfo: { type: String, required: false, maxLength: 200 }, // 专利信息,
+  patentstatus: { type: String, required: false, maxLength: 200 }, // 专利状态,
+});
+// 产品表
+const product = {
+  name: { type: String, required: false, maxLength: 200 }, // 名称
+  contacts: { type: String, required: false, maxLength: 200 }, // 联系人
+  phone: { type: String, required: false, maxLength: 11 }, // 联系电话
+  qqwx: { type: String, required: false, maxLength: 200 }, // qq&微信
+  email: { type: String, required: false, maxLength: 200 }, // 邮箱
+  type: { type: String, required: false, maxLength: 200 }, // 类型: 0-科技需求;1-技术成果;2-商务服务
+  status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态(0:草稿 1:审核中 2:审核通过 3:审核拒绝)
+  user_id: { type: String, required: false, maxLength: 500 }, // 创建人id
+  // 共同字段
+  field: { type: String, required: false, maxLength: 500 }, // 所属领域
+  cooperation: { type: String, required: false, maxLength: 500 }, // 合作方式
+  company: { type: String, required: false, maxLength: 500 }, // 企业名称
+  condition: { type: String, required: false, maxLength: 500 }, // 合作条件及要求
+  image: { type: [ images ] }, // 图片,产品图片都为此字段
+  expect: { type: String, required: false, maxLength: 500 }, // 预期, 所有的预期都合并为此字段
+  demand: { type: String, required: false, maxLength: 200 }, // 需求程度:技术的需求紧急程度和服务的需求程度改为此字段
+
+  // 技术需求字段
+  budget: { type: String, required: false, maxLength: 300 }, // 投资预算
+  requirementdesc: { type: String, required: false, maxLength: 500 }, // 需求说明
+  present: { type: String, required: false, maxLength: 500 }, // 需求现状
+
+  // 技术成果字段
+  achievestatus: { type: String, required: false, maxLength: 200 }, // 成果状态
+  achieveown: { type: String, required: false, maxLength: 200 }, // 成果权属
+  achievesource: { type: String, required: false, maxLength: 200 }, // 成果来源
+  intentionprice: { type: String, required: false, maxLength: 200 }, // 意向价格
+  patent: { type: [ patents ] },
+  roadshow: { type: String, required: false, maxLength: 200 }, // 项目路演
+  achievebrief: { type: String, required: false, maxLength: 500 }, // 成果简介
+  features: { type: String, required: false, maxLength: 500 }, // 技术特点
+  team: { type: String, required: false, maxLength: 500 }, // 技术团队
+
+  // 商务需求
+  messattribute: { type: String, required: false, maxLength: 200 }, // 信息属性
+  informationdesc: { type: String, required: false, maxLength: 500 }, // 信息描述
+  coreelements: { type: String, required: false, maxLength: 500 }, // 核心要素
+  priceinfo: { type: String, required: false, maxLength: 500 }, // 价格信息
+
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(product, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ name: 1 });
+schema.index({ qqwx: 1 });
+schema.index({ type: 1 });
+schema.index({ status: 1 });
+schema.index({ company: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Product', schema, 'product');
+};

+ 31 - 0
app/model/road_show.js

@@ -0,0 +1,31 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 项目路演表
+const road_show = {
+  user_id: { type: ObjectId },
+  dock_id: { type: ObjectId }, // 展会id
+  title: { type: String, required: false, maxLength: 500 }, // 标题
+  brief: { type: String, maxLength: 100 }, // 简介
+  origin: { type: String, required: false, maxLength: 500, default: '网站管理员' }, // 来源
+  publish_time: { type: String, required: false, maxLength: 500 }, // 发布时间
+  content: { type: String, required: false }, // 正文
+  picture: { type: String, required: false }, // 图片路径
+  filepath: { type: String, required: false }, // 文件路径
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(road_show, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ dock_id: 1 });
+schema.index({ title: 1 });
+schema.index({ origin: 1 });
+schema.index({ publish_time: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Road_show', schema, 'road_show');
+};

+ 24 - 0
app/model/science.js

@@ -0,0 +1,24 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 科技新闻表
+const science = {
+  title: { type: String, required: false, maxLength: 500 }, // 名称
+  publish_time: { type: String, required: false, maxLength: 500 }, // 时间
+  origin: { type: String, required: false, maxLength: 500 }, // 来源
+  picture: { type: String, required: false }, // 图片
+  filepath: { type: String, required: false }, // 附件
+  content: { type: String, required: false }, // 正文
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(science, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Science', schema, 'science');
+};

+ 30 - 0
app/model/survey.js

@@ -0,0 +1,30 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+// 建言献策,网上调查表
+const survey = {
+  user_id: { type: ObjectId, required: false, maxLength: 500 }, // 用户id
+  // 网上调查
+  resource: { type: String, required: false, maxLength: 500 }, // 是否愿意
+  // 建议
+  nickname: { type: String, required: false, maxLength: 500 }, // 昵称
+  name: { type: String, required: false, maxLength: 500 }, // 姓名
+  phone: { type: String, required: false, maxLength: 500 }, // 手机号
+  work: { type: String, required: false, maxLength: 500 }, // 职业
+  address: { type: String, required: false, maxLength: 500 }, // 详细地址
+  title: { type: String, required: false, maxLength: 500 }, // 标题
+  proposal: { type: String, required: false, maxLength: 500 }, // 建议内容
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(survey, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ user_id: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Survey', schema, 'survey');
+};

+ 46 - 0
app/model/train_live.js

@@ -0,0 +1,46 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+
+const video = new Schema({
+  video_title: { type: String, maxLength: 500 }, // 标题
+  video_date: { type: String, maxLength: 500 }, // 时间
+  video_url: { type: String, maxLength: 500 }, // 视频路径
+});
+const user = new Schema({
+  user_title: { type: String, maxLength: 500 }, // 用户名
+  user_phone: { type: String, maxLength: 500 }, // 账号
+  user_password: { type: String, maxLength: 500 }, // 密码
+});
+// 培训问诊表
+const trainlive = {
+  room_id: { type: String, required: true, unique: true }, // 房间号
+  password: { type: String }, // 密码
+  title: { type: String }, // 标题
+  province: { type: String }, // 省份
+  place: { type: String }, // 市区
+  sponsor: { type: String }, // 主办方
+  brief: { type: String }, // 简介
+  user: { type: String }, // 负责人
+  phone: { type: String }, // 负责人手机号
+  video_data: { type: [ video ] }, // 视频
+  user_data: { type: [ user ], select: false }, // 参加用户
+  start_date: { type: String }, // 开始时间
+  type: { type: String, default: 'train' }, // 类型
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(trainlive, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ room_id: 1 });
+schema.index({ title: 1 });
+schema.index({ province: 1 });
+schema.index({ city: 1 });
+schema.index({ user: 1 });
+schema.index({ phone: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Train_live', schema, 'train_live');
+};

+ 39 - 0
app/model/transaction.js

@@ -0,0 +1,39 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const moment = require('moment');
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+const { ObjectId } = require('mongoose').Types;
+
+// 合同备案
+const pact = new Schema({
+  desc: { type: String }, // 描述
+  status: { type: String, default: '0' }, // 状态(0:待审核 1:通过审核)
+});
+// 交易表
+const transaction = {
+  dock_id: { type: ObjectId }, // 展会id
+  supplier: { type: ObjectId }, // 供给者
+  s_name: { type: String }, // 供给者姓名
+  s_phone: { type: String }, // 供给者联系电话
+  demander: { type: ObjectId }, // 需求者
+  d_name: { type: String }, // 需求者姓名
+  d_phone: { type: String }, // 需求者联系电话
+  product_id: { type: ObjectId }, // 产品id
+  product: { type: String }, // 产品名称
+  pact: { type: pact }, // 合同备案
+  status: { type: String, default: '0' }, // 状态(0-正在洽谈;1-达成意向;2-交易备案;3-交易完成;4-交易失败)
+  remark: { type: String, maxLength: 200 },
+  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
+};
+const schema = new Schema(transaction, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ dock_id: 1 });
+schema.index({ supplier: 1 });
+schema.index({ demander: 1 });
+schema.index({ product: 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Transaction', schema, 'transaction');
+};

+ 37 - 0
app/router.js

@@ -0,0 +1,37 @@
+'use strict';
+
+/**
+ * @param {Egg.Application} app - egg application
+ */
+module.exports = app => {
+  const { router, controller } = app;
+  router.get('/', controller.home.index);
+  const profix = '/api/live/';
+  const vision = 'v0';
+  router.post(`${profix}${vision}/util`, controller.home.utilMethod);
+  require('./router/users/admin')(app); // 管理员
+  require('./router/users/personal')(app); // 个人用户
+  require('./router/users/organization')(app); // 机构用户
+  require('./router/users/expert')(app); // 专家用户
+  require('./router/users/product')(app); // 产品
+  require('./router/system/menu')(app); // 菜单
+  require('./router/system/category')(app); // 字典类别
+  require('./router/system/code')(app); // 字典
+  require('./router/system/invite_code')(app); // 邀请码
+  require('./router/system/notice')(app); // 通知管理
+  require('./router/system/survey')(app); // 建言献策,网上调查
+  require('./router/dock/index')(app); // 展会
+  require('./router/dock/dock_pw')(app); // 展会-图文
+  require('./router/dock/dock_user')(app); // 展会-用户
+  require('./router/dock/transaction')(app); // 交易合同+备案
+  require('./router/dock/road_show')(app); // 路演
+  require('./router/dock/channel')(app); // 科技频道
+  require('./router/dock/channel_video')(app); // 科技频道-视频
+  require('./router/tecinfo/column')(app); // 栏目
+  require('./router/tecinfo/news')(app); // 信息
+  require('./router/dock/interview')(app); // 访谈
+  require('./router/dock/train_live')(app); // 培训问诊
+  require('./router/dock/patent')(app); // e专利
+  require('./router/tecinfo/science')(app); // 科技新闻
+  require('./router/statistics/index')(app); // 首页统计
+};

+ 13 - 0
app/router/dock/channel.js

@@ -0,0 +1,13 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'channel';
+  router.post(target, `${profix}${vision}/${index}/${target}/login`, controller[index][target].login);
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 12 - 0
app/router/dock/channel_video.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'channelVideo';
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 12 - 0
app/router/dock/dock_pw.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'dockPw';
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 14 - 0
app/router/dock/dock_user.js

@@ -0,0 +1,14 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'dockUser';
+  router.post(target, `${profix}${vision}/${index}/${target}/check/user/:id`, controller[index][target].userCheck);
+  router.post(target, `${profix}${vision}/${index}/${target}/check/goods/:id`, controller[index][target].goodsCheck);
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 14 - 0
app/router/dock/index.js

@@ -0,0 +1,14 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'index';
+  router.post(target, `${profix}${vision}/${index}/${target}/viplogin/:id`, controller[index][target].vipLogin);
+  router.post(target, `${profix}${vision}/${index}/${target}/login`, controller[index][target].login);
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 12 - 0
app/router/dock/interview.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'interview';
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 18 - 0
app/router/dock/patent.js

@@ -0,0 +1,18 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'patent';
+  // 专利表
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+  // 导入专利
+  router.post(target, `${profix}${vision}/${index}/${target}/import`, controller[index][target].toImport);
+  // 导出
+  router.post(target, `${profix}${vision}/${index}/${target}/export`, controller[index][target].toExport);
+
+};

+ 12 - 0
app/router/dock/road_show.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'roadShow';
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 27 - 0
app/router/dock/train_live.js

@@ -0,0 +1,27 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'trainLive';
+  // 延长登陆
+  router.get(target, `${profix}${vision}/${index}/${target}/user/longer/:id`, controller[index][target].userLonger);
+  // 培训问诊管理员登陆
+  router.post(target, `${profix}${vision}/${index}/${target}/login`, controller[index][target].login);
+  // 参会人员登陆
+  router.post(target, `${profix}${vision}/${index}/${target}/user/login/:id`, controller[index][target].userLogin);
+  // 参会人员注销
+  router.post(target, `${profix}${vision}/${index}/${target}/user/logout/:id`, controller[index][target].userLogout);
+  // 添加参会人员
+  router.post(target, `${profix}${vision}/${index}/${target}/user/:id`, controller[index][target].addUser);
+  // 删除参会人员
+  router.delete(target, `${profix}${vision}/${index}/${target}/user/:id`, controller[index][target].deleteUser);
+  // 修改参会人员
+  router.post(target, `${profix}${vision}/${index}/${target}/user/update/:id`, controller[index][target].updateUser);
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+  router.get(target, `${profix}${vision}/${index}/${target}/user/:id`, controller[index][target].userData);
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+};

+ 13 - 0
app/router/dock/transaction.js

@@ -0,0 +1,13 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'dock';
+  const target = 'transaction';
+  router.post(target, `${profix}${vision}/${index}/${target}/step/:id`, controller[index][target].step);
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 15 - 0
app/router/statistics/index.js

@@ -0,0 +1,15 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'statistics';
+  const target = 'index';
+  router.get(target, `${profix}${vision}/${index}/${target}/index`, controller[index][target].index);
+  router.get(target, `${profix}${vision}/${index}/${target}/patent`, controller[index][target].patent);
+  router.get(target, `${profix}${vision}/${index}/${target}/product`, controller[index][target].product);
+  router.get(target, `${profix}${vision}/${index}/${target}/expert`, controller[index][target].expert);
+  router.get(target, `${profix}${vision}/${index}/${target}/circle`, controller[index][target].circle);
+};

+ 12 - 0
app/router/system/category.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'system';
+  const target = 'category';
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 14 - 0
app/router/system/code.js

@@ -0,0 +1,14 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'system';
+  const target = 'code';
+  router.post(target, `${profix}${vision}/${index}/${target}/name`, controller[index][target].codeName);
+  router.get(target, `${profix}${vision}/${index}/${target}/xzqh`, controller[index][target].xzqh);
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 12 - 0
app/router/system/invite_code.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'system';
+  const target = 'inviteCode';
+  router.get('target', `${profix}${vision}/${index}/${target}`, controller[index][target].index);
+
+};

+ 12 - 0
app/router/system/menu.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'system';
+  const target = 'menu';
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 12 - 0
app/router/system/notice.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/live/';
+  const vision = 'v0';
+  const index = 'system';
+  const target = 'notice';
+  router.resources(target, `${profix}${vision}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
+  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
+};

+ 0 - 0
app/router/system/survey.js


部分文件因文件數量過多而無法顯示