zs 1 年之前
当前提交
c1d573102a
共有 100 个文件被更改,包括 30766 次插入0 次删除
  1. 11 0
      .editorconfig
  2. 11 0
      .eslintrc.json
  3. 13 0
      .gitignore
  4. 4 0
      .prettierrc.js
  5. 15 0
      README.md
  6. 29 0
      README.zh-CN.md
  7. 2 0
      bootstrap.js
  8. 20 0
      ecosystem.config.js
  9. 6 0
      jest.config.js
  10. 18563 0
      package-lock.json
  11. 63 0
      package.json
  12. 7006 0
      pnpm-lock.yaml
  13. 33 0
      src/config/config.default.ts
  14. 78 0
      src/config/config.local.ts
  15. 64 0
      src/config/config.prod.ts
  16. 7 0
      src/config/config.unittest.ts
  17. 64 0
      src/configuration.ts
  18. 42 0
      src/controller/es.controller.ts
  19. 16 0
      src/controller/home.controller.ts
  20. 21 0
      src/controller/init.controller.ts
  21. 86 0
      src/controller/login.controller.ts
  22. 83 0
      src/controller/platform/achievement.controller.ts
  23. 78 0
      src/controller/platform/chat.controller.ts
  24. 76 0
      src/controller/platform/collection.controller.ts
  25. 83 0
      src/controller/platform/demand.controller.ts
  26. 68 0
      src/controller/platform/design.controller.ts
  27. 75 0
      src/controller/platform/match.controller.ts
  28. 71 0
      src/controller/platform/news.controller.ts
  29. 83 0
      src/controller/platform/project.controller.ts
  30. 75 0
      src/controller/platform/sign.controller.ts
  31. 84 0
      src/controller/platform/supply.controller.ts
  32. 68 0
      src/controller/platform/tags.controller.ts
  33. 68 0
      src/controller/record/dataLogs.controller.ts
  34. 68 0
      src/controller/record/dataRecord.controller.ts
  35. 68 0
      src/controller/system/admin.controller.ts
  36. 68 0
      src/controller/system/config.controller.ts
  37. 68 0
      src/controller/system/dictData.controller.ts
  38. 68 0
      src/controller/system/dictType.controller.ts
  39. 62 0
      src/controller/system/menus.controller.ts
  40. 80 0
      src/controller/system/role.controller.ts
  41. 78 0
      src/controller/system/user.controller.ts
  42. 44 0
      src/controller/token.controller.ts
  43. 36 0
      src/controller/tool.controller.ts
  44. 73 0
      src/controller/users/association.controller.ts
  45. 88 0
      src/controller/users/company.controller.ts
  46. 73 0
      src/controller/users/competition.controller.ts
  47. 88 0
      src/controller/users/expert.controller.ts
  48. 73 0
      src/controller/users/incubator.controller.ts
  49. 73 0
      src/controller/users/investment.controller.ts
  50. 73 0
      src/controller/users/state.controller.ts
  51. 73 0
      src/controller/users/unit.controller.ts
  52. 50 0
      src/decorator/checkPermissionCode.ts
  53. 69 0
      src/decorator/dataRecord.ts
  54. 37 0
      src/decorator/verifyToken.decorator.ts
  55. 65 0
      src/entity/basic.entity.ts
  56. 39 0
      src/entity/platform/achievement.entity.ts
  57. 19 0
      src/entity/platform/chat.entity.ts
  58. 15 0
      src/entity/platform/collection.entity.ts
  59. 33 0
      src/entity/platform/demand.entity.ts
  60. 23 0
      src/entity/platform/design.entity.ts
  61. 35 0
      src/entity/platform/match.entity.ts
  62. 25 0
      src/entity/platform/news.entity.ts
  63. 31 0
      src/entity/platform/project.entity.ts
  64. 27 0
      src/entity/platform/sign.entity.ts
  65. 33 0
      src/entity/platform/supply.entity.ts
  66. 23 0
      src/entity/platform/tags.entity.ts
  67. 34 0
      src/entity/system/admin.entity.ts
  68. 15 0
      src/entity/system/config.entity.ts
  69. 19 0
      src/entity/system/dictData.entity.ts
  70. 15 0
      src/entity/system/dictType.entity.ts
  71. 33 0
      src/entity/system/menus.entity.ts
  72. 17 0
      src/entity/system/role.entity.ts
  73. 36 0
      src/entity/system/user.entity.ts
  74. 23 0
      src/entity/users/association.entity.ts
  75. 45 0
      src/entity/users/company.entity.ts
  76. 23 0
      src/entity/users/competition.entity.ts
  77. 41 0
      src/entity/users/expert.entity.ts
  78. 23 0
      src/entity/users/incubator.entity.ts
  79. 29 0
      src/entity/users/investment.entity.ts
  80. 25 0
      src/entity/users/state.entity.ts
  81. 23 0
      src/entity/users/unit.entity.ts
  82. 17 0
      src/entityRecord/dataLogs.entity.ts
  83. 29 0
      src/entityRecord/dataRecord.entity.ts
  84. 14 0
      src/error/elasticsearch.error.ts
  85. 16 0
      src/error/frame.error.ts
  86. 6 0
      src/interface.ts
  87. 42 0
      src/interface/login.interface.ts
  88. 160 0
      src/interface/platform/achievement.interface.ts
  89. 90 0
      src/interface/platform/chat.interface.ts
  90. 82 0
      src/interface/platform/collection.interface.ts
  91. 139 0
      src/interface/platform/demand.interface.ts
  92. 96 0
      src/interface/platform/design.interface.ts
  93. 142 0
      src/interface/platform/match.interface.ts
  94. 113 0
      src/interface/platform/news.interface.ts
  95. 137 0
      src/interface/platform/project.interface.ts
  96. 114 0
      src/interface/platform/sign.interface.ts
  97. 139 0
      src/interface/platform/supply.interface.ts
  98. 102 0
      src/interface/platform/tags.interface.ts
  99. 83 0
      src/interface/record/dataLogs.interface.ts
  100. 0 0
      src/interface/record/dataRecord.interface.ts

+ 11 - 0
.editorconfig

@@ -0,0 +1,11 @@
+# 🎨 editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_style = space
+indent_size = 2
+trim_trailing_whitespace = true
+insert_final_newline = true

+ 11 - 0
.eslintrc.json

@@ -0,0 +1,11 @@
+{
+  "extends": "./node_modules/mwts/",
+  "ignorePatterns": ["node_modules", "dist", "test", "jest.config.js", "typings"],
+  "env": {
+    "jest": true
+  },
+  "rules": {
+    "prettier/prettier": 0,
+    "max-len": ["warn", { "code": 250 }]
+  }
+}

+ 13 - 0
.gitignore

@@ -0,0 +1,13 @@
+logs/
+npm-debug.log
+yarn-error.log
+node_modules/
+coverage/
+dist/
+.idea/
+run/
+.DS_Store
+*.sw*
+*.un~
+.tsbuildinfo
+.tsbuildinfo.*

+ 4 - 0
.prettierrc.js

@@ -0,0 +1,4 @@
+module.exports = {
+  ...require('mwts/.prettierrc.json'),
+  printWidth: 250,
+}

+ 15 - 0
README.md

@@ -0,0 +1,15 @@
+# vue3js-template-service
+## 1.单点登录
+* 1.不需要登录就可以使用的接口: 请求函数的方法注解参数添加 description: 'ignore'即可
+
+## 2.注解
+* checkPermissionCode
+|注解名|类型|说明|
+|:-:|:-:|:-:|
+|roleCode|string|该接口权限所需标识 ${路由名称}.${功能}|
+
+* dataRecord
+|注解名|类型|说明|
+|:-:|:-:|:-:|
+|before|string|获取原数据的函数名;该service下的函数名,纯自定义|
+|after|string|获取新数据的函数名;该service下的函数名,纯自定义|

+ 29 - 0
README.zh-CN.md

@@ -0,0 +1,29 @@
+# my_midway_project
+
+## 快速入门
+
+<!-- 在此次添加使用文档 -->
+
+如需进一步了解,参见 [midway 文档][midway]。
+
+### 本地开发
+
+```bash
+$ npm i
+$ npm run dev
+$ open http://localhost:7001/
+```
+
+### 部署
+
+```bash
+$ npm start
+```
+
+### 内置指令
+
+- 使用 `npm run lint` 来做代码风格检查。
+- 使用 `npm test` 来执行单元测试。
+
+
+[midway]: https://midwayjs.org

+ 2 - 0
bootstrap.js

@@ -0,0 +1,2 @@
+const { Bootstrap } = require('@midwayjs/bootstrap');
+Bootstrap.run();

+ 20 - 0
ecosystem.config.js

@@ -0,0 +1,20 @@
+'use strict';
+// 开发服务设置
+const app = 'service';
+module.exports = {
+  apps: [
+    {
+      name: app, // 应用名称
+      script: './bootstrap.js', // 实际启动脚本
+      out: `./logs/${app}.log`,
+      error: `./logs/${app}.err`,
+      watch: [
+        // 监控变化的目录,一旦变化,自动重启
+        'dist',
+      ],
+      env: {
+        NODE_ENV: 'production', // 环境参数,当前指定为生产环境
+      },
+    },
+  ],
+};

+ 6 - 0
jest.config.js

@@ -0,0 +1,6 @@
+module.exports = {
+  preset: 'ts-jest',
+  testEnvironment: 'node',
+  testPathIgnorePatterns: ['<rootDir>/test/fixtures'],
+  coveragePathIgnorePatterns: ['<rootDir>/test/'],
+};

文件差异内容过多而无法显示
+ 18563 - 0
package-lock.json


+ 63 - 0
package.json

@@ -0,0 +1,63 @@
+{
+  "name": "vue3js-template-service",
+  "version": "1.0.0",
+  "description": "",
+  "private": true,
+  "dependencies": {
+    "@elastic/elasticsearch": "^8.12.2",
+    "@midwayjs/bootstrap": "^3.12.0",
+    "@midwayjs/bull": "3",
+    "@midwayjs/core": "^3.12.0",
+    "@midwayjs/decorator": "^3.12.0",
+    "@midwayjs/i18n": "3",
+    "@midwayjs/info": "^3.12.0",
+    "@midwayjs/jwt": "^3.13.7",
+    "@midwayjs/koa": "^3.12.0",
+    "@midwayjs/logger": "^3.1.0",
+    "@midwayjs/redis": "3",
+    "@midwayjs/swagger": "^3.13.7",
+    "@midwayjs/typegoose": "^3.0.0",
+    "@midwayjs/validate": "^3.12.0",
+    "@midwayjs/ws": "^3.15.8",
+    "@typegoose/typegoose": "^9.0.0",
+    "crypto-js": "^4.2.0",
+    "dayjs": "^1.11.10",
+    "free-midway-component": "^1.0.53",
+    "lodash": "^4.17.21",
+    "mongoose": "^6.0.7"
+  },
+  "devDependencies": {
+    "@midwayjs/cli": "^2.1.1",
+    "@midwayjs/mock": "^3.12.0",
+    "@types/jest": "^29.2.0",
+    "@types/koa": "^2.13.4",
+    "@types/lodash": "^4.14.202",
+    "@types/node": "14",
+    "cross-env": "^6.0.0",
+    "jest": "^29.2.2",
+    "mwts": "^1.3.0",
+    "mwtsc": "^1.4.0",
+    "swagger-ui-dist": "^5.10.5",
+    "ts-jest": "^29.0.3",
+    "typescript": "~4.8.0"
+  },
+  "engines": {
+    "node": ">=12.0.0"
+  },
+  "scripts": {
+    "start": "NODE_ENV=production node ./bootstrap.js",
+    "dev": "cross-env TS_NODE_TYPE_CHECK=false TS_NODE_TRANSPILE_ONLY=true NODE_ENV=local midway-bin dev --ts",
+    "test": "cross-env NODE_ENV=unittest jest",
+    "cov": "jest --coverage",
+    "lint": "mwts check",
+    "lint:fix": "mwts fix",
+    "ci": "npm run cov",
+    "build": "mwtsc --cleanOutDir"
+  },
+  "repository": {
+    "type": "git",
+    "url": ""
+  },
+  "author": "anonymous",
+  "license": "MIT"
+}

文件差异内容过多而无法显示
+ 7006 - 0
pnpm-lock.yaml


+ 33 - 0
src/config/config.default.ts

@@ -0,0 +1,33 @@
+import { MidwayConfig } from '@midwayjs/core';
+
+export default {
+  // use for cookie sign key, should change to your own and keep security
+  keys: '1706233305258_2242',
+  koa: {
+    port: 7001,
+  },
+  // 请求记录在redis留存时间,超过时间.数据变化将不会记录.以秒为单位--5分钟
+  requestTimeLimit: 300,
+  i18n: {
+    defaultLocale: 'zh-cn',
+    fallbacks: {
+      'en*': 'en_us',
+      'zh*': 'zh-cn',
+    },
+    localeTable: {
+      en_us: {
+        default: require('../locales/en_us/defaults'),
+        error: require('../locales/en_us/errors'),
+      },
+      zh_cn: {
+        default: require('../locales/zh_cn/defaults'),
+        error: require('../locales/zh_cn/errors'),
+        methods: require('../locales/zh_cn/controller_method'),
+      },
+    },
+  },
+  webSocket: {
+    serverHeartbeatInterval: 30000,
+    enableServerHeartbeatCheck: true,
+  },
+} as MidwayConfig;

+ 78 - 0
src/config/config.local.ts

@@ -0,0 +1,78 @@
+import { MidwayConfig } from '@midwayjs/core';
+const ip = '127.0.0.1'; //120.48.146.1
+const redisHost = '127.0.0.1';
+const redisPwd = '123456';
+const redisDB = 6;
+const projectDB = 'vue3js-template-test';
+const recordDB = 'vue3js-template-test-record'
+const loginSign = 'tsFrameDev';
+export default {
+  // use for cookie sign key, should change to your own and keep security
+  keys: '1697684406848_4978',
+  loginSign,
+  koa: {
+    port: 9700,
+    globalPrefix: '/ts/frame/api',
+  },
+  swagger: {
+    swaggerPath: '/doc/api',
+  },
+  jwt: {
+    secret: 'Ziyouyanfa!@#',
+    expiresIn: 3600, // 3600
+  },
+  elasticsearch: {
+    node: 'http://192.168.1.197:9200',
+    auth: {
+      username: 'elastic',
+      password: 'NAjqFz_7tS2DkdpU7p*x',
+    },
+  },
+  dbName: projectDB,
+  mongoose: {
+    dataSource: {
+      default: {
+        uri: `mongodb://${ip}:27017/${projectDB}`,
+        options: {
+          user: 'admin',
+          pass: 'admin',
+          authSource: 'admin',
+          useNewUrlParser: true,
+        },
+        entities: ['./entity'],
+      },
+      record:{
+        uri: `mongodb://${ip}:27017/${recordDB}`,
+        options: {
+          user: 'admin',
+          pass: 'admin',
+          authSource: 'admin',
+          useNewUrlParser: true,
+        },
+        entities: ['./entityRecord'],
+      }
+    },
+  },
+  redis: {
+    client: {
+      port: 6379, // Redis port
+      host: redisHost, // Redis host
+      password: redisPwd,
+      db: redisDB,
+    },
+  },
+  bull: {
+    // 默认的队列配置
+    defaultQueueOptions: {
+      redis: {
+        port: 6379,
+        host: redisHost,
+        password: redisPwd,
+        db: redisDB,
+      },
+    },
+  },
+  upload: {
+    whitelist: null,
+  },
+} as MidwayConfig;

+ 64 - 0
src/config/config.prod.ts

@@ -0,0 +1,64 @@
+import { MidwayConfig } from '@midwayjs/core';
+const ip = 'host.docker.internal';
+const redisHost = ip;
+const redisPwd = '123456';
+const redisDB = 1;
+const projectDB = 'vue3js-template-test';
+const loginSign = 'information_platform';
+export default {
+  // use for cookie sign key, should change to your own and keep security
+  keys: '1697684406848_4978',
+  loginSign,
+  koa: {
+    port: 9700,
+    globalPrefix: '/ts/frame/api',
+  },
+  jwt: {
+    secret: 'Ziyouyanfa!@#',
+    expiresIn: 3600, // 3600
+  },
+  elasticsearch: {
+    node: 'http://localhost:9200',
+    auth: {
+      username: 'elastic',
+      password: 'NAjqFz_7tS2DkdpU7p*x',
+    },
+  },
+  dbName: projectDB,
+  mongoose: {
+    dataSource: {
+      default: {
+        uri: `mongodb://${ip}:27017/${projectDB}`,
+        options: {
+          user: 'admin',
+          pass: 'admin',
+          authSource: 'admin',
+          useNewUrlParser: true,
+        },
+        entities: ['./entity'],
+      },
+    },
+  },
+  redis: {
+    client: {
+      port: 6379, // Redis port
+      host: redisHost, // Redis host
+      password: redisPwd,
+      db: redisDB,
+    },
+  },
+  bull: {
+    // 默认的队列配置
+    defaultQueueOptions: {
+      redis: {
+        port: 6379,
+        host: redisHost,
+        password: redisPwd,
+        db: redisDB,
+      },
+    },
+  },
+  upload: {
+    whitelist: null,
+  },
+} as MidwayConfig;

+ 7 - 0
src/config/config.unittest.ts

@@ -0,0 +1,7 @@
+import { MidwayConfig } from '@midwayjs/core';
+
+export default {
+  koa: {
+    port: null,
+  },
+} as MidwayConfig;

+ 64 - 0
src/configuration.ts

@@ -0,0 +1,64 @@
+import { Configuration, App, Inject, MidwayDecoratorService, IMidwayContainer, IMidwayApplication } from '@midwayjs/core';
+import * as koa from '@midwayjs/koa';
+import * as validate from '@midwayjs/validate';
+import * as info from '@midwayjs/info';
+import { join } from 'path';
+import * as FreeFrame from 'free-midway-component';
+import * as jwt from '@midwayjs/jwt';
+import * as ws from '@midwayjs/ws';
+import { VerifyTokenInit } from './decorator/verifyToken.decorator';
+import { CheckPermissionCodeInit } from './decorator/checkPermissionCode';
+import * as swagger from '@midwayjs/swagger';
+import * as redis from '@midwayjs/redis';
+import { CheckOnePointLoginMiddleware } from './middleware/checkOnePointLogin.middleware';
+import { newsQueryMiddleware } from './middleware/newsQuery.middleware';
+import * as i18n from '@midwayjs/i18n';
+import { SetLocaleToCtxMiddleware } from './middleware/setLocaleToCtx.middleware';
+import * as bull from '@midwayjs/bull';
+import { ElasticsearchService } from './service/elasticsearch';
+import { DataRecordMiddleware } from './middleware/dataRecord.middleware';
+import { DBService } from './service/db.service';
+@Configuration({
+  imports: [
+    koa,
+    validate,
+    FreeFrame,
+    jwt,
+    ws,
+    redis,
+    i18n,
+    bull,
+    {
+      component: info,
+      enabledEnvironment: ['local'],
+    },
+    {
+      component: swagger,
+      enabledEnvironment: ['local'],
+    },
+  ],
+  importConfigs: [join(__dirname, './config')],
+})
+export class MainConfiguration {
+  @App('koa')
+  app: koa.Application;
+  @Inject()
+  decoratorService: MidwayDecoratorService;
+
+  async onReady() {
+    this.app.getMiddleware().insertFirst(SetLocaleToCtxMiddleware)
+    this.app.getMiddleware().insertAfter(CheckOnePointLoginMiddleware, 'checkToken');
+    this.app.getMiddleware().insertAfter(DataRecordMiddleware, 'checkOnePonitLogin');
+    this.app.getMiddleware().insertAfter(newsQueryMiddleware, 'newsQuery');
+    // 注解
+    VerifyTokenInit(this.decoratorService);
+    CheckPermissionCodeInit(this.decoratorService);
+  }
+  // 应用服务已启动后执行
+  async onServerReady?(container: IMidwayContainer, app: IMidwayApplication) {
+    // 初始化es
+    const esService = await container.getAsync(ElasticsearchService);
+    // await esService.preparMapping();
+    // await container.getAsync(DBService);
+  }
+}

+ 42 - 0
src/controller/es.controller.ts

@@ -0,0 +1,42 @@
+import { Body, Controller, Del, Get, Inject, Param, Post,  Query } from '@midwayjs/core';
+import { ElasticsearchService } from '../service/elasticsearch';
+
+@Controller('/es')
+export class ESController {
+  @Inject()
+  esService: ElasticsearchService;
+
+  @Post('/async')
+  async asyncData() {
+    await this.esService.asyncData();
+    return 'ok';
+  }
+
+  @Get('/')
+  async search(@Query() query: any) {
+    query.build_time = ['2023-01-01', '2024-01-01']
+    const result = await this.esService.search(query);
+    return result;
+  }
+
+  @Post('/')
+  async create(@Body() data: any) {
+    const result = await this.esService.create(data);
+    return 'created';
+  }
+
+  @Post('/:id')
+  async update(@Param('id') id: string, @Body() data: any) {
+    const result = await this.esService.update(id, data);
+    console.log(id);
+    console.log(data);
+    return 'update';
+  }
+
+  @Del('/:id')
+  async delete(@Param('id') id: string) {
+    const result = await this.esService.delete(id);
+    console.log(id);
+    return 'delete';
+  }
+}

+ 16 - 0
src/controller/home.controller.ts

@@ -0,0 +1,16 @@
+import { Controller, Get, Inject } from '@midwayjs/core';
+import { FrameworkErrorEnum, ServiceError } from 'free-midway-component';
+import { Context } from '@midwayjs/koa';
+import { MidwayI18nService } from '@midwayjs/i18n';
+@Controller('/')
+export class HomeController {
+  @Inject()
+  ctx: Context;
+  @Inject()
+  i18n: MidwayI18nService;
+  @Get('/', { description: 'ignore' })
+  async home(): Promise<string> {
+    throw new ServiceError(this.i18n.translate(FrameworkErrorEnum.BAD_ARGS, {  group: 'error' }),FrameworkErrorEnum.BAD_ARGS)
+    // return ;
+  }
+}

+ 21 - 0
src/controller/init.controller.ts

@@ -0,0 +1,21 @@
+import { Controller, Inject, Post } from '@midwayjs/decorator';
+import { Context } from '@midwayjs/koa';
+import { InitService } from '../service/init.service';
+@Controller('/init')
+export class InitController {
+  @Inject()
+  ctx: Context;
+
+  @Inject()
+  service: InitService;
+
+  @Post('/', { description: 'ignore' })
+  async index() {
+    await this.service.adminUser();
+    // 未初始化,则执行初始化程序
+    await this.service.initDict();
+    await this.service.initRole();
+    await this.service.initMenus();
+    return 'ok';
+  }
+}

+ 86 - 0
src/controller/login.controller.ts

@@ -0,0 +1,86 @@
+import { Body, Config, Controller, Inject, Param, Post, Get } from '@midwayjs/core';
+import { ApiTags } from '@midwayjs/swagger';
+import { LoginDTO, LoginType, LoginVO, UPwdDTO } from '../interface/login.interface';
+import { LoginService } from '../service/login.service';
+import { JwtService } from '@midwayjs/jwt';
+import { Context } from '@midwayjs/koa';
+const assert = require('assert');
+import get = require('lodash/get');
+import { UtilService } from '../service/util.service';
+// import { FrameworkErrorEnum, ServiceError } from 'free-midway-component';
+
+@ApiTags(['登录服务'])
+@Controller('/login')
+export class LoginController {
+  @Inject()
+  loginService: LoginService;
+  @Inject()
+  jwtService: JwtService;
+  @Inject()
+  utilService: UtilService;
+  @Config('jwt.secret')
+  jwtSecret;
+  @Config('jwt.expiresIn')
+  jwtExpiresIn;
+  @Inject()
+  ctx: Context;
+  /**
+   * 账密登录
+   * @param data 用户名和密码
+   * @param type 用户类型
+   */
+  @Post('/:type')
+  async toLogin(@Body() data: LoginDTO, @Param('type') type: string) {
+    const user = await this.loginService.loginByAccount(data, LoginType[type]);
+    if (type === 'Admin') user.role = [type];
+    let vo = new LoginVO(user);
+    vo = JSON.parse(JSON.stringify(vo));
+    vo.login_code = await this.loginService.onePointLogin(vo);
+    const token = await this.jwtService.sign(vo, this.jwtSecret);
+    return token;
+  }
+
+  /**
+   * TODO:微信小程序登录
+   * @param openid 微信小程序openid
+   */
+  // @Post('/wxapp/:openid')
+  // async wxAppLogin(@Param('openid') openid: string) {
+  //   if (!openid) throw new ServiceError('缺少微信凭证!', FrameworkErrorEnum.BAD_PARAMS);
+  //   const user = await this.loginService.wxAppLogin(openid);
+  //   let vo = new LoginVO(user);
+  //   vo = JSON.parse(JSON.stringify(vo));
+  //   const token = await this.jwtService.sign(vo, this.jwtSecret, {
+  //     expiresIn: this.jwtExpiresIn,
+  //   });
+  //   return token;
+  // }
+  /**
+   * 修改密码
+   * @param data 修改密码所需数据
+   * @param type 账户类型
+   */
+  @Post('/updatePwd/:type')
+  async updatePwd(@Body() data: UPwdDTO, @Param('type') type: string) {
+    await this.loginService.updatePwd(data, LoginType[type]);
+    return 'ok';
+  }
+
+  @Post('/resetPwd/:type')
+  async resetPwd(@Body('_id') _id: string, @Param('type') type: string) {
+    // 随机密码
+    const data = new UPwdDTO();
+    data._id = _id;
+    data.password = this.utilService.randomStr();
+    await this.loginService.updatePwd(data, LoginType[type]);
+    return data.password;
+  }
+
+  @Get('/analysis')
+  async analysisToken() {
+    const token = get(this.ctx, 'request.header.token');
+    assert(token, '缺少token信息');
+    const result = await this.jwtService.decodeSync(token);
+    return result;
+  }
+}

+ 83 - 0
src/controller/platform/achievement.controller.ts

@@ -0,0 +1,83 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { AchievementService } from '../../service/platform/achievement.service';
+import { CDTO_achievement, CVO_achievement, FVO_achievement, QDTO_achievement, QVO_achievement, UDTO_achievement, UVAO_achievement } from '../../interface/platform/achievement.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['成果'])
+@Controller('/achievement')
+export class AchievementController extends BaseController {
+  @Inject()
+  service: AchievementService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_achievement })
+  async create(@Body() data: CDTO_achievement) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_achievement(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_achievement })
+  async query(@Query() filter: QDTO_achievement, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_achievement(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/list')
+  async list() {
+    const list = await this.service.list(this.ctx.filter);
+    const data = list.data;
+    const total = list.total;
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_achievement })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_achievement(data);
+    return result;
+  }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_achievement })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    return data;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_achievement })
+  async update(@Param('id') id: string, @Body() body: UDTO_achievement) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 78 - 0
src/controller/platform/chat.controller.ts

@@ -0,0 +1,78 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { ChatService } from '../../service/platform/chat.service';
+import { CDTO_chat, CVO_chat, FVO_chat, QVO_chat, UDTO_chat, UVAO_chat } from '../../interface/platform/chat.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['聊天记录'])
+@Controller('/chat')
+export class ChatController extends BaseController {
+  @Inject()
+  service: ChatService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_chat })
+  async create(@Body() data: CDTO_chat) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_chat(dbData);
+    await this.service.createAfter(result);
+    return result;
+  }
+
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_chat })
+  async query(@Query() filter) {
+    const list = await this.service.query(filter);
+    return list;
+  }
+
+  @Get('/read')
+  @ApiQuery({ name: 'query' })
+  async user(@Query() filter: any) {
+    const result = await this.service.read(filter);
+    return result;
+  }
+
+  @Get('/chat')
+  @ApiQuery({ name: 'query' })
+  async chat(@Query() filter) {
+    const list = await this.service.chat(filter);
+    return list;
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_chat })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_chat(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_chat })
+  async update(@Param('id') id: string, @Body() body: UDTO_chat) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 76 - 0
src/controller/platform/collection.controller.ts

@@ -0,0 +1,76 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { CollectionService } from '../../service/platform/collection.service';
+import { CDTO_collection, CVO_collection, FVO_collection, QDTO_collection, QVO_collection, UDTO_collection, UVAO_collection } from '../../interface/platform/collection.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['收藏'])
+@Controller('/collection')
+export class CollectionController extends BaseController {
+  @Inject()
+  service: CollectionService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_collection })
+  async create(@Body() data: CDTO_collection) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_collection(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_collection })
+  async query(@Query() filter: QDTO_collection, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_collection(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_collection })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_collection(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_collection })
+  async update(@Param('id') id: string, @Body() body: UDTO_collection) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+
+  @Post('/cancel')
+  @Validate()
+  @ApiResponse({ type: CVO_collection })
+  async cancel(@Body() data: CDTO_collection) {
+    await this.service.cancel(data);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 83 - 0
src/controller/platform/demand.controller.ts

@@ -0,0 +1,83 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DemandService } from '../../service/platform/demand.service';
+import { CDTO_demand, CVO_demand, FVO_demand, QDTO_demand, QVO_demand, UDTO_demand, UVAO_demand } from '../../interface/platform/demand.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['需求'])
+@Controller('/demand')
+export class DemandController extends BaseController {
+  @Inject()
+  service: DemandService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_demand })
+  async create(@Body() data: CDTO_demand) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_demand(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_demand })
+  async query(@Query() filter: QDTO_demand, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_demand(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/list')
+  async list() {
+    const list = await this.service.list(this.ctx.filter);
+    const data = list.data;
+    const total = list.total;
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_demand })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_demand(data);
+    return result;
+  }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_demand })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    return data;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_demand })
+  async update(@Param('id') id: string, @Body() body: UDTO_demand) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/platform/design.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DesignService } from '../../service/platform/design.service';
+import { CDTO_design, CVO_design, FVO_design, QDTO_design, QVO_design, UDTO_design, UVAO_design } from '../../interface/platform/design.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['平台设置'])
+@Controller('/design')
+export class DesignController extends BaseController {
+  @Inject()
+  service: DesignService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_design })
+  async create(@Body() data: CDTO_design) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_design(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_design })
+  async query(@Query() filter: QDTO_design, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_design(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_design })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_design(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_design })
+  async update(@Param('id') id: string, @Body() body: UDTO_design) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 75 - 0
src/controller/platform/match.controller.ts

@@ -0,0 +1,75 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { MatchService } from '../../service/platform/match.service';
+import { CDTO_match, CVO_match, FVO_match, QDTO_match, QVO_match, UDTO_match, UVAO_match } from '../../interface/platform/match.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['创新大赛'])
+@Controller('/match')
+export class MatchController extends BaseController {
+  @Inject()
+  service: MatchService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_match })
+  async create(@Body() data: CDTO_match) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_match(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_match })
+  async query(@Query() filter: QDTO_match, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_match(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_match })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_match(data);
+    return result;
+  }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_match })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    return data;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_match })
+  async update(@Param('id') id: string, @Body() body: UDTO_match) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 71 - 0
src/controller/platform/news.controller.ts

@@ -0,0 +1,71 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { NewsService } from '../../service/platform/news.service';
+import { CDTO_news, CVO_news, FVO_news, QDTO_news, QVO_news, UDTO_news, UVAO_news } from '../../interface/platform/news.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['新闻'])
+@Controller('/news')
+export class NewsController extends BaseController {
+  @Inject()
+  service: NewsService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_news })
+  async create(@Body() data: CDTO_news) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_news(dbData);
+    return result;
+  }
+
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_news })
+  async query(@Query() filter: QDTO_news, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_news(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_news })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    // 加浏览量
+    await this.service.fetchBrowse(data);
+    const result = new FVO_news(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_news })
+  async update(@Param('id') id: string, @Body() body: UDTO_news) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 83 - 0
src/controller/platform/project.controller.ts

@@ -0,0 +1,83 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { ProjectService } from '../../service/platform/project.service';
+import { CDTO_project, CVO_project, FVO_project, QDTO_project, QVO_project, UDTO_project, UVAO_project } from '../../interface/platform/project.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['项目'])
+@Controller('/project')
+export class ProjectController extends BaseController {
+  @Inject()
+  service: ProjectService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_project })
+  async create(@Body() data: CDTO_project) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_project(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_project })
+  async query(@Query() filter: QDTO_project, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_project(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/list')
+  async list() {
+    const list = await this.service.list(this.ctx.filter);
+    const data = list.data;
+    const total = list.total;
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_project })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_project(data);
+    return result;
+  }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_project })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    return data;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_project })
+  async update(@Param('id') id: string, @Body() body: UDTO_project) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 75 - 0
src/controller/platform/sign.controller.ts

@@ -0,0 +1,75 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { SignService } from '../../service/platform/sign.service';
+import { CDTO_sign, CVO_sign, FVO_sign, QDTO_sign, QVO_sign, UDTO_sign, UVAO_sign } from '../../interface/platform/sign.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['赛事报名表'])
+@Controller('/sign')
+export class SignController extends BaseController {
+  @Inject()
+  service: SignService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_sign })
+  async create(@Body() data: CDTO_sign) {
+    await this.service.createExamine(data);
+    const dbData = await this.service.create(data);
+    const result = new CVO_sign(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_sign })
+  async query(@Query() filter: QDTO_sign, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_sign(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/sign')
+  async sign(@Query() filter) {
+    const list = await this.service.sign(filter);
+    return list;
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_sign })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_sign(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_sign })
+  async update(@Param('id') id: string, @Body() body: UDTO_sign) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 84 - 0
src/controller/platform/supply.controller.ts

@@ -0,0 +1,84 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { SupplyService } from '../../service/platform/supply.service';
+import { CDTO_supply, CVO_supply, FVO_supply, QDTO_supply, QVO_supply, UDTO_supply, UVAO_supply } from '../../interface/platform/supply.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['供给'])
+@Controller('/supply')
+export class SupplyController extends BaseController {
+  @Inject()
+  service: SupplyService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_supply })
+  async create(@Body() data: CDTO_supply) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_supply(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_supply })
+  async query(@Query() filter: QDTO_supply, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_supply(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/list')
+  async list() {
+    const list = await this.service.list(this.ctx.filter);
+    const data = list.data;
+    const total = list.total;
+    return { data, total };
+  }
+
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_supply })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    return data;
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_supply })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_supply(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_supply })
+  async update(@Param('id') id: string, @Body() body: UDTO_supply) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/platform/tags.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { TagsService } from '../../service/platform/tags.service';
+import { CDTO_tags, CVO_tags, FVO_tags, QDTO_tags, QVO_tags, UDTO_tags, UVAO_tags } from '../../interface/platform/tags.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['标签'])
+@Controller('/tags')
+export class TagsController extends BaseController {
+  @Inject()
+  service: TagsService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_tags })
+  async create(@Body() data: CDTO_tags) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_tags(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_tags })
+  async query(@Query() filter: QDTO_tags, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit, sort: { sort: 1 } });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_tags(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_tags })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_tags(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_tags })
+  async update(@Param('id') id: string, @Body() body: UDTO_tags) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/record/dataLogs.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DataLogsService } from '../../service/record/dataLogs.service';
+import { CDTO_dataLogs, CVO_dataLogs, FVO_dataLogs, QDTO_dataLogs, QVO_dataLogs, UDTO_dataLogs, UVAO_dataLogs } from '../../interface/record/dataLogs.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['mongodb oplog'])
+@Controller('/dataLogs')
+export class DataLogsController extends BaseController {
+  @Inject()
+  service: DataLogsService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dataLogs })
+  async create(@Body() data: CDTO_dataLogs) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dataLogs(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dataLogs })
+  async query(@Query() filter: QDTO_dataLogs, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_dataLogs(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dataLogs })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dataLogs(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dataLogs })
+  async update(@Param('id') id: string, @Body() body: UDTO_dataLogs) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/record/dataRecord.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DataRecordService } from '../../service/record/dataRecord.service';
+import { CDTO_dataRecord, CVO_dataRecord, FVO_dataRecord, QDTO_dataRecord, QVO_dataRecord, UDTO_dataRecord, UVAO_dataRecord } from '../../interface/record/dataRecord.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['数据操作记录'])
+@Controller('/dataRecord')
+export class DataRecordController extends BaseController {
+  @Inject()
+  service: DataRecordService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dataRecord })
+  async create(@Body() data: CDTO_dataRecord) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dataRecord(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dataRecord })
+  async query(@Query() filter: QDTO_dataRecord, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_dataRecord(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dataRecord })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dataRecord(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dataRecord })
+  async update(@Param('id') id: string, @Body() body: UDTO_dataRecord) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/system/admin.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { AdminService } from '../../service/system/admin.service';
+import { CDTO_admin, CVO_admin, FVO_admin, QDTO_admin, QVO_admin, UDTO_admin, UVAO_admin } from '../../interface/system/admin.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['管理员表'])
+@Controller('/admin')
+export class AdminController extends BaseController {
+  @Inject()
+  service: AdminService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_admin })
+  async create(@Body() data: CDTO_admin) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_admin(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_admin })
+  async query(@Query() filter: QDTO_admin, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_admin(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_admin })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_admin(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_admin })
+  async update(@Param('id') id: string, @Body() body: UDTO_admin) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/system/config.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post } from '@midwayjs/decorator';
+import { BaseController, FrameworkErrorEnum, ServiceError } from 'free-midway-component';
+import { ConfigService } from '../../service/system/config.service';
+import { CDTO_config, CVO_config, FVO_config, UDTO_config, UVAO_config } from '../../interface/system/config.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { FrameErrorEnum } from '../../error/frame.error';
+import { I18nService } from '../../service/i18n.service';
+@ApiTags(['设置表'])
+@Controller('/config')
+export class ConfigController extends BaseController {
+  @Inject()
+  service: ConfigService;
+  @Inject()
+  i18n: I18nService;
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_config })
+  async create(@Body() data: CDTO_config) {
+    throw new ServiceError(this.i18n.translateError(FrameErrorEnum.SERVICE_CANT_USE), FrameErrorEnum.SERVICE_CANT_USE);
+    // const dbData = await this.service.create(data);
+    // const result = new CVO_config(dbData);
+    // return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: FVO_config })
+  async query() {
+    const data = await this.service.getConfig();
+    const result = new FVO_config(data);
+    return result;
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_config })
+  async fetch(@Param('id') id: string) {
+    throw new ServiceError(this.i18n.translateError(FrameErrorEnum.SERVICE_CANT_USE), FrameErrorEnum.SERVICE_CANT_USE);
+    // const data = await this.service.fetch(id);
+    // const result = new FVO_config(data);
+    // return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_config })
+  async update(@Param('id') id: string, @Body() body: UDTO_config) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/system/dictData.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DictDataService } from '../../service/system/dictData.service';
+import { CDTO_dictData, CVO_dictData, FVO_dictData, QDTO_dictData, QVO_dictData, UDTO_dictData, UVAO_dictData } from '../../interface/system/dictData.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['字典数据表'])
+@Controller('/dictData')
+export class DictDataController extends BaseController {
+  @Inject()
+  service: DictDataService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dictData })
+  async create(@Body() data: CDTO_dictData) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dictData(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dictData })
+  async query(@Query() filter: QDTO_dictData, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit, sort: { sort: 1 } });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_dictData(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dictData })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dictData(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dictData })
+  async update(@Param('id') id: string, @Body() body: UDTO_dictData) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 68 - 0
src/controller/system/dictType.controller.ts

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DictTypeService } from '../../service/system/dictType.service';
+import { CDTO_dictType, CVO_dictType, FVO_dictType, QDTO_dictType, QVO_dictType, UDTO_dictType, UVAO_dictType } from '../../interface/system/dictType.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['字典类型表'])
+@Controller('/dictType')
+export class DictTypeController extends BaseController {
+  @Inject()
+  service: DictTypeService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dictType })
+  async create(@Body() data: CDTO_dictType) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dictType(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dictType })
+  async query(@Query() filter: QDTO_dictType, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_dictType(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dictType })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dictType(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dictType })
+  async update(@Param('id') id: string, @Body() body: UDTO_dictType) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 62 - 0
src/controller/system/menus.controller.ts

@@ -0,0 +1,62 @@
+import { Body, Controller, Del, Get, Inject, Param, Post } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { MenusService } from '../../service/system/menus.service';
+import { CDTO_menus, CVO_menus, FVO_menus, QVO_menus, UDTO_menus, UVAO_menus } from '../../interface/system/menus.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['菜单表'])
+@Controller('/menus')
+export class MenusController extends BaseController {
+  @Inject()
+  service: MenusService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_menus })
+  async create(@Body() data: CDTO_menus) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_menus(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_menus })
+  async query() {
+    const list = await this.service.queryMenu();
+    return list;
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_menus })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_menus(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_menus })
+  async update(@Param('id') id: string, @Body() body: UDTO_menus) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 80 - 0
src/controller/system/role.controller.ts

@@ -0,0 +1,80 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { RoleService } from '../../service/system/role.service';
+import { CDTO_role, CVO_role, FVO_role, QDTO_role, QVO_role, UDTO_role, UVAO_role } from '../../interface/system/role.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { MenusService } from '../../service/system/menus.service';
+import { verifyToken } from '../../decorator/verifyToken.decorator';
+import { checkPermissionCode } from '../../decorator/checkPermissionCode';
+@ApiTags(['角色表'])
+@Controller('/role')
+export class RoleController extends BaseController {
+  @Inject()
+  service: RoleService;
+  @Inject()
+  menusService: MenusService;
+
+  @Post('/')
+  @verifyToken()
+  @Validate()
+  @ApiResponse({ type: CVO_role })
+  async create(@Body() data: CDTO_role) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_role(dbData);
+    return result;
+  }
+  @Get('/')
+  @verifyToken()
+  @checkPermissionCode({ roleCode: 'system_role' })
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_role })
+  async query(@Query() filter: QDTO_role, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_role(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @verifyToken()
+  @ApiResponse({ type: FVO_role })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_role(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @verifyToken()
+  @checkPermissionCode({ roleCode: 'system_role.update' })
+  @Validate()
+  @ApiResponse({ type: UVAO_role })
+  async update(@Param('id') id: string, @Body() body: UDTO_role) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @verifyToken()
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 78 - 0
src/controller/system/user.controller.ts

@@ -0,0 +1,78 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { UserService } from '../../service/system/user.service';
+import { CDTO_user, CVO_user, FVO_user, QDTO_user, QVO_user, UDTO_user, UVAO_user } from '../../interface/system/user.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['平台用户'])
+@Controller('/user')
+export class UserController extends BaseController {
+  @Inject()
+  service: UserService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_user })
+  async create(@Body() data: CDTO_user) {
+    const arr = await this.service.createBefore(data);
+    const dbData = await this.service.create(arr);
+    const result = new CVO_user(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_user })
+  async query(@Query() filter: QDTO_user, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_user(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_user })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_user(data);
+    return result;
+  }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_user })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    const result = new FVO_user(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_user })
+  async update(@Param('id') id: string, @Body() body: UDTO_user) {
+    const result = await this.service.updateOne(id, body);
+    await this.service.updateAfter(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 44 - 0
src/controller/token.controller.ts

@@ -0,0 +1,44 @@
+import { Controller, Get, Inject } from '@midwayjs/decorator';
+import { Context } from '@midwayjs/koa';
+import { ApiResponse, ApiTags } from '@midwayjs/swagger';
+// import { TokenService } from '../service/token.service';
+const assert = require('assert');
+import { JwtService } from '@midwayjs/jwt';
+import get = require('lodash/get');
+import { RoleService } from '../service/system/role.service';
+@ApiTags(['工具'])
+@Controller('/token')
+export class TokenController {
+  // @Inject()
+  // service: TokenService;
+
+  @Inject()
+  jwtService: JwtService;
+
+  @Inject()
+  roleService: RoleService;
+
+  @Inject()
+  ctx: Context;
+
+  @Get('/tokenView')
+  @ApiResponse({})
+  async tokenView() {
+    const token = get(this.ctx, 'request.header.token');
+    assert(token, '缺少token信息');
+    const result: any = await this.jwtService.decode(token);
+    const userMenusResult = await this.roleService.getUserMenus();
+    const menus = get(userMenusResult,'menus')
+    const role_code = get(userMenusResult, 'role_code');
+    result.menus = menus;
+    result.role_code = role_code;
+    return result;
+  }
+
+  // @Get('/app')
+  // async appLogin(fiiter) {
+  //   const { config, js_code } = fiiter.query;
+  //   const result: any = await this.service.appLogin(config, js_code);
+  //   return result;
+  // }
+}

+ 36 - 0
src/controller/tool.controller.ts

@@ -0,0 +1,36 @@
+import { Controller, Get, Inject, Query } from '@midwayjs/decorator';
+import { ApiResponse, ApiTags } from '@midwayjs/swagger';
+import { ToolService } from '../service/tool.service';
+@ApiTags(['工具'])
+@Controller('/tool')
+export class ToolController {
+  @Inject()
+  service: ToolService;
+
+  @Get('/getTotal')
+  @ApiResponse({})
+  async getTotal(@Query() filter) {
+    const result = await this.service.getTotal(filter);
+    return result;
+  }
+
+  @Get('/query')
+  @ApiResponse({})
+  async query(@Query() filter) {
+    const result = await this.service.query(filter);
+    return result;
+  }
+
+  @Get('/CollectionTotal')
+  @ApiResponse({})
+  async getCollectionTotal() {
+    const result = await this.service.getCollectionTotal();
+    return result;
+  }
+  @Get('/MyCollection')
+  @ApiResponse({})
+  async MyCollection(@Query() filter) {
+    const result = await this.service.getCollection(filter);
+    return result;
+  }
+}

+ 73 - 0
src/controller/users/association.controller.ts

@@ -0,0 +1,73 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { AssociationService } from '../../service/users/association.service';
+import { CDTO_association, CVO_association, FVO_association, QDTO_association, QVO_association, UDTO_association, UVAO_association } from '../../interface/users/association.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['商协会'])
+@Controller('/association')
+export class AssociationController extends BaseController {
+  @Inject()
+  service: AssociationService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_association })
+  async create(@Body() data: CDTO_association) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_association(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_association })
+  async query(@Query() filter: QDTO_association, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_association(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_association })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_association(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_association })
+  async update(@Param('id') id: string, @Body() body: UDTO_association) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'Association');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 88 - 0
src/controller/users/company.controller.ts

@@ -0,0 +1,88 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { CompanyService } from '../../service/users/company.service';
+import { CDTO_company, CVO_company, FVO_company, QDTO_company, QVO_company, UDTO_company, UVAO_company } from '../../interface/users/company.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['企业'])
+@Controller('/company')
+export class CompanyController extends BaseController {
+  @Inject()
+  service: CompanyService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_company })
+  async create(@Body() data: CDTO_company) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_company(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_company })
+  async query(@Query() filter: QDTO_company, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_company(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/list')
+  async list() {
+    const list = await this.service.list(this.ctx.filter);
+    const data = list.data;
+    const total = list.total;
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_company })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_company(data);
+    return result;
+  }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_company })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    return data;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_company })
+  async update(@Param('id') id: string, @Body() body: UDTO_company) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'Company');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 73 - 0
src/controller/users/competition.controller.ts

@@ -0,0 +1,73 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { CompetitionService } from '../../service/users/competition.service';
+import { CDTO_competition, CVO_competition, FVO_competition, QDTO_competition, QVO_competition, UDTO_competition, UVAO_competition } from '../../interface/users/competition.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['创业大赛'])
+@Controller('/competition')
+export class CompetitionController extends BaseController {
+  @Inject()
+  service: CompetitionService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_competition })
+  async create(@Body() data: CDTO_competition) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_competition(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_competition })
+  async query(@Query() filter: QDTO_competition, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_competition(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_competition })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_competition(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_competition })
+  async update(@Param('id') id: string, @Body() body: UDTO_competition) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'Competition');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 88 - 0
src/controller/users/expert.controller.ts

@@ -0,0 +1,88 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { ExpertService } from '../../service/users/expert.service';
+import { CDTO_expert, CVO_expert, FVO_expert, QDTO_expert, QVO_expert, UDTO_expert, UVAO_expert } from '../../interface/users/expert.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['专家'])
+@Controller('/expert')
+export class ExpertController extends BaseController {
+  @Inject()
+  service: ExpertService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_expert })
+  async create(@Body() data: CDTO_expert) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_expert(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_expert })
+  async query(@Query() filter: QDTO_expert, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_expert(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/list')
+  async list() {
+    const list = await this.service.list(this.ctx.filter);
+    const data = list.data;
+    const total = list.total;
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_expert })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_expert(data);
+    return result;
+  }
+
+  @Get('/detail/:id')
+  @ApiResponse({ type: FVO_expert })
+  async detail(@Param('id') id: string) {
+    const data = await this.service.detail(id);
+    return data;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_expert })
+  async update(@Param('id') id: string, @Body() body: UDTO_expert) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'Expert');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 73 - 0
src/controller/users/incubator.controller.ts

@@ -0,0 +1,73 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { IncubatorService } from '../../service/users/incubator.service';
+import { CDTO_incubator, CVO_incubator, FVO_incubator, QDTO_incubator, QVO_incubator, UDTO_incubator, UVAO_incubator } from '../../interface/users/incubator.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['孵化器'])
+@Controller('/incubator')
+export class IncubatorController extends BaseController {
+  @Inject()
+  service: IncubatorService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_incubator })
+  async create(@Body() data: CDTO_incubator) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_incubator(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_incubator })
+  async query(@Query() filter: QDTO_incubator, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_incubator(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_incubator })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_incubator(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_incubator })
+  async update(@Param('id') id: string, @Body() body: UDTO_incubator) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'Incubator');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 73 - 0
src/controller/users/investment.controller.ts

@@ -0,0 +1,73 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { InvestmentService } from '../../service/users/investment.service';
+import { CDTO_investment, CVO_investment, FVO_investment, QDTO_investment, QVO_investment, UDTO_investment, UVAO_investment } from '../../interface/users/investment.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['投资人'])
+@Controller('/investment')
+export class InvestmentController extends BaseController {
+  @Inject()
+  service: InvestmentService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_investment })
+  async create(@Body() data: CDTO_investment) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_investment(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_investment })
+  async query(@Query() filter: QDTO_investment, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_investment(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_investment })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_investment(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_investment })
+  async update(@Param('id') id: string, @Body() body: UDTO_investment) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'Investment');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 73 - 0
src/controller/users/state.controller.ts

@@ -0,0 +1,73 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { StateService } from '../../service/users/state.service';
+import { CDTO_state, CVO_state, FVO_state, QDTO_state, QVO_state, UDTO_state, UVAO_state } from '../../interface/users/state.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['政府部门'])
+@Controller('/state')
+export class StateController extends BaseController {
+  @Inject()
+  service: StateService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_state })
+  async create(@Body() data: CDTO_state) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_state(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_state })
+  async query(@Query() filter: QDTO_state, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_state(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_state })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_state(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_state })
+  async update(@Param('id') id: string, @Body() body: UDTO_state) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'State');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 73 - 0
src/controller/users/unit.controller.ts

@@ -0,0 +1,73 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { UnitService } from '../../service/users/unit.service';
+import { CDTO_unit, CVO_unit, FVO_unit, QDTO_unit, QVO_unit, UDTO_unit, UVAO_unit } from '../../interface/users/unit.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UtilService } from '../../service/util.service';
+@ApiTags(['科研机构'])
+@Controller('/unit')
+export class UnitController extends BaseController {
+  @Inject()
+  service: UnitService;
+
+  @Inject()
+  utilService: UtilService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_unit })
+  async create(@Body() data: CDTO_unit) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_unit(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_unit })
+  async query(@Query() filter: QDTO_unit, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_unit(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_unit })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_unit(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_unit })
+  async update(@Param('id') id: string, @Body() body: UDTO_unit) {
+    const result = await this.service.updateOne(id, body);
+    await this.utilService.updateUserAfter(id, body, 'Unit');
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 50 - 0
src/decorator/checkPermissionCode.ts

@@ -0,0 +1,50 @@
+import { JoinPoint, MidwayDecoratorService, REQUEST_OBJ_CTX_KEY, createCustomMethodDecorator } from '@midwayjs/core';
+import { FrameworkErrorEnum, ServiceError } from 'free-midway-component';
+import { get } from 'lodash';
+import { RoleService } from '../service/system/role.service';
+import { I18nService } from '../service/i18n.service';
+import { FrameErrorEnum } from '../error/frame.error';
+export const CHECKPERMISSIONCODE_KEY = 'decorator:check_permission_code';
+export const checkPermissionCode = options => {
+  return createCustomMethodDecorator(CHECKPERMISSIONCODE_KEY, options);
+};
+// 第二层及以后的权限,去掉第一层级
+const resetRoleMenus = list => {
+  list = list.map(i => {
+    const arr = i.split('.');
+    if (arr.length <= 1) return i;
+    arr.shift();
+    return arr.join('.');
+  });
+  return list;
+};
+
+export const CheckPermissionCodeInit = (decoratorService: MidwayDecoratorService) => {
+  decoratorService.registerMethodHandler(CHECKPERMISSIONCODE_KEY, options => {
+    return {
+      around: async (joinPoint: JoinPoint) => {
+        const roleCode = get(options, 'metadata.roleCode');
+        if (roleCode) {
+          const instance = joinPoint.target;
+          const ctx = instance[REQUEST_OBJ_CTX_KEY];
+          const roleService = await ctx.requestContext.getAsync(RoleService);
+          const isAdmin = roleService.isSuperAdmin();
+          if (!isAdmin) {
+            let roleMenus = await roleService.getUserMenus(true);
+            roleMenus = resetRoleMenus(roleMenus);
+            if (!roleMenus.includes(roleCode)) {
+              const i18n = await ctx.requestContext.getAsync(I18nService);
+              throw new ServiceError(i18n.translateError(FrameErrorEnum.NO_PERMISSION), FrameErrorEnum.NO_PERMISSION);
+            }
+            const result = await joinPoint.proceed(...joinPoint.args);
+            return result;
+          }
+          const result = await joinPoint.proceed(...joinPoint.args);
+          return result;
+        }
+        const result = await joinPoint.proceed(...joinPoint.args);
+        return result;
+      },
+    };
+  });
+};

+ 69 - 0
src/decorator/dataRecord.ts

@@ -0,0 +1,69 @@
+import { JoinPoint, MidwayDecoratorService, REQUEST_OBJ_CTX_KEY, createCustomMethodDecorator } from '@midwayjs/core';
+import { MidwayI18nService } from '@midwayjs/i18n';
+import { get } from 'lodash';
+import { DataRecordService } from '../service/record/dataRecord.service';
+export const DATARECORD_KEY = 'decorator:data_record';
+export const dataRecord = (options?: any) => {
+  return createCustomMethodDecorator(DATARECORD_KEY, options);
+};
+
+const getMethodName = (mapping: Map<string, any>, controller: string, path: string) => {
+  const map = mapping.get(controller);
+  if (!map) return;
+  return get(map, path);
+};
+// const i18n = await ctx.requestContext.getAsync(MidwayI18nService);
+// const mapping = i18n.getLocaleMapping(ctx.locale, 'methods');
+// const i18nName = getMethodName(mapping, controllerName, methodName);
+// console.log(i18nName);
+
+const defaultMethods = ['create', 'update', 'delete'];
+export const DataRecordInit = (decoratorService: MidwayDecoratorService) => {
+  decoratorService.registerMethodHandler(DATARECORD_KEY, options => {
+    return {
+      around: async (joinPoint: JoinPoint) => {
+        let recordPreData = null;
+        let recordService = null;
+        try {
+          const instance = joinPoint.target;
+          const controllerName = options.target.name;
+          const methodName = options.propertyName;
+          const metaData = options.metadata;
+          const ctx = instance[REQUEST_OBJ_CTX_KEY];
+          recordService = await ctx.requestContext.getAsync(DataRecordService);
+          // 组织记录数据
+          recordPreData = await recordService.makeLogs(controllerName, methodName);
+          if (get(metaData, 'before')) {
+            recordPreData.origin_data = await instance.service[get(metaData, 'before')]();
+          } else if (defaultMethods.includes(methodName)) {
+            // 如果是create,update,delete 默认方法.那就默认处理.自己写的自己处理
+
+            recordPreData.origin_data = await recordService.getDefaultMethodOriginData(instance.service, methodName);
+          }
+          // 执行原函数
+          const result = await joinPoint.proceed(...joinPoint.args);
+          // 如果是create,update,delete 默认方法.那就默认处理.自己写的自己处理
+          if (get(metaData, 'after')) {
+            recordPreData.new_data = await instance.service[get(metaData, 'after')]();
+          } else if (defaultMethods.includes(methodName)) {
+            let od = null;
+            if (methodName === 'create') od = result;
+            else od = recordPreData.origin_data;
+            recordPreData.new_data = await recordService.getDefaultMethodNewData(instance.service, methodName, od);
+          }
+          recordPreData.status = '0';
+          return result;
+        } catch (error) {
+          if (recordPreData) {
+            // 有数据的情况下存日志有意义,否则就是只有个status没意义
+            recordPreData.status = '1';
+          }
+          throw error;
+        } finally {
+          // save logs
+          if (recordPreData) await recordService.create(recordPreData);
+        }
+      },
+    };
+  });
+};

+ 37 - 0
src/decorator/verifyToken.decorator.ts

@@ -0,0 +1,37 @@
+import {
+  JoinPoint,
+  MidwayDecoratorService,
+  REQUEST_OBJ_CTX_KEY,
+  createCustomMethodDecorator,
+} from '@midwayjs/core';
+import { FrameworkErrorEnum, ServiceError } from 'free-midway-component';
+export const VERIFYTOKEN_KEY = 'decorator:verify_token';
+/**
+ *
+ * 只检测是否有token,此装饰器不做具体用token处理什么.
+ */
+export function verifyToken() {
+  return createCustomMethodDecorator(VERIFYTOKEN_KEY, {});
+}
+/**
+ * 验证token装饰器实现
+ * @param decoratorService 装饰器服务
+ */
+export function VerifyTokenInit(decoratorService: MidwayDecoratorService) {
+  decoratorService.registerMethodHandler(VERIFYTOKEN_KEY, options => {
+    return {
+      around: async (joinPoint: JoinPoint) => {
+        const instance = joinPoint.target;
+        const ctx = instance[REQUEST_OBJ_CTX_KEY];
+        const user = ctx.user;
+        if (!user)
+          throw new ServiceError(
+            '未检测到登录信息,无法访问接口!',
+            FrameworkErrorEnum.NOT_LOGIN
+          );
+        const result = await joinPoint.proceed(...joinPoint.args);
+        return result;
+      },
+    };
+  });
+}

+ 65 - 0
src/entity/basic.entity.ts

@@ -0,0 +1,65 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'basic' },
+})
+export class Basic extends BaseModel {
+  @prop({ required: false, index: true, zh: '实验室类别', remark: '字典:laboratory_type' })
+  type: string;
+  @prop({ required: false, index: true, zh: '实验室名称' })
+  name: string;
+  @prop({ required: false, index: false, zh: '英文名称' })
+  english_name: string;
+  @prop({ required: false, index: false, zh: '所属学科' })
+  subject: string;
+  @prop({ required: false, index: false, zh: '所属专业' })
+  major: string;
+  @prop({ required: false, index: false, zh: '实验室面积' })
+  lab_acreage: string;
+  @prop({ required: false, index: false, zh: '批建时间' })
+  build_time: string;
+  @prop({ required: false, index: false, zh: '实验室地址' })
+  lab_address: string;
+  @prop({ required: false, index: false, zh: '依托单位id', remark: 'unit_name不需要了,现在所有的实验室都有依托单位' })
+  unit: string;
+  @prop({ required: false, index: false, zh: '实验室定位' })
+  position: string;
+  @prop({ required: false, index: false, zh: '实验室建设方案' })
+  plan: Array<any>;
+  @prop({ required: false, index: false, zh: '实验室主任' })
+  chief_name: string;
+  @prop({ required: false, index: false, zh: '实验室联系人' })
+  lab_person: string;
+  @prop({ required: false, index: false, zh: '实验室联系人电话' })
+  lab_phone: string;
+  @prop({ required: false, index: false, zh: '电子邮箱' })
+  lab_email: string;
+  @prop({ required: false, index: false, zh: '申报单位' })
+  declare_unit: object;
+  @prop({ required: false, index: false, zh: '平台负责人' })
+  leading_cadre: object;
+  @prop({ required: false, index: false, zh: '科研助理' })
+  assistant: object;
+  @prop({ required: false, index: false, zh: '财务助理是否与科研助理同一人' })
+  is_alike: boolean;
+  @prop({ required: false, index: false, zh: '财务助理' })
+  finance: object;
+  @prop({ required: false, index: false, zh: '所属吉林省重点实验室' })
+  ss_laboratory: string;
+  @prop({ required: false, index: false, zh: '整合基础' })
+  zh_basis: string;
+  @prop({ required: false, index: false, zh: '是否公开', remark: '字典:info_show' })
+  is_show: string;
+  @prop({ required: false, index: false, zh: '地区' })
+  region: string;
+  @prop({ required: false, index: true, zh: '状态', default: '2' })
+  status: string;
+  @prop({ required: false, index: false, zh: '主任入驻记录' })
+  chief_logs: Array<any>;
+  @prop({ required: false, index: false, zh: '发展前景' })
+  develop: string;
+  @prop({ required: false, index: false, zh: '运行机制' })
+  mechanism: string;
+  @prop({ required: false, index: false, zh: '运行机制文件' })
+  mechanism_file: Array<any>;
+}

+ 39 - 0
src/entity/platform/achievement.entity.ts

@@ -0,0 +1,39 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'achievement' },
+})
+export class Achievement extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '专利号' })
+  patent: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '属性' })
+  attribute: string;
+  @prop({ required: false, index: true, zh: '出让方式' })
+  sell: string;
+  @prop({ required: false, index: true, zh: '成熟度' })
+  mature: string;
+  @prop({ required: false, index: true, zh: '行业领域' })
+  field: string;
+  @prop({ required: false, index: true, zh: '技术分类' })
+  technology: string;
+  @prop({ required: false, index: true, zh: '成果地区' })
+  area: Array<any>;
+  @prop({ required: false, index: false, zh: '发布时间' })
+  time: string;
+  @prop({ required: false, index: true, zh: '参考价格' })
+  money: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '附件' })
+  file: Array<any>;
+  @prop({ required: false, index: true, zh: '成果状态', default: '0' })
+  achievement_status: string;
+  @prop({ required: false, index: true, zh: '是否公开', default: '1' })
+  is_use: string;
+  @prop({ required: false, index: true, zh: '状态' , default: '0'})
+  status: string;
+}

+ 19 - 0
src/entity/platform/chat.entity.ts

@@ -0,0 +1,19 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'chat' },
+})
+export class Chat extends BaseModel {
+  @prop({ required: false, index: true, zh: '发送者id' })
+  sender_id: string;
+  @prop({ required: false, index: false, zh: '接收者id' })
+  receiver_id: string;
+  @prop({ required: false, index: false, zh: '内容类型' })
+  type: string;
+  @prop({ required: false, index: true, zh: '内容' })
+  content: string;
+  @prop({ required: false, index: false, zh: '发送时间' })
+  send_time: string;
+  @prop({ required: false, index: false, zh: '是否已读', default: '0' })
+  is_read: string;
+}

+ 15 - 0
src/entity/platform/collection.entity.ts

@@ -0,0 +1,15 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'collection' },
+})
+export class Collection extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '来源id' })
+  source: string;
+  @prop({ required: false, index: true, zh: '类型' })
+  type: string;
+  @prop({ required: false, index: false, zh: '收藏时间' })
+  time: string;
+}

+ 33 - 0
src/entity/platform/demand.entity.ts

@@ -0,0 +1,33 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'demand' },
+})
+export class Demand extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '类型' })
+  type: string;
+  @prop({ required: false, index: true, zh: '行业领域' })
+  field: string;
+  @prop({ required: false, index: false, zh: '需求紧急度' })
+  urgent: string;
+  @prop({ required: false, index: true, zh: '合作方式' })
+  method: string;
+  @prop({ required: false, index: false, zh: '有效期' })
+  time: Array<any>;
+  @prop({ required: false, index: false, zh: '价格' })
+  money: string;
+  @prop({ required: false, index: true, zh: '需求地区' })
+  area: Array<any>;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '需求状态', default: '0' })
+  demand_status: string;
+  @prop({ required: false, index: true, zh: '是否公开', default: '1' })
+  is_use: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 23 - 0
src/entity/platform/design.entity.ts

@@ -0,0 +1,23 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'design' },
+})
+export class Design extends BaseModel {
+  @prop({ required: false, index: false, zh: '标题' })
+  zhTitle: string;
+  @prop({ required: false, index: false, zh: '英文标题' })
+  zhEnglish: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  zhBrief: string;
+  @prop({ required: false, index: false, zh: '使用协议' })
+  agreement: string;
+  @prop({ required: false, index: false, zh: '关于我们' })
+  brief: string;
+  @prop({ required: false, index: false, zh: 'logo' })
+  logoUrl: Array<any>;
+  @prop({ required: false, index: false, zh: '视频' })
+  videoUrl: Array<any>;
+  @prop({ required: false, index: false, zh: '网站底部信息' })
+  footInfo: object;
+}

+ 35 - 0
src/entity/platform/match.entity.ts

@@ -0,0 +1,35 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'match' },
+})
+export class Match extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '类型' })
+  type: string;
+  @prop({ required: false, index: true, zh: '组织单位' })
+  work: string;
+  @prop({ required: false, index: true, zh: '行业' })
+  industry: string;
+  @prop({ required: false, index: true, zh: '类别' })
+  form: string;
+  @prop({ required: false, index: false, zh: '有效期' })
+  time: Array<any>;
+  @prop({ required: false, index: false, zh: '奖金' })
+  money: string;
+  @prop({ required: false, index: false, zh: '赛事规则', default: {} })
+  rules: object;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '封面' })
+  file: Array<any>;
+  @prop({ required: false, index: true, zh: '赛事状态', default: '0' })
+  match_status: string;
+  @prop({ required: false, index: true, zh: '是否公开', default: '1' })
+  is_use: string;
+  @prop({ required: false, index: true, zh: '状态', default: '0' })
+  status: string;
+}

+ 25 - 0
src/entity/platform/news.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'news' },
+})
+export class News extends BaseModel {
+  @prop({ required: false, index: true, zh: '标题' })
+  title: string;
+  @prop({ required: false, index: true, zh: '封面' })
+  logo: Array<any>;
+  @prop({ required: false, index: false, zh: '发布人' })
+  person: string;
+  @prop({ required: false, index: false, zh: '发布时间' })
+  time: string;
+  @prop({ required: false, index: false, zh: '内容' })
+  content: string;
+  @prop({ required: false, index: false, zh: '浏览次数', default: 0 })
+  number: number;
+  @prop({ required: false, index: false, zh: '类型', remark: '0:政策新闻,1:新闻资讯', default: '0' })
+  type: string;
+  @prop({ required: false, index: true, zh: '是否使用', default: '1' })
+  is_use: string;
+  @prop({ required: false, index: true, zh: '状态' , default: '0'})
+  status: string;
+}

+ 31 - 0
src/entity/platform/project.entity.ts

@@ -0,0 +1,31 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'project' },
+})
+export class Project extends BaseModel {
+  @prop({ required: false, index: false, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '发布时间' })
+  time: string;
+  @prop({ required: false, index: true, zh: '行业分类' })
+  type: string;
+  @prop({ required: false, index: true, zh: '成熟度' })
+  maturity: string;
+  @prop({ required: false, index: true, zh: '技术类型' })
+  skill: string;
+  @prop({ required: false, index: true, zh: '领域' })
+  field: string;
+  @prop({ required: false, index: true, zh: '合作类型' })
+  cooperate: string;
+  @prop({ required: false, index: true, zh: '项目地区' })
+  area: Array<any>;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '是否公开' })
+  is_use: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 27 - 0
src/entity/platform/sign.entity.ts

@@ -0,0 +1,27 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'sign' },
+})
+export class Sign extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '赛事id' })
+  match: string;
+  @prop({ required: false, index: true, zh: '姓名' })
+  name: string;
+  @prop({ required: false, index: false, zh: '电话号' })
+  phone: string;
+  @prop({ required: false, index: false, zh: '证件类型' })
+  cardType: string;
+  @prop({ required: false, index: false, zh: '证件号码' })
+  card: string;
+  @prop({ required: false, index: false, zh: '微信/QQ' })
+  communication: string;
+  @prop({ required: false, index: false, zh: '电子邮箱' })
+  email: string;
+  @prop({ required: false, index: false, zh: '报名时间' })
+  time: string;
+  @prop({ required: false, index: false, zh: '备注' })
+  remark: string;
+}

+ 33 - 0
src/entity/platform/supply.entity.ts

@@ -0,0 +1,33 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'supply' },
+})
+export class Supply extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '类型' })
+  type: string;
+  @prop({ required: false, index: true, zh: '行业领域' })
+  field: string;
+  @prop({ required: false, index: false, zh: '需求紧急度' })
+  urgent: string;
+  @prop({ required: false, index: true, zh: '合作方式' })
+  method: string;
+  @prop({ required: false, index: false, zh: '有效期' })
+  time: Array<any>;
+  @prop({ required: false, index: false, zh: '价格' })
+  money: string;
+  @prop({ required: false, index: true, zh: '需求地区' })
+  area: Array<any>;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '需求状态', default: '0' })
+  demand_status: string;
+  @prop({ required: false, index: true, zh: '是否公开', default: '1' })
+  is_use: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 23 - 0
src/entity/platform/tags.entity.ts

@@ -0,0 +1,23 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'tags' },
+})
+export class Tags extends BaseModel {
+  @prop({ required: false, index: true, zh: '标题' })
+  title: string;
+  @prop({ required: false, index: true, zh: '类型', default: '1' })
+  type: string;
+  @prop({ required: false, index: false, zh: '路由' })
+  href: string;
+  @prop({ required: false, index: false, zh: '英文标题' })
+  English: string;
+  @prop({ required: false, index: false, zh: '子菜单' })
+  children: Array<any>;
+  @prop({ required: false, index: false, zh: '排序' })
+  sort: number;
+  @prop({ required: false, index: false, zh: '备注' })
+  remark: string;
+  @prop({ required: false, index: false, zh: '是否使用', default: '0' })
+  is_use: string;
+}

+ 34 - 0
src/entity/system/admin.entity.ts

@@ -0,0 +1,34 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+import { isString } from 'lodash';
+@modelOptions({
+  schemaOptions: { collection: 'admin' },
+})
+export class Admin extends BaseModel {
+  @prop({ required: true, index: true, zh: '账号' })
+  account: string;
+  @prop({ required: false, index: false, zh: '名称' })
+  nick_name: string;
+  // 手动删除set前的大括号,处理太麻烦了.就手动删除吧
+  @prop({
+    required: false,
+    index: false,
+    zh: '密码',
+    select: false,
+    set: val => {
+      if (isString(val)) {
+        return { secret: val };
+      }
+      return val;
+    },
+  })
+  password: object;
+  @prop({ required: false, index: false, zh: '是否是超级管理员', remark: '0:超级管理员;1普通用户', default: '1' })
+  is_super: string;
+  @prop({ required: false, index: false, zh: '角色' })
+  role: string;
+  @prop({ required: false, index: false, zh: 'openid' })
+  openid: string;
+  @prop({ required: false, index: false, zh: '是否启用', default: '0' })
+  is_use: string;
+}

+ 15 - 0
src/entity/system/config.entity.ts

@@ -0,0 +1,15 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'config' },
+})
+export class Config extends BaseModel {
+  @prop({ required: false, index: false, zh: 'logo' })
+  logo: Array<any>;
+  @prop({ required: false, index: false, zh: '早餐时间', remark: '' })
+  b_time: Array<any>;
+  @prop({ required: false, index: false, zh: '午餐时间' })
+  l_time: Array<any>;
+  @prop({ required: false, index: false, zh: '晚餐时间' })
+  d_time: Array<any>;
+}

+ 19 - 0
src/entity/system/dictData.entity.ts

@@ -0,0 +1,19 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dictData' },
+})
+export class DictData extends BaseModel {
+  @prop({ required: false, index: true, zh: '字典类型编码' })
+  code: string;
+  @prop({ required: false, index: false, zh: '数据显示值' })
+  label: string;
+  @prop({ required: false, index: false, zh: '数据选择值' })
+  value: string;
+  @prop({ required: false, index: false, zh: '排序' })
+  sort: number;
+  @prop({ required: false, index: false, zh: '备注' })
+  remark: string;
+  @prop({ required: false, index: true, zh: '是否使用', default: '0' })
+  is_use: string;
+}

+ 15 - 0
src/entity/system/dictType.entity.ts

@@ -0,0 +1,15 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dictType' },
+})
+export class DictType extends BaseModel {
+  @prop({ required: false, index: false, zh: '字典类型名称' })
+  title: string;
+  @prop({ required: false, index: true, zh: '编码' })
+  code: string;
+  @prop({ required: false, index: false, zh: '备注' })
+  remark: string;
+  @prop({ required: false, index: true, zh: '是否使用', default: '0' })
+  is_use: string;
+}

+ 33 - 0
src/entity/system/menus.entity.ts

@@ -0,0 +1,33 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'menus' },
+})
+export class Menus extends BaseModel {
+  @prop({ required: false, index: false, zh: '菜单名称' })
+  name: string;
+  @prop({ required: false, index: false, zh: '路由名称', remark: '英文' })
+  route_name: string;
+  @prop({ required: false, index: false, zh: '国际化编码' })
+  i18n_code: string;
+  @prop({ required: false, index: true, zh: '父级菜单' })
+  parent_id: string;
+  @prop({ required: false, index: false, zh: '显示顺序' })
+  order_num: number;
+  @prop({ required: false, index: false, zh: '路由地址' })
+  path: string;
+  @prop({ required: false, index: false, zh: '组件地址' })
+  component: string;
+  @prop({ required: false, index: true, zh: '菜单类型', remark: '0:目录;1:菜单;2:子页面' })
+  type: string;
+  @prop({ required: false, index: false, zh: '图标' })
+  icon: string;
+  @prop({ required: false, index: false, zh: '功能列表', remark: '不在功能列表中的功能不能使用' })
+  config: Array<any>;
+  @prop({ required: false, index: true, zh: '是否为默认菜单', default: '1', remark: '默认:0,非默认:1; 默认不能删除' })
+  is_default: string;
+  @prop({ required: false, index: false, zh: '备注' })
+  remark: string;
+  @prop({ required: false, index: true, zh: '是否启用', default: '0' })
+  is_use: string;
+}

+ 17 - 0
src/entity/system/role.entity.ts

@@ -0,0 +1,17 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'role' },
+})
+export class Role extends BaseModel {
+  @prop({ required: false, index: false, zh: '角色名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '角色编码' })
+  code: string;
+  @prop({ required: false, index: false, zh: '菜单' })
+  menu: Array<any>;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '是否使用', default: '0' })
+  is_use: string;
+}

+ 36 - 0
src/entity/system/user.entity.ts

@@ -0,0 +1,36 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+import { isString } from 'lodash';
+@modelOptions({
+  schemaOptions: { collection: 'user' },
+})
+export class User extends BaseModel {
+  @prop({ required: false, index: true, zh: '账号' })
+  account: string;
+  // 手动删除set前的大括号,处理太麻烦了.就手动删除吧
+  @prop({
+    required: false,
+    index: false,
+    zh: '密码',
+    select: false,
+    set: val => {
+      if (isString(val)) {
+        return { secret: val };
+      }
+      return val;
+    },
+  })
+  password: object;
+  @prop({ required: false, index: false, zh: '昵称' })
+  nick_name: string;
+  @prop({ required: false, index: false, zh: '性别' })
+  gender: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '电子邮箱' })
+  email: string;
+  @prop({ required: false, index: false, zh: '角色' })
+  role: Array<any>;
+  @prop({ required: false, index: true, zh: '状态', default: '1' })
+  status: string;
+}

+ 23 - 0
src/entity/users/association.entity.ts

@@ -0,0 +1,23 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'association' },
+})
+export class Association extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: false, zh: '负责人' })
+  person: string;
+  @prop({ required: false, index: true, zh: '负责人电话' })
+  person_phone: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '地址' })
+  address: string;
+  @prop({ required: false, index: true, zh: '是否公开' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 45 - 0
src/entity/users/company.entity.ts

@@ -0,0 +1,45 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'company' },
+})
+export class Company extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '企业名称' })
+  name: string;
+  @prop({ required: false, index: false, zh: 'logo' })
+  logo: Array<any>;
+  @prop({ required: false, index: false, zh: '统一信用代码' })
+  code: string;
+  @prop({ required: false, index: false, zh: '企业类型' })
+  pattern: string;
+  @prop({ required: false, index: false, zh: '企业规模' })
+  scale: string;
+  @prop({ required: false, index: true, zh: '联系电话' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '所属行业' })
+  type: string;
+  @prop({ required: false, index: true, zh: '所在地区' })
+  area: Array<any>;
+  @prop({ required: false, index: false, zh: '法定代表人' })
+  representative: string;
+  @prop({ required: false, index: false, zh: '电子邮箱' })
+  email: string;
+  @prop({ required: false, index: true, zh: '员工人数' })
+  person: number;
+  @prop({ required: false, index: false, zh: '注册资本' })
+  register: string;
+  @prop({ required: false, index: false, zh: '成立日期' })
+  create_time: string;
+  @prop({ required: false, index: false, zh: '地址' })
+  address: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '是否公开' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '公司状态', default: '0' })
+  companyStatus: string;
+  @prop({ required: false, index: true, zh: '状态', default: '0' })
+  status: string;
+}

+ 23 - 0
src/entity/users/competition.entity.ts

@@ -0,0 +1,23 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'competition' },
+})
+export class Competition extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '负责人名称' })
+  person: string;
+  @prop({ required: false, index: true, zh: '负责人电话' })
+  person_phone: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '地址' })
+  address: string;
+  @prop({ required: false, index: true, zh: '是否公开' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 41 - 0
src/entity/users/expert.entity.ts

@@ -0,0 +1,41 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'expert' },
+})
+export class Expert extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '专家姓名' })
+  name: string;
+  @prop({ required: false, index: false, zh: '头像' })
+  icon: Array<any>;
+  @prop({ required: false, index: true, zh: '性别' })
+  gender: string;
+  @prop({ required: false, index: false, zh: '出生年月' })
+  birth: string;
+  @prop({ required: false, index: false, zh: '证件类型' })
+  cardType: string;
+  @prop({ required: false, index: false, zh: '证件号码' })
+  card: string;
+  @prop({ required: false, index: true, zh: '联系电话' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '所属领域' })
+  field: string;
+  @prop({ required: false, index: true, zh: '研究方向' })
+  direction: string;
+  @prop({ required: false, index: true, zh: '工作单位' })
+  work: string;
+  @prop({ required: false, index: true, zh: '学历' })
+  education: string;
+  @prop({ required: false, index: true, zh: '职称' })
+  title: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '所在地区' })
+  area: Array<any>;
+  @prop({ required: false, index: true, zh: '是否公开' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '状态', default: '0' })
+  status: string;
+}

+ 23 - 0
src/entity/users/incubator.entity.ts

@@ -0,0 +1,23 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'incubator' },
+})
+export class Incubator extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: false, zh: '负责人姓名' })
+  person: string;
+  @prop({ required: false, index: true, zh: '负责人电话' })
+  person_phone: string;
+  @prop({ required: false, index: false, zh: '地址' })
+  address: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '是否公开', default: '0' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '状态', default: '0' })
+  status: string;
+}

+ 29 - 0
src/entity/users/investment.entity.ts

@@ -0,0 +1,29 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'investment' },
+})
+export class Investment extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '投资人姓名' })
+  name: string;
+  @prop({ required: false, index: false, zh: '投资人证件类型' })
+  cardType: string;
+  @prop({ required: false, index: false, zh: '投资人证件号码' })
+  card: string;
+  @prop({ required: false, index: false, zh: ' 投资人出资额' })
+  money: string;
+  @prop({ required: false, index: true, zh: '投资人出资方式' })
+  type: string;
+  @prop({ required: false, index: false, zh: '投资人的住所地' })
+  address: string;
+  @prop({ required: false, index: false, zh: '投资人的联系方式' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '是否公开' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 25 - 0
src/entity/users/state.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'state' },
+})
+export class State extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: false, zh: '负责人' })
+  person: string;
+  @prop({ required: false, index: false, zh: '负责人电话' })
+  person_phone: string;
+  @prop({ required: false, index: true, zh: '部门类型' })
+  type: string;
+  @prop({ required: false, index: true, zh: '地址' })
+  address: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: true, zh: '是否公开' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 23 - 0
src/entity/users/unit.entity.ts

@@ -0,0 +1,23 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'unit' },
+})
+export class Unit extends BaseModel {
+  @prop({ required: false, index: true, zh: '平台用户id' })
+  user: string;
+  @prop({ required: false, index: false, zh: '科研机构名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '联系人' })
+  person: string;
+  @prop({ required: false, index: true, zh: '联系电话' })
+  person_phone: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '地址' })
+  address: string;
+  @prop({ required: false, index: true, zh: '是否公开' })
+  is_show: string;
+  @prop({ required: false, index: true, zh: '状态' })
+  status: string;
+}

+ 17 - 0
src/entityRecord/dataLogs.entity.ts

@@ -0,0 +1,17 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dataLogs' },
+})
+export class DataLogs extends BaseModel {
+  @prop({ required: false, index: true, zh: '表' }) //, esType: 'keyword'
+  coll: string;
+  @prop({ required: false, index: false, zh: '数据id' })
+  data_id: string;
+  @prop({ required: false, index: false, zh: '时间' })
+  time: string;
+  @prop({ required: false, index: false, zh: '数据库操作方法' })
+  method: string;
+  @prop({ required: false, index: false, zh: '数据' })
+  data: object;
+}

+ 29 - 0
src/entityRecord/dataRecord.entity.ts

@@ -0,0 +1,29 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dataRecord' },
+})
+export class DataRecord extends BaseModel {
+  @prop({ required: false, index: false, zh: '操作人' })
+  operator: object;
+  @prop({ required: false, index: false, zh: 'ip地址' })
+  ip: string;
+  @prop({ required: false, index: false, zh: '时间' })
+  time: string;
+  @prop({ required: false, index: false, zh: '对象', remark: 'controller' })
+  controller: string;
+  @prop({ required: false, index: false, zh: '函数', remark: '函数名,记录code.i18n兑换用' })
+  method: string;
+  @prop({ required: false, index: false, zh: '原数据', remark: '多个表关联性处理时需要先将修改的数据都查出来,key:表名;value:数组(本表修改的数据都放里面)' })
+  origin_data: object;
+  @prop({ required: false, index: false, zh: '新数据' })
+  new_data: object;
+  @prop({ required: false, index: false, zh: '页面路由' })
+  router: string;
+  @prop({ required: false, index: false, zh: '设备' })
+  device: string;
+  @prop({ required: false, index: false, zh: '状态', remark: '0:成功;-1失败' })
+  status: string;
+  @prop({ required: false, index: false, zh: 'es是否同步', default: false })
+  es_sync: boolean;
+}

+ 14 - 0
src/error/elasticsearch.error.ts

@@ -0,0 +1,14 @@
+import { MidwayError, registerErrorCode } from '@midwayjs/core';
+
+export enum ErrorCode {
+  ES_ERROR = '-3000',
+  ES_INDEX_NOT_FOUND = '-3001',
+  ES_DATA_NOT_FOUND = '-3404'
+}
+export const EsErrorEnum = registerErrorCode('EsError', ErrorCode);
+
+export class ElasticSearchError extends MidwayError {
+  constructor(str: string, errcode: string = ErrorCode.ES_ERROR) {
+    super(str, errcode);
+  }
+}

+ 16 - 0
src/error/frame.error.ts

@@ -0,0 +1,16 @@
+import { registerErrorCode } from '@midwayjs/core';
+
+export enum ErrorCode {
+  SERVICE_ERROR = '400',
+  SERVICE_CANT_USE = '400-1',
+  NO_PERMISSION = '401',
+  USER_NOT_FOUND = '401-1',
+  BAD_PASSWORD = '401-2',
+  NOT_LOGIN = '401-3',
+  ACCOUNT_HAS_EXPIRED = '401-4',
+  ACCOUNT_LOGGED_IN_ELESWHERE = '401-5',
+  USER_IS_DISABLED = '401-6',
+  ROLE_IS_DISABLED = '401-7',
+  SERVICE_REPEAT = '401-8',
+}
+export const FrameErrorEnum = registerErrorCode('FrameError', ErrorCode);

+ 6 - 0
src/interface.ts

@@ -0,0 +1,6 @@
+/**
+ * @description User-Service parameters
+ */
+export interface IUserOptions {
+  uid: number;
+}

+ 42 - 0
src/interface/login.interface.ts

@@ -0,0 +1,42 @@
+import { ApiProperty } from '@midwayjs/swagger';
+import { Rule, RuleType } from '@midwayjs/validate';
+import { get } from 'lodash';
+export enum LoginType {
+  Admin = 'Admin',
+  User = 'User',
+}
+
+export class LoginDTO {
+  @ApiProperty({ description: '账号' })
+  @Rule(RuleType['string']().required())
+  account: string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().required())
+  password: string = undefined;
+}
+
+export class UPwdDTO {
+  @ApiProperty({ description: '用户数据id' })
+  @Rule(RuleType['string']().required())
+  _id: string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().required())
+  password: string = undefined;
+}
+
+export class LoginVO {
+  constructor(data: object) {
+    this._id = get(data, '_id');
+    this.nick_name = get(data, 'nick_name');
+    this.openid = get(data, 'openid');
+    this.role = get(data, 'role');
+    this.is_super = get(data, 'is_super');
+  }
+  _id: string;
+  nick_name: string;
+  openid: string;
+  role: string;
+  is_super: number;
+  @ApiProperty({ description: '登录标识' })
+  'login_code': string = undefined;
+}

+ 160 - 0
src/interface/platform/achievement.interface.ts

@@ -0,0 +1,160 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_achievement {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '专利号' })
+  'patent': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '属性' })
+  'attribute': string = undefined;
+  @ApiProperty({ description: '出让方式' })
+  'sell': string = undefined;
+  @ApiProperty({ description: '成熟度' })
+  'mature': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '技术分类' })
+  'technology': string = undefined;
+  @ApiProperty({ description: '成果地区' })
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '发布时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '参考价格' })
+  'money': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '附件' })
+  'file': Array<any> = undefined;
+  @ApiProperty({ description: '成果状态' })
+  'achievement_status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_achievement extends SearchBase {
+  constructor() {
+    const like_prop = ['name'];
+    const props = ['user', 'patent', 'name', 'attribute', 'sell', 'mature', 'field', 'technology', 'money', 'status', 'achievement_status', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '专利号' })
+  'patent': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '属性' })
+  'attribute': string = undefined;
+  @ApiProperty({ description: '出让方式' })
+  'sell': string = undefined;
+  @ApiProperty({ description: '成熟度' })
+  'mature': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '技术分类' })
+  'technology': string = undefined;
+  @ApiProperty({ description: '参考价格' })
+  'money': string = undefined;
+  @ApiProperty({ description: '成果状态' })
+  'achievement_status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_achievement extends FVO_achievement {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_achievement {
+  @ApiProperty({ description: '用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '专利号' })
+  @Rule(RuleType['string']().empty(''))
+  'patent': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '属性' })
+  @Rule(RuleType['string']().empty(''))
+  'attribute': string = undefined;
+  @ApiProperty({ description: '出让方式' })
+  @Rule(RuleType['string']().empty(''))
+  'sell': string = undefined;
+  @ApiProperty({ description: '成熟度' })
+  @Rule(RuleType['string']().empty(''))
+  'mature': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  @Rule(RuleType['string']().empty(''))
+  'field': string = undefined;
+  @ApiProperty({ description: '技术分类' })
+  @Rule(RuleType['string']().empty(''))
+  'technology': string = undefined;
+  @ApiProperty({ description: '成果地区' })
+  @Rule(RuleType['array']().empty(''))
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '发布时间' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+  @ApiProperty({ description: '参考价格' })
+  @Rule(RuleType['string']().empty(''))
+  'money': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '附件' })
+  @Rule(RuleType['array']().empty(''))
+  'file': Array<any> = undefined;
+  @ApiProperty({ description: 'achievement_status' })
+  @Rule(RuleType['string']().empty(''))
+  'achievement_status': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_achievement extends FVO_achievement {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_achievement extends CDTO_achievement {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_achievement extends FVO_achievement {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 90 - 0
src/interface/platform/chat.interface.ts

@@ -0,0 +1,90 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_chat {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '发送者id' })
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '接收者id' })
+  'receiver_id': string = undefined;
+  @ApiProperty({ description: '内容类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '内容' })
+  'content': string = undefined;
+  @ApiProperty({ description: '发送时间' })
+  'send_time': string = undefined;
+  @ApiProperty({ description: '是否已读' })
+  'is_read': string = undefined;
+}
+
+export class QDTO_chat extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['sender_id', 'content'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '发送者id' })
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '内容' })
+  'content': string = undefined;
+}
+
+export class QVO_chat extends FVO_chat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_chat {
+  @ApiProperty({ description: '发送者id' })
+  @Rule(RuleType['string']().empty(''))
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '接收者id' })
+  @Rule(RuleType['string']().empty(''))
+  'receiver_id': string = undefined;
+  @ApiProperty({ description: '内容类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '内容' })
+  @Rule(RuleType['string']().empty(''))
+  'content': string = undefined;
+  @ApiProperty({ description: '发送时间' })
+  @Rule(RuleType['string']().empty(''))
+  'send_time': string = undefined;
+  @ApiProperty({ description: '是否已读' })
+  @Rule(RuleType['string']().empty(''))
+  'is_read': string = undefined;
+}
+
+export class CVO_chat extends FVO_chat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_chat extends CDTO_chat {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_chat extends FVO_chat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 82 - 0
src/interface/platform/collection.interface.ts

@@ -0,0 +1,82 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_collection {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '来源id' })
+  'source': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '收藏时间' })
+  'time': string = undefined;
+}
+
+export class QDTO_collection extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'source', 'type'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '来源id' })
+  'source': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+}
+
+export class QVO_collection extends FVO_collection {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_collection {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '来源id' })
+  @Rule(RuleType['string']().empty(''))
+  'source': string = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '收藏时间' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+}
+
+export class CVO_collection extends FVO_collection {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_collection extends CDTO_collection {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_collection extends FVO_collection {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 139 - 0
src/interface/platform/demand.interface.ts

@@ -0,0 +1,139 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_demand {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '需求紧急度' })
+  'urgent': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  'method': string = undefined;
+  @ApiProperty({ description: '有效期' })
+  'time': Array<any> = undefined;
+  @ApiProperty({ description: '价格' })
+  'money': string = undefined;
+  @ApiProperty({ description: '需求地区' })
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '需求状态' })
+  'demand_status': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_demand extends SearchBase {
+  constructor() {
+    const like_prop = ['name'];
+    const props = ['user', 'name', 'type', 'field', 'urgent', 'method', 'demand_status', 'status', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  'method': string = undefined;
+  @ApiProperty({ description: '需求紧急度' })
+  'urgent': string = undefined;
+  @ApiProperty({ description: '需求状态' })
+  'demand_status': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+}
+
+export class QVO_demand extends FVO_demand {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_demand {
+  @ApiProperty({ description: '用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  @Rule(RuleType['string']().empty(''))
+  'field': string = undefined;
+  @ApiProperty({ description: '需求紧急度' })
+  @Rule(RuleType['string']().empty(''))
+  'urgent': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  @Rule(RuleType['string']().empty(''))
+  'method': string = undefined;
+  @ApiProperty({ description: '有效期' })
+  @Rule(RuleType['array']().empty(''))
+  'time': Array<any> = undefined;
+  @ApiProperty({ description: '价格' })
+  @Rule(RuleType['string']().empty(''))
+  'money': string = undefined;
+  @ApiProperty({ description: '需求地区' })
+  @Rule(RuleType['array']().empty(''))
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '需求状态' })
+  @Rule(RuleType['string']().empty(''))
+  'demand_status': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_demand extends FVO_demand {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_demand extends CDTO_demand {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_demand extends FVO_demand {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 96 - 0
src/interface/platform/design.interface.ts

@@ -0,0 +1,96 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_design {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '标题' })
+  'zhTitle': string = undefined;
+  @ApiProperty({ description: '英文标题' })
+  'zhEnglish': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'zhBrief': string = undefined;
+  @ApiProperty({ description: '使用协议' })
+  'agreement': string = undefined;
+  @ApiProperty({ description: '关于我们' })
+  'brief': string = undefined;
+  @ApiProperty({ description: 'logo' })
+  'logoUrl': Array<any> = undefined;
+  @ApiProperty({ description: '视频' })
+  'videoUrl': Array<any> = undefined;
+  @ApiProperty({ description: '网站底部信息' })
+  'footInfo': object = undefined;
+}
+
+export class QDTO_design extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+}
+
+export class QVO_design extends FVO_design {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_design {
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'zhTitle': string = undefined;
+  @ApiProperty({ description: '英文标题' })
+  @Rule(RuleType['string']().empty(''))
+  'zhEnglish': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'zhBrief': string = undefined;
+  @ApiProperty({ description: '使用协议' })
+  @Rule(RuleType['string']().empty(''))
+  'agreement': string = undefined;
+  @ApiProperty({ description: '关于我们' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: 'logo' })
+  @Rule(RuleType['array']().empty(''))
+  'logoUrl': Array<any> = undefined;
+  @ApiProperty({ description: '视频' })
+  @Rule(RuleType['array']().empty(''))
+  'videoUrl': Array<any> = undefined;
+  @ApiProperty({ description: '网站底部信息' })
+  @Rule(RuleType['object']().empty(''))
+  'footInfo': object = undefined;
+}
+
+export class CVO_design extends FVO_design {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_design extends CDTO_design {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_design extends FVO_design {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 142 - 0
src/interface/platform/match.interface.ts

@@ -0,0 +1,142 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_match {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '组织单位' })
+  'work': string = undefined;
+  @ApiProperty({ description: '行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '类别' })
+  'form': string = undefined;
+  @ApiProperty({ description: '有效期' })
+  'time': Array<any> = undefined;
+  @ApiProperty({ description: '奖金' })
+  'money': string = undefined;
+  @ApiProperty({ description: '赛事规则' })
+  'rules': object = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '封面' })
+  'file': Array<any> = undefined;
+  @ApiProperty({ description: '赛事状态' })
+  'match_status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_match extends SearchBase {
+  constructor() {
+    const like_prop = ['name'];
+    const props = ['user', 'industry', 'name', 'type', 'status', 'form', 'match_status', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '类别' })
+  'form': string = undefined;
+  @ApiProperty({ description: '赛事状态' })
+  'match_status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_match extends FVO_match {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_match {
+  @ApiProperty({ description: '用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '组织单位' })
+  @Rule(RuleType['string']().empty(''))
+  'work': string = undefined;
+  @ApiProperty({ description: '行业' })
+  @Rule(RuleType['string']().empty(''))
+  'industry': string = undefined;
+  @ApiProperty({ description: '类别' })
+  @Rule(RuleType['string']().empty(''))
+  'form': string = undefined;
+  @ApiProperty({ description: '有效期' })
+  @Rule(RuleType['array']().empty(''))
+  'time': Array<any> = undefined;
+  @ApiProperty({ description: '奖金' })
+  @Rule(RuleType['string']().empty(''))
+  'money': string = undefined;
+  @ApiProperty({ description: '赛事规则' })
+  @Rule(RuleType['object']().empty(''))
+  'rules': object = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '封面' })
+  @Rule(RuleType['array']().empty(''))
+  'file': Array<any> = undefined;
+  @ApiProperty({ description: '赛事状态' })
+  @Rule(RuleType['string']().empty(''))
+  'match_status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_match extends FVO_match {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_match extends CDTO_match {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_match extends FVO_match {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 113 - 0
src/interface/platform/news.interface.ts

@@ -0,0 +1,113 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_news {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '封面' })
+  'logo': Array<any> = undefined;
+  @ApiProperty({ description: '发布人' })
+  'person': string = undefined;
+  @ApiProperty({ description: '发布时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '内容' })
+  'content': string = undefined;
+  @ApiProperty({ description: '浏览次数' })
+  'number': number = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_news extends SearchBase {
+  constructor() {
+    const like_prop = ['title'];
+    const props = ['title', 'person', 'time', 'type', 'is_use', 'status'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '发布人' })
+  'person': string = undefined;
+  @ApiProperty({ description: '发布时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_news extends FVO_news {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_news {
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'title': string = undefined;
+  @ApiProperty({ description: '封面' })
+  @Rule(RuleType['array']().empty(''))
+  'logo': Array<any> = undefined;
+  @ApiProperty({ description: '发布人' })
+  @Rule(RuleType['string']().empty(''))
+  'person': string = undefined;
+  @ApiProperty({ description: '发布时间' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+  @ApiProperty({ description: '内容' })
+  @Rule(RuleType['string']().empty(''))
+  'content': string = undefined;
+  @ApiProperty({ description: '浏览次数' })
+  @Rule(RuleType['number']().empty(''))
+  'number': number = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_news extends FVO_news {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_news extends CDTO_news {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_news extends FVO_news {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 137 - 0
src/interface/platform/project.interface.ts

@@ -0,0 +1,137 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_project {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '发布时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '行业分类' })
+  'type': string = undefined;
+  @ApiProperty({ description: '成熟度' })
+  'maturity': string = undefined;
+  @ApiProperty({ description: '技术类型' })
+  'skill': string = undefined;
+  @ApiProperty({ description: '领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '合作类型' })
+  'cooperate': string = undefined;
+  @ApiProperty({ description: '需求地区' })
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_project extends SearchBase {
+  constructor() {
+    const like_prop = ['name'];
+    const props = ['user', 'name', 'time', 'type', 'maturity', 'skill', 'field', 'cooperate', 'status', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '发布时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '行业分类' })
+  'type': string = undefined;
+  @ApiProperty({ description: '成熟度' })
+  'maturity': string = undefined;
+  @ApiProperty({ description: '技术类型' })
+  'skill': string = undefined;
+  @ApiProperty({ description: '领域' })
+  'field': string = undefined;
+
+  @ApiProperty({ description: '合作类型' })
+  'cooperate': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+}
+
+export class QVO_project extends FVO_project {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_project {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '发布时间' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+  @ApiProperty({ description: '行业分类' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '成熟度' })
+  @Rule(RuleType['string']().empty(''))
+  'maturity': string = undefined;
+  @ApiProperty({ description: '技术类型' })
+  @Rule(RuleType['string']().empty(''))
+  'skill': string = undefined;
+  @ApiProperty({ description: '领域' })
+  @Rule(RuleType['string']().empty(''))
+  'field': string = undefined;
+  @ApiProperty({ description: '成果地区' })
+  @Rule(RuleType['array']().empty(''))
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '合作类型' })
+  @Rule(RuleType['string']().empty(''))
+  'cooperate': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_project extends FVO_project {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_project extends CDTO_project {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_project extends FVO_project {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 114 - 0
src/interface/platform/sign.interface.ts

@@ -0,0 +1,114 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_sign {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '赛事id' })
+  'match': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '电话号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '证件类型' })
+  'cardType': string = undefined;
+  @ApiProperty({ description: '证件号码' })
+  'card': string = undefined;
+  @ApiProperty({ description: '微信/QQ' })
+  'communication': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '报名时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '备注' })
+  'remark': string = undefined;
+}
+
+export class QDTO_sign extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'match', 'time', 'name'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '赛事id' })
+  'match': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '报名时间' })
+  'time': string = undefined;
+}
+
+export class QVO_sign extends FVO_sign {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_sign {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '赛事id' })
+  @Rule(RuleType['string']().empty(''))
+  'match': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '电话号' })
+  @Rule(RuleType['string']().empty(''))
+  'phone': string = undefined;
+  @ApiProperty({ description: '证件类型' })
+  @Rule(RuleType['string']().empty(''))
+  'cardType': string = undefined;
+  @ApiProperty({ description: '证件号码' })
+  @Rule(RuleType['string']().empty(''))
+  'card': string = undefined;
+  @ApiProperty({ description: '微信/QQ' })
+  @Rule(RuleType['string']().empty(''))
+  'communication': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  @Rule(RuleType['string']().empty(''))
+  'email': string = undefined;
+  @ApiProperty({ description: '报名时间' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+  @ApiProperty({ description: '备注' })
+  @Rule(RuleType['string']().empty(''))
+  'remark': string = undefined;
+}
+
+export class CVO_sign extends FVO_sign {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_sign extends CDTO_sign {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_sign extends FVO_sign {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 139 - 0
src/interface/platform/supply.interface.ts

@@ -0,0 +1,139 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_supply {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '需求紧急度' })
+  'urgent': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  'method': string = undefined;
+  @ApiProperty({ description: '有效期' })
+  'time': string = undefined;
+  @ApiProperty({ description: '价格' })
+  'money': string = undefined;
+  @ApiProperty({ description: '需求地区' })
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '需求状态' })
+  'demand_status': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_supply extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'name', 'type', 'field', 'method', 'area', 'demand_status', 'status', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  'method': string = undefined;
+  @ApiProperty({ description: '需求地区' })
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '需求状态' })
+  'demand_status': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_use': string = undefined;
+}
+
+export class QVO_supply extends FVO_supply {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_supply {
+  @ApiProperty({ description: '用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '行业领域' })
+  @Rule(RuleType['string']().empty(''))
+  'field': string = undefined;
+  @ApiProperty({ description: '需求紧急度' })
+  @Rule(RuleType['string']().empty(''))
+  'urgent': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  @Rule(RuleType['string']().empty(''))
+  'method': string = undefined;
+  @ApiProperty({ description: '有效期' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+  @ApiProperty({ description: '价格' })
+  @Rule(RuleType['string']().empty(''))
+  'money': string = undefined;
+  @ApiProperty({ description: '需求地区' })
+  @Rule(RuleType['array']().empty(''))
+  'area': Array<any> = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '需求状态' })
+  @Rule(RuleType['string']().empty(''))
+  'demand_status': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_supply extends FVO_supply {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_supply extends CDTO_supply {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_supply extends FVO_supply {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 102 - 0
src/interface/platform/tags.interface.ts

@@ -0,0 +1,102 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_tags {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '路由' })
+  'href': string = undefined;
+  @ApiProperty({ description: '排序' })
+  'sort': number = undefined;
+  @ApiProperty({ description: '英文标题' })
+  'English': string = undefined;
+  @ApiProperty({ description: '子菜单' })
+  'children': Array<any> = undefined;
+  @ApiProperty({ description: '备注' })
+  'remark': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_tags extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['title', 'type', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_tags extends FVO_tags {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_tags {
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'title': string = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '路由' })
+  @Rule(RuleType['string']().empty(''))
+  'href': string = undefined;
+  @ApiProperty({ description: '英文标题' })
+  @Rule(RuleType['string']().empty(''))
+  'English': string = undefined;
+  @ApiProperty({ description: '排序' })
+  @Rule(RuleType['number']().empty(''))
+  'sort': number = undefined;
+  @ApiProperty({ description: '子菜单' })
+  @Rule(RuleType['array']().empty(''))
+  'children': Array<any> = undefined;
+  @ApiProperty({ description: '备注' })
+  @Rule(RuleType['string']().empty(''))
+  'remark': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_tags extends FVO_tags {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_tags extends CDTO_tags {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_tags extends FVO_tags {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 83 - 0
src/interface/record/dataLogs.interface.ts

@@ -0,0 +1,83 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_dataLogs {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '表' })
+  'collection': string = undefined;
+  @ApiProperty({ description: '数据id' })
+  'id': string = undefined;
+  @ApiProperty({ description: '时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '数据库操作方法' })
+  'method': string = undefined;
+  @ApiProperty({ description: '数据' })
+  'data': object = undefined;
+}
+
+export class QDTO_dataLogs extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['collection'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '表' })
+  'collection': string = undefined;
+}
+
+export class QVO_dataLogs extends FVO_dataLogs {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dataLogs {
+  @ApiProperty({ description: '表' })
+  @Rule(RuleType['string']().empty(''))
+  'collection': string = undefined;
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  'id': string = undefined;
+  @ApiProperty({ description: '时间' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+  @ApiProperty({ description: '数据库操作方法' })
+  @Rule(RuleType['string']().empty(''))
+  'method': string = undefined;
+  @ApiProperty({ description: '数据' })
+  @Rule(RuleType['object']().empty(''))
+  'data': object = undefined;
+}
+
+export class CVO_dataLogs extends FVO_dataLogs {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dataLogs extends CDTO_dataLogs {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dataLogs extends FVO_dataLogs {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 0 - 0
src/interface/record/dataRecord.interface.ts


部分文件因为文件数量过多而无法显示