zs 2 gadi atpakaļ
vecāks
revīzija
ae2fd81cf1
74 mainītis faili ar 5419 papildinājumiem un 13 dzēšanām
  1. 2 3
      src/configuration.ts
  2. 89 0
      src/controller/channel/channel.controller.ts
  3. 89 0
      src/controller/product/product.controller.ts
  4. 89 0
      src/controller/technology/dock.controller.ts
  5. 89 0
      src/controller/technology/dockChat.controller.ts
  6. 89 0
      src/controller/technology/dockExpert.controller.ts
  7. 89 0
      src/controller/technology/dockImgtxt.controller.ts
  8. 89 0
      src/controller/technology/dockTrans.controller.ts
  9. 89 0
      src/controller/technology/dockUser.controller.ts
  10. 89 0
      src/controller/technology/dockVideo.controller.ts
  11. 89 0
      src/controller/train/train.controller.ts
  12. 89 0
      src/controller/train/trainChat.controller.ts
  13. 89 0
      src/controller/train/trainUser.controller.ts
  14. 89 0
      src/controller/train/trainVideo.controller.ts
  15. 71 2
      src/controller/user/admin.controller.ts
  16. 140 0
      src/controller/user/company.controller.ts
  17. 148 0
      src/controller/user/expert.controller.ts
  18. 61 2
      src/controller/user/personal.controller.ts
  19. 34 0
      src/entity/channel/channel.entity.ts
  20. 110 0
      src/entity/product/product.entity.ts
  21. 41 0
      src/entity/technology/dock.entity.ts
  22. 25 0
      src/entity/technology/dockChat.entity.ts
  23. 27 0
      src/entity/technology/dockExpert.entity.ts
  24. 25 0
      src/entity/technology/dockImgtxt.entity.ts
  25. 33 0
      src/entity/technology/dockTrans.entity.ts
  26. 27 0
      src/entity/technology/dockUser.entity.ts
  27. 25 0
      src/entity/technology/dockVideo.entity.ts
  28. 41 0
      src/entity/train/train.entity.ts
  29. 25 0
      src/entity/train/trainChat.entity.ts
  30. 26 0
      src/entity/train/trainUser.entity.ts
  31. 25 0
      src/entity/train/trainVideo.entity.ts
  32. 16 2
      src/entity/user/admin.entity.ts
  33. 80 0
      src/entity/user/company.entity.ts
  34. 86 0
      src/entity/user/expert.entity.ts
  35. 16 2
      src/entity/user/personal.entity.ts
  36. 115 0
      src/interface/channel/channel.interface.ts
  37. 248 0
      src/interface/product/product.interface.ts
  38. 154 0
      src/interface/technology/dock.interface.ts
  39. 102 0
      src/interface/technology/dockChat.interface.ts
  40. 113 0
      src/interface/technology/dockExpert.interface.ts
  41. 94 0
      src/interface/technology/dockImgtxt.interface.ts
  42. 134 0
      src/interface/technology/dockTrans.interface.ts
  43. 110 0
      src/interface/technology/dockUser.interface.ts
  44. 94 0
      src/interface/technology/dockVideo.interface.ts
  45. 160 0
      src/interface/train/train.interface.ts
  46. 94 0
      src/interface/train/trainChat.interface.ts
  47. 103 0
      src/interface/train/trainUser.interface.ts
  48. 94 0
      src/interface/train/trainVideo.interface.ts
  49. 42 0
      src/interface/user/admin.interface.ts
  50. 304 0
      src/interface/user/company.interface.ts
  51. 295 0
      src/interface/user/expert.interface.ts
  52. 57 0
      src/interface/user/personal.interface.ts
  53. 12 0
      src/interface/util/user.util.interface.ts
  54. 33 0
      src/middleware/checkToken.middleware.ts
  55. 11 0
      src/service/channel/channel.service.ts
  56. 11 0
      src/service/product/product.service.ts
  57. 11 0
      src/service/technology/dock.service.ts
  58. 11 0
      src/service/technology/dockChat.service.ts
  59. 11 0
      src/service/technology/dockExpert.service.ts
  60. 11 0
      src/service/technology/dockImgtxt.service.ts
  61. 11 0
      src/service/technology/dockTrans.service.ts
  62. 11 0
      src/service/technology/dockUser.service.ts
  63. 11 0
      src/service/technology/dockVideo.service.ts
  64. 11 0
      src/service/train/train.service.ts
  65. 11 0
      src/service/train/trainChat.service.ts
  66. 11 0
      src/service/train/trainUser.service.ts
  67. 11 0
      src/service/train/trainVideo.service.ts
  68. 20 1
      src/service/user/admin.service.ts
  69. 36 0
      src/service/user/company.service.ts
  70. 36 0
      src/service/user/expert.service.ts
  71. 26 1
      src/service/user/personal.service.ts
  72. 115 0
      src/service/util/user.util.ts
  73. 430 0
      src/util/pinyin.ts
  74. 14 0
      src/util/util.ts

+ 2 - 3
src/configuration.ts

@@ -12,7 +12,7 @@ import { join } from 'path';
 import * as FreeFrame from 'free-midway-component';
 // import { FrameworkErrorEnum, ServiceError } from 'free-midway-component';
 // 控制器执行前函数
-import { ReportMiddleware } from './middleware/report.middleware';
+import { CheckTokenMiddleware } from './middleware/checkToken.middleware';
 // 请求成功,失败提示
 // const axiosResponse = response => {
 //   if (response.status === 200) return response.data;
@@ -44,7 +44,6 @@ export class ContainerLifeCycle {
   app: koa.Application;
 
   async onReady() {
-    this.app.useMiddleware([ReportMiddleware]);
-    // this.app.getMiddleware().insertFirst(ReportMiddleware);
+    this.app.getMiddleware().insertFirst(CheckTokenMiddleware);
   }
 }

+ 89 - 0
src/controller/channel/channel.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { ChannelService } from '../../service/channel/channel.service';
+import {
+  CDTO_channel,
+  CVO_channel,
+  FVO_channel,
+  QDTO_channel,
+  QVO_channel,
+  UDTO_channel,
+  UVAO_channel,
+} from '../../interface/channel/channel.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技频道'])
+@Controller('/channel')
+export class ChannelController extends BaseController {
+  @Inject()
+  service: ChannelService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_channel })
+  async create(@Body() data: CDTO_channel) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_channel(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_channel })
+  async query(
+    @Query() filter: QDTO_channel,
+    @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_channel(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_channel })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_channel(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_channel })
+  async update(@Param('id') id: string, @Body() body: UDTO_channel) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/product/product.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { ProductService } from '../../service/product/product.service';
+import {
+  CDTO_product,
+  CVO_product,
+  FVO_product,
+  QDTO_product,
+  QVO_product,
+  UDTO_product,
+  UVAO_product,
+} from '../../interface/product/product.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['产品管理'])
+@Controller('/product')
+export class ProductController extends BaseController {
+  @Inject()
+  service: ProductService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_product })
+  async create(@Body() data: CDTO_product) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_product(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_product })
+  async query(
+    @Query() filter: QDTO_product,
+    @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_product(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_product })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_product(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_product })
+  async update(@Param('id') id: string, @Body() body: UDTO_product) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/technology/dock.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DockService } from '../../service/technology/dock.service';
+import {
+  CDTO_dock,
+  CVO_dock,
+  FVO_dock,
+  QDTO_dock,
+  QVO_dock,
+  UDTO_dock,
+  UVAO_dock,
+} from '../../interface/technology/dock.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技成果'])
+@Controller('/dock')
+export class DockController extends BaseController {
+  @Inject()
+  service: DockService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dock })
+  async create(@Body() data: CDTO_dock) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dock(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dock })
+  async query(
+    @Query() filter: QDTO_dock,
+    @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_dock(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dock })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dock(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dock })
+  async update(@Param('id') id: string, @Body() body: UDTO_dock) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/technology/dockChat.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DockChatService } from '../../service/technology/dockChat.service';
+import {
+  CDTO_dockChat,
+  CVO_dockChat,
+  FVO_dockChat,
+  QDTO_dockChat,
+  QVO_dockChat,
+  UDTO_dockChat,
+  UVAO_dockChat,
+} from '../../interface/technology/dockChat.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技成果-公共聊天'])
+@Controller('/dockChat')
+export class DockChatController extends BaseController {
+  @Inject()
+  service: DockChatService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dockChat })
+  async create(@Body() data: CDTO_dockChat) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dockChat(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dockChat })
+  async query(
+    @Query() filter: QDTO_dockChat,
+    @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_dockChat(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dockChat })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dockChat(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dockChat })
+  async update(@Param('id') id: string, @Body() body: UDTO_dockChat) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/technology/dockExpert.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DockExpertService } from '../../service/technology/dockExpert.service';
+import {
+  CDTO_dockExpert,
+  CVO_dockExpert,
+  FVO_dockExpert,
+  QDTO_dockExpert,
+  QVO_dockExpert,
+  UDTO_dockExpert,
+  UVAO_dockExpert,
+} from '../../interface/technology/dockExpert.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技成果-专家'])
+@Controller('/dockExpert')
+export class DockExpertController extends BaseController {
+  @Inject()
+  service: DockExpertService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dockExpert })
+  async create(@Body() data: CDTO_dockExpert) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dockExpert(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dockExpert })
+  async query(
+    @Query() filter: QDTO_dockExpert,
+    @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_dockExpert(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dockExpert })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dockExpert(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dockExpert })
+  async update(@Param('id') id: string, @Body() body: UDTO_dockExpert) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/technology/dockImgtxt.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DockImgtxtService } from '../../service/technology/dockImgtxt.service';
+import {
+  CDTO_dockImgtxt,
+  CVO_dockImgtxt,
+  FVO_dockImgtxt,
+  QDTO_dockImgtxt,
+  QVO_dockImgtxt,
+  UDTO_dockImgtxt,
+  UVAO_dockImgtxt,
+} from '../../interface/technology/dockImgtxt.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技成果-展会图文'])
+@Controller('/dockImgtxt')
+export class DockImgtxtController extends BaseController {
+  @Inject()
+  service: DockImgtxtService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dockImgtxt })
+  async create(@Body() data: CDTO_dockImgtxt) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dockImgtxt(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dockImgtxt })
+  async query(
+    @Query() filter: QDTO_dockImgtxt,
+    @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_dockImgtxt(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dockImgtxt })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dockImgtxt(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dockImgtxt })
+  async update(@Param('id') id: string, @Body() body: UDTO_dockImgtxt) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/technology/dockTrans.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DockTransService } from '../../service/technology/dockTrans.service';
+import {
+  CDTO_dockTrans,
+  CVO_dockTrans,
+  FVO_dockTrans,
+  QDTO_dockTrans,
+  QVO_dockTrans,
+  UDTO_dockTrans,
+  UVAO_dockTrans,
+} from '../../interface/technology/dockTrans.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技成果-交易'])
+@Controller('/dockTrans')
+export class DockTransController extends BaseController {
+  @Inject()
+  service: DockTransService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dockTrans })
+  async create(@Body() data: CDTO_dockTrans) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dockTrans(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dockTrans })
+  async query(
+    @Query() filter: QDTO_dockTrans,
+    @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_dockTrans(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dockTrans })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dockTrans(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dockTrans })
+  async update(@Param('id') id: string, @Body() body: UDTO_dockTrans) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/technology/dockUser.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DockUserService } from '../../service/technology/dockUser.service';
+import {
+  CDTO_dockUser,
+  CVO_dockUser,
+  FVO_dockUser,
+  QDTO_dockUser,
+  QVO_dockUser,
+  UDTO_dockUser,
+  UVAO_dockUser,
+} from '../../interface/technology/dockUser.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技成果-申请用户'])
+@Controller('/dockUser')
+export class DockUserController extends BaseController {
+  @Inject()
+  service: DockUserService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dockUser })
+  async create(@Body() data: CDTO_dockUser) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dockUser(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dockUser })
+  async query(
+    @Query() filter: QDTO_dockUser,
+    @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_dockUser(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dockUser })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dockUser(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dockUser })
+  async update(@Param('id') id: string, @Body() body: UDTO_dockUser) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/technology/dockVideo.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DockVideoService } from '../../service/technology/dockVideo.service';
+import {
+  CDTO_dockVideo,
+  CVO_dockVideo,
+  FVO_dockVideo,
+  QDTO_dockVideo,
+  QVO_dockVideo,
+  UDTO_dockVideo,
+  UVAO_dockVideo,
+} from '../../interface/technology/dockVideo.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['科技成果-展会视频'])
+@Controller('/dockVideo')
+export class DockVideoController extends BaseController {
+  @Inject()
+  service: DockVideoService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dockVideo })
+  async create(@Body() data: CDTO_dockVideo) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dockVideo(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dockVideo })
+  async query(
+    @Query() filter: QDTO_dockVideo,
+    @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_dockVideo(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dockVideo })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dockVideo(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dockVideo })
+  async update(@Param('id') id: string, @Body() body: UDTO_dockVideo) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/train/train.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { TrainService } from '../../service/train/train.service';
+import {
+  CDTO_train,
+  CVO_train,
+  FVO_train,
+  QDTO_train,
+  QVO_train,
+  UDTO_train,
+  UVAO_train,
+} from '../../interface/train/train.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['培训问诊'])
+@Controller('/train')
+export class TrainController extends BaseController {
+  @Inject()
+  service: TrainService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_train })
+  async create(@Body() data: CDTO_train) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_train(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_train })
+  async query(
+    @Query() filter: QDTO_train,
+    @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_train(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_train })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_train(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_train })
+  async update(@Param('id') id: string, @Body() body: UDTO_train) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/train/trainChat.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { TrainChatService } from '../../service/train/trainChat.service';
+import {
+  CDTO_trainChat,
+  CVO_trainChat,
+  FVO_trainChat,
+  QDTO_trainChat,
+  QVO_trainChat,
+  UDTO_trainChat,
+  UVAO_trainChat,
+} from '../../interface/train/trainChat.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['培训问诊-公开聊天'])
+@Controller('/trainChat')
+export class TrainChatController extends BaseController {
+  @Inject()
+  service: TrainChatService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_trainChat })
+  async create(@Body() data: CDTO_trainChat) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_trainChat(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_trainChat })
+  async query(
+    @Query() filter: QDTO_trainChat,
+    @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_trainChat(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_trainChat })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_trainChat(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_trainChat })
+  async update(@Param('id') id: string, @Body() body: UDTO_trainChat) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/train/trainUser.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { TrainUserService } from '../../service/train/trainUser.service';
+import {
+  CDTO_trainUser,
+  CVO_trainUser,
+  FVO_trainUser,
+  QDTO_trainUser,
+  QVO_trainUser,
+  UDTO_trainUser,
+  UVAO_trainUser,
+} from '../../interface/train/trainUser.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['培训问诊-展会用户'])
+@Controller('/trainUser')
+export class TrainUserController extends BaseController {
+  @Inject()
+  service: TrainUserService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_trainUser })
+  async create(@Body() data: CDTO_trainUser) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_trainUser(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_trainUser })
+  async query(
+    @Query() filter: QDTO_trainUser,
+    @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_trainUser(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_trainUser })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_trainUser(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_trainUser })
+  async update(@Param('id') id: string, @Body() body: UDTO_trainUser) {
+    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.');
+  }
+}

+ 89 - 0
src/controller/train/trainVideo.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { TrainVideoService } from '../../service/train/trainVideo.service';
+import {
+  CDTO_trainVideo,
+  CVO_trainVideo,
+  FVO_trainVideo,
+  QDTO_trainVideo,
+  QVO_trainVideo,
+  UDTO_trainVideo,
+  UVAO_trainVideo,
+} from '../../interface/train/trainVideo.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['培训问诊-展会视频'])
+@Controller('/trainVideo')
+export class TrainVideoController extends BaseController {
+  @Inject()
+  service: TrainVideoService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_trainVideo })
+  async create(@Body() data: CDTO_trainVideo) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_trainVideo(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_trainVideo })
+  async query(
+    @Query() filter: QDTO_trainVideo,
+    @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_trainVideo(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_trainVideo })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_trainVideo(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_trainVideo })
+  async update(@Param('id') id: string, @Body() body: UDTO_trainVideo) {
+    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 - 2
src/controller/user/admin.controller.ts

@@ -1,5 +1,6 @@
 import {
   Body,
+  Config,
   Controller,
   Del,
   Get,
@@ -8,7 +9,11 @@ import {
   Post,
   Query,
 } from '@midwayjs/decorator';
-import { BaseController } from 'free-midway-component';
+import {
+  BaseController,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
 import { AdminService } from '../../service/user/admin.service';
 import {
   CDTO_admin,
@@ -18,19 +23,81 @@ import {
   QVO_admin,
   UDTO_admin,
   UVAO_admin,
+  LoginDTO,
+  ResetPasswordDTO,
+  LoginVO,
 } from '../../interface/user/admin.interface';
-import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import {
+  ApiOperation,
+  ApiQuery,
+  ApiResponse,
+  ApiTags,
+} from '@midwayjs/swagger';
 import { Validate } from '@midwayjs/validate';
+import { JwtService } from '@midwayjs/jwt';
+import get = require('lodash/get');
+import lowerCase = require('lodash/lowerCase');
+import { RegisterCanNotIncludes } from '../../util/util';
+import { UserUtilService } from '../../service/util/user.util';
 @ApiTags(['管理员表'])
 @Controller('/admin')
 export class AdminController extends BaseController {
   @Inject()
   service: AdminService;
 
+  @Inject()
+  jwtService: JwtService;
+  @Config('jwt.secret')
+  jwtSecret;
+  @Config('jwt.expiresIn')
+  jwtExpiresIn;
+
+  @Inject()
+  userUtil: UserUtilService;
+
+  @Post('/login')
+  @Validate()
+  async login(@Body() body: LoginDTO) {
+    const data = await this.service.findUserToLogin(body);
+    let vo = new LoginVO(data);
+    vo = JSON.parse(JSON.stringify(vo));
+    const token = await this.jwtService.sign(vo, this.jwtSecret, {
+      expiresIn: this.jwtExpiresIn,
+    });
+    return token;
+  }
+
+  @Post('/rp')
+  @ApiOperation({ description: '修改密码' })
+  async resetPassword(@Body() body: ResetPasswordDTO) {
+    // 获取用户token中的登录信息
+    const user_id = get(this.ctx, 'user._id');
+    if (!user_id)
+      throw new ServiceError('未找到用户信息', FrameworkErrorEnum.NOT_LOGIN);
+    // 查询用户
+    const user = await this.service.fetch(user_id);
+    if (!user)
+      throw new ServiceError('未找到用户', FrameworkErrorEnum.NOT_FOUND_DATA);
+    // 修改密码
+    await this.service.updateOne(user_id, body);
+    // 返回结果
+    return 'ok';
+  }
+
   @Post('/')
   @Validate()
   @ApiResponse({ type: CVO_admin })
   async create(@Body() data: CDTO_admin) {
+    // 检查是否含有不允许字符
+    const haveInvalid = RegisterCanNotIncludes.find(f =>
+      lowerCase(data.account).includes(f)
+    );
+    if (haveInvalid)
+      throw new ServiceError(
+        `不允许包含特殊字符: ${RegisterCanNotIncludes.join('; ')}`
+      );
+    // 检查手机号和上级id
+    await this.userUtil.checkPhoneAndPid(data);
     const dbData = await this.service.create(data);
     const result = new CVO_admin(dbData);
     return result;
@@ -65,6 +132,8 @@ export class AdminController extends BaseController {
   @Validate()
   @ApiResponse({ type: UVAO_admin })
   async update(@Param('id') id: string, @Body() body: UDTO_admin) {
+    // 检查手机号和上级id
+    await this.userUtil.checkUpdateCardAndPid(id, body);
     const result = await this.service.updateOne(id, body);
     return result;
   }

+ 140 - 0
src/controller/user/company.controller.ts

@@ -0,0 +1,140 @@
+import {
+  Body,
+  Config,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import {
+  BaseController,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
+import { CompanyService } from '../../service/user/company.service';
+import {
+  CDTO_company,
+  CVO_company,
+  FVO_company,
+  QDTO_company,
+  QVO_company,
+  UDTO_company,
+  UVAO_company,
+  LoginDTO,
+  LoginVO,
+  ResetPasswordDTO,
+} from '../../interface/user/company.interface';
+import {
+  ApiOperation,
+  ApiQuery,
+  ApiResponse,
+  ApiTags,
+} from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { JwtService } from '@midwayjs/jwt';
+import get = require('lodash/get');
+@ApiTags(['企业用户'])
+@Controller('/company')
+export class CompanyController extends BaseController {
+  @Inject()
+  service: CompanyService;
+
+  @Inject()
+  jwtService: JwtService;
+  @Config('jwt.secret')
+  jwtSecret;
+  @Config('jwt.expiresIn')
+  jwtExpiresIn;
+
+  @Post('/login')
+  @Validate()
+  async login(@Body() body: LoginDTO) {
+    const data = await this.service.findUserToLogin(body);
+    let vo = new LoginVO(data);
+    vo = JSON.parse(JSON.stringify(vo));
+    const token = await this.jwtService.sign(vo, this.jwtSecret, {
+      expiresIn: this.jwtExpiresIn,
+    });
+    return token;
+  }
+
+  @Post('/rp')
+  @ApiOperation({ description: '修改密码' })
+  async resetPassword(@Body() body: ResetPasswordDTO) {
+    // 获取用户token中的登录信息
+    const user_id = get(this.ctx, 'user._id');
+    if (!user_id)
+      throw new ServiceError('未找到用户信息', FrameworkErrorEnum.NOT_LOGIN);
+    // 查询用户
+    const user = await this.service.fetch(user_id);
+    if (!user)
+      throw new ServiceError('未找到用户', FrameworkErrorEnum.NOT_FOUND_DATA);
+    // 修改密码
+    await this.service.updateOne(user_id, body);
+    // 返回结果
+    return 'ok';
+  }
+
+  @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('/: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;
+  }
+
+  @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);
+    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.');
+  }
+}

+ 148 - 0
src/controller/user/expert.controller.ts

@@ -0,0 +1,148 @@
+import {
+  Body,
+  Config,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import {
+  BaseController,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
+import { ExpertService } from '../../service/user/expert.service';
+import {
+  CDTO_expert,
+  CVO_expert,
+  FVO_expert,
+  QDTO_expert,
+  QVO_expert,
+  UDTO_expert,
+  UVAO_expert,
+  LoginDTO,
+  LoginVO,
+  ResetPasswordDTO,
+} from '../../interface/user/expert.interface';
+import {
+  ApiOperation,
+  ApiQuery,
+  ApiResponse,
+  ApiTags,
+} from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+import { UserUtilService } from '../../service/util/user.util';
+import { JwtService } from '@midwayjs/jwt';
+import get = require('lodash/get');
+@ApiTags(['专家用户'])
+@Controller('/expert')
+export class ExpertController extends BaseController {
+  @Inject()
+  service: ExpertService;
+
+  @Inject()
+  userUtil: UserUtilService;
+
+  @Inject()
+  jwtService: JwtService;
+  @Config('jwt.secret')
+  jwtSecret;
+  @Config('jwt.expiresIn')
+  jwtExpiresIn;
+
+  @Post('/login')
+  @Validate()
+  async login(@Body() body: LoginDTO) {
+    const data = await this.service.findUserToLogin(body);
+    let vo = new LoginVO(data);
+    vo = JSON.parse(JSON.stringify(vo));
+    const token = await this.jwtService.sign(vo, this.jwtSecret, {
+      expiresIn: this.jwtExpiresIn,
+    });
+    return token;
+  }
+
+  @Post('/rp')
+  @ApiOperation({ description: '修改密码' })
+  async resetPassword(@Body() body: ResetPasswordDTO) {
+    // 获取用户token中的登录信息
+    const user_id = get(this.ctx, 'user._id');
+    if (!user_id)
+      throw new ServiceError('未找到用户信息', FrameworkErrorEnum.NOT_LOGIN);
+    // 查询用户
+    const user = await this.service.fetch(user_id);
+    if (!user)
+      throw new ServiceError('未找到用户', FrameworkErrorEnum.NOT_FOUND_DATA);
+    // 修改密码
+    await this.service.updateOne(user_id, body);
+    // 返回结果
+    return 'ok';
+  }
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_expert })
+  async create(@Body() data: CDTO_expert) {
+    // 检查手机号
+    await this.userUtil.checkPhoneAndPid(data);
+    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('/: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;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_expert })
+  async update(@Param('id') id: string, @Body() body: UDTO_expert) {
+    // 检查手机号和上级id
+    await this.userUtil.checkUpdateCardAndPid(id, body);
+    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.');
+  }
+}

+ 61 - 2
src/controller/user/personal.controller.ts

@@ -1,5 +1,6 @@
 import {
   Body,
+  Config,
   Controller,
   Del,
   Get,
@@ -8,7 +9,11 @@ import {
   Post,
   Query,
 } from '@midwayjs/decorator';
-import { BaseController } from 'free-midway-component';
+import {
+  BaseController,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
 import { PersonalService } from '../../service/user/personal.service';
 import {
   CDTO_personal,
@@ -18,19 +23,71 @@ import {
   QVO_personal,
   UDTO_personal,
   UVAO_personal,
+  LoginDTO,
+  LoginVO,
+  ResetPasswordDTO,
 } from '../../interface/user/personal.interface';
-import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import {
+  ApiOperation,
+  ApiQuery,
+  ApiResponse,
+  ApiTags,
+} from '@midwayjs/swagger';
 import { Validate } from '@midwayjs/validate';
+import { UserUtilService } from '../../service/util/user.util';
+import { JwtService } from '@midwayjs/jwt';
+import get = require('lodash/get');
 @ApiTags(['个人用户'])
 @Controller('/personal')
 export class PersonalController extends BaseController {
   @Inject()
   service: PersonalService;
 
+  @Inject()
+  userUtil: UserUtilService;
+
+  @Inject()
+  jwtService: JwtService;
+  @Config('jwt.secret')
+  jwtSecret;
+  @Config('jwt.expiresIn')
+  jwtExpiresIn;
+
+  @Post('/login')
+  @Validate()
+  async login(@Body() body: LoginDTO) {
+    const data = await this.service.findUserToLogin(body);
+    let vo = new LoginVO(data);
+    vo = JSON.parse(JSON.stringify(vo));
+    const token = await this.jwtService.sign(vo, this.jwtSecret, {
+      expiresIn: this.jwtExpiresIn,
+    });
+    return token;
+  }
+
+  @Post('/rp')
+  @ApiOperation({ description: '修改密码' })
+  async resetPassword(@Body() body: ResetPasswordDTO) {
+    // 获取用户token中的登录信息
+    const user_id = get(this.ctx, 'user._id');
+    if (!user_id)
+      throw new ServiceError('未找到用户信息', FrameworkErrorEnum.NOT_LOGIN);
+    // 查询用户
+    const user = await this.service.fetch(user_id);
+    if (!user)
+      throw new ServiceError('未找到用户', FrameworkErrorEnum.NOT_FOUND_DATA);
+    // 修改密码
+    await this.service.updateOne(user_id, body);
+    // 返回结果
+    return 'ok';
+  }
+
   @Post('/')
   @Validate()
   @ApiResponse({ type: CVO_personal })
   async create(@Body() data: CDTO_personal) {
+    // 检查手机号
+    await this.userUtil.checkPhoneAndPid(data);
     const dbData = await this.service.create(data);
     const result = new CVO_personal(dbData);
     return result;
@@ -65,6 +122,8 @@ export class PersonalController extends BaseController {
   @Validate()
   @ApiResponse({ type: UVAO_personal })
   async update(@Param('id') id: string, @Body() body: UDTO_personal) {
+    // 检查手机号和上级id
+    await this.userUtil.checkUpdateCardAndPid(id, body);
     const result = await this.service.updateOne(id, body);
     return result;
   }

+ 34 - 0
src/entity/channel/channel.entity.ts

@@ -0,0 +1,34 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'channel' },
+})
+export class Channel extends BaseModel {
+  @prop({ required: false, index: true, zh: '房间号', remark: '2001开始' })
+  room_id: string;
+  @prop({ required: false, index: true, zh: '用户类型', default: '7' })
+  type: string;
+  @prop({ required: false, index: false, zh: '密码' })
+  password: string;
+  @prop({ required: false, index: true, zh: '标题' })
+  title: string;
+  @prop({ required: false, index: true, zh: '来源' })
+  origin: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '类别',
+    remark: '字典:channel_type',
+  })
+  channel_type: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:channel_status',
+    default: '0',
+  })
+  status: string;
+}

+ 110 - 0
src/entity/product/product.entity.ts

@@ -0,0 +1,110 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'product' },
+})
+export class Product extends BaseModel {
+  @prop({ required: false, index: true, zh: '所属用户' })
+  user_id: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '类型',
+    remark: '字典:product_type.0:科技需求,1:技术成果,2:商务服务',
+  })
+  type: string;
+  @prop({ required: false, index: true, zh: '企业名称' })
+  company: string;
+  @prop({ required: false, index: true, zh: '联系人' })
+  contact: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '电子邮箱' })
+  email: string;
+  @prop({ required: false, index: true, zh: 'qq&微信' })
+  qqwx: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '需求紧急程度/需求程度',
+    remark: '字典:product_demand',
+  })
+  demand: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '所属领域',
+    remark: '字典:product_field',
+  })
+  field: string;
+  @prop({ required: false, index: true, zh: '投资预算' })
+  budget: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '合作方式',
+    remark: '字典:product_cooperation',
+  })
+  cooperation: string;
+  @prop({ required: false, index: false, zh: '技术说明' })
+  requirementdesc: string;
+  @prop({ required: false, index: false, zh: '预期目标/商业预期' })
+  expect: string;
+  @prop({ required: false, index: false, zh: '需求现状' })
+  present: string;
+  @prop({ required: false, index: false, zh: '合作条件及要求' })
+  condition: string;
+  @prop({ required: false, index: false, zh: '产品图片(6)' })
+  file: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '成果状态',
+    remark: '字典:product_achievestatus',
+  })
+  achievestatus: string;
+  @prop({ required: false, index: false, zh: '成果权属' })
+  achieveown: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '成果来源',
+    remark: '字典:product_achievesource',
+  })
+  achievesource: string;
+  @prop({ required: false, index: false, zh: '意向价格' })
+  intentionprice: string;
+  @prop({ required: false, index: false, zh: '专利信息' })
+  patent: Array<any>;
+  @prop({ required: false, index: false, zh: '项目路演' })
+  roadshow: Array<any>;
+  @prop({ required: false, index: false, zh: '成果简介' })
+  achievebrief: string;
+  @prop({ required: false, index: false, zh: '技术特点' })
+  features: string;
+  @prop({ required: false, index: false, zh: '技术团队' })
+  team: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '信息属性',
+    remark: '字典:product_messattribute',
+  })
+  messattribute: string;
+  @prop({ required: false, index: false, zh: '信息描述' })
+  informationdesc: string;
+  @prop({ required: false, index: false, zh: '核心要素' })
+  coreelements: string;
+  @prop({ required: false, index: false, zh: '价格信息' })
+  priceinfo: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '状态',
+    remark: '字典:product_status',
+    default: '0',
+  })
+  status: string;
+}

+ 41 - 0
src/entity/technology/dock.entity.ts

@@ -0,0 +1,41 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dock' },
+})
+export class Dock extends BaseModel {
+  @prop({ required: false, index: false, zh: '所属用户', remark: '1001开始' })
+  user_id: string;
+  @prop({ required: false, index: false, zh: '用户类型', default: '6' })
+  type: string;
+  @prop({ required: false, index: true, zh: '房间号' })
+  room_id: string;
+  @prop({ required: false, index: false, zh: '密码' })
+  password: string;
+  @prop({ required: false, index: true, zh: '标题' })
+  title: string;
+  @prop({ required: false, index: true, zh: '开始时间' })
+  start_time: string;
+  @prop({ required: false, index: true, zh: '结束时间' })
+  end_time: string;
+  @prop({ required: false, index: true, zh: '省份' })
+  province: string;
+  @prop({ required: false, index: true, zh: '市区' })
+  city: string;
+  @prop({ required: false, index: true, zh: '负责人' })
+  contact: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: false, zh: '主办方' })
+  sponsor: string;
+  @prop({ required: false, index: false, zh: '承办方' })
+  organizer: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:dick_status',
+    default: '0',
+  })
+  status: string;
+}

+ 25 - 0
src/entity/technology/dockChat.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dockChat' },
+})
+export class DockChat extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  dock_id: string;
+  @prop({ required: false, index: true, zh: '发送人id' })
+  sender_id: string;
+  @prop({ required: false, index: true, zh: '发送人' })
+  sender_name: string;
+  @prop({ required: false, index: false, zh: '内容' })
+  content: string;
+  @prop({ required: false, index: true, zh: '发送时间' })
+  send_time: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否使用',
+    remark: '字典:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 27 - 0
src/entity/technology/dockExpert.entity.ts

@@ -0,0 +1,27 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dockExpert' },
+})
+export class DockExpert extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  dock_id: string;
+  @prop({ required: false, index: true, zh: '关联专家id' })
+  expert_id: string;
+  @prop({ required: false, index: true, zh: '姓名' })
+  name: string;
+  @prop({ required: false, index: true, zh: '头像' })
+  icon: string;
+  @prop({ required: false, index: true, zh: '最高学历' })
+  education: string;
+  @prop({ required: false, index: true, zh: '所在院校' })
+  school: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:common_status',
+    default: '0',
+  })
+  status: string;
+}

+ 25 - 0
src/entity/technology/dockImgtxt.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dockImgtxt' },
+})
+export class DockImgtxt extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  dock_id: string;
+  @prop({ required: false, index: true, zh: '发送人' })
+  user_id: string;
+  @prop({ required: false, index: true, zh: '内容' })
+  content: string;
+  @prop({ required: false, index: false, zh: '图片文件' })
+  img_file: Array<any>;
+  @prop({ required: false, index: false, zh: '视频文件' })
+  video_file: Array<any>;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否启用',
+    remark: '字典表:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 33 - 0
src/entity/technology/dockTrans.entity.ts

@@ -0,0 +1,33 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dockTrans' },
+})
+export class DockTrans extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  dock_id: string;
+  @prop({ required: false, index: true, zh: '产品id' })
+  product_id: string;
+  @prop({ required: false, index: true, zh: '供给者id' })
+  s_id: string;
+  @prop({ required: false, index: true, zh: '供给者姓名' })
+  s_name: string;
+  @prop({ required: false, index: true, zh: '供给者手机号' })
+  s_phone: string;
+  @prop({ required: false, index: true, zh: '需求者id' })
+  d_id: string;
+  @prop({ required: false, index: true, zh: '需求者姓名' })
+  d_name: string;
+  @prop({ required: false, index: true, zh: '需求者手机号' })
+  d_phone: string;
+  @prop({ required: false, index: false, zh: '合同备份' })
+  contract: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:dock_trans_status',
+    default: '0',
+  })
+  status: string;
+}

+ 27 - 0
src/entity/technology/dockUser.entity.ts

@@ -0,0 +1,27 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dockUser' },
+})
+export class DockUser extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  dock_id: string;
+  @prop({ required: false, index: true, zh: '申请人id' })
+  user_id: string;
+  @prop({ required: false, index: true, zh: '姓名' })
+  name: string;
+  @prop({ required: false, index: true, zh: '手机' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '申请时间' })
+  apply_date: string;
+  @prop({ required: false, index: false, zh: '参展项目' })
+  productList: Array<any>;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:common_status',
+    default: '0',
+  })
+  status: string;
+}

+ 25 - 0
src/entity/technology/dockVideo.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dockVideo' },
+})
+export class DockVideo extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  dock_id: string;
+  @prop({ required: false, index: true, zh: '标题' })
+  title: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '视频文件' })
+  video_file: Array<any>;
+  @prop({ required: false, index: true, zh: '排序', default: '0' })
+  sort: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否启用',
+    remark: '字典:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 41 - 0
src/entity/train/train.entity.ts

@@ -0,0 +1,41 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'train' },
+})
+export class Train extends BaseModel {
+  @prop({ required: false, index: true, zh: '房间号', remark: '3001开始' })
+  room_id: string;
+  @prop({ required: false, index: true, zh: '用户类型', default: '8' })
+  type: string;
+  @prop({ required: false, index: true, zh: '密码' })
+  password: string;
+  @prop({ required: false, index: true, zh: '标题' })
+  title: string;
+  @prop({ required: false, index: true, zh: '开始时间' })
+  start_time: string;
+  @prop({ required: false, index: true, zh: '结束时间' })
+  end_time: string;
+  @prop({ required: false, index: true, zh: '省份' })
+  province: string;
+  @prop({ required: false, index: true, zh: '市区' })
+  city: string;
+  @prop({ required: false, index: true, zh: '负责人' })
+  contact: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: false, zh: '主办方' })
+  sponsor: string;
+  @prop({ required: false, index: false, zh: '承办方' })
+  organizer: string;
+  @prop({ required: false, index: false, zh: '信息简介' })
+  brief: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:train_status',
+    default: '0',
+  })
+  status: string;
+}

+ 25 - 0
src/entity/train/trainChat.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'trainChat' },
+})
+export class TrainChat extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  train_id: string;
+  @prop({ required: false, index: true, zh: '发送人id' })
+  sender_id: string;
+  @prop({ required: false, index: true, zh: '发送人姓名' })
+  sender_name: string;
+  @prop({ required: false, index: false, zh: '内容' })
+  content: string;
+  @prop({ required: false, index: true, zh: '时间' })
+  send_time: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '是否使用',
+    remark: '字典表:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 26 - 0
src/entity/train/trainUser.entity.ts

@@ -0,0 +1,26 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'trainUser' },
+})
+export class TrainUser extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  train_id: string;
+  @prop({ required: false, index: true, zh: '用户类型', default: '9' })
+  type: string;
+  @prop({ required: false, index: true, zh: '账号' })
+  account: string;
+  @prop({ required: false, index: false, zh: '密码' })
+  password: string;
+  @prop({ required: false, index: true, zh: '姓名' })
+  name: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:common_status',
+  })
+  status: string;
+}

+ 25 - 0
src/entity/train/trainVideo.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'trainVideo' },
+})
+export class TrainVideo extends BaseModel {
+  @prop({ required: false, index: true, zh: '展会id' })
+  train_id: string;
+  @prop({ required: false, index: true, zh: '标题' })
+  title: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '视频文件' })
+  video_file: Array<any>;
+  @prop({ required: false, index: true, zh: '排序', default: '0' })
+  sort: number;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否启用',
+    remark: '字典:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 16 - 2
src/entity/user/admin.entity.ts

@@ -1,5 +1,6 @@
 import { modelOptions, prop } from '@typegoose/typegoose';
 import { BaseModel } from 'free-midway-component';
+import isString = require('lodash/isString');
 @modelOptions({
   schemaOptions: { collection: 'admin' },
 })
@@ -22,8 +23,21 @@ export class Admin extends BaseModel {
   code: string;
   @prop({ required: false, index: true, zh: '账号' })
   account: string;
-  @prop({ required: false, index: false, zh: '密码' })
-  password: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '密码',
+    select: false,
+    set: (val: string | object) => {
+      if (isString(val)) {
+        return { secret: val };
+      }
+      return val;
+    },
+  })
+  password: {
+    secret: string;
+  };
   @prop({ required: false, index: true, zh: '名称' })
   name: string;
   @prop({ required: false, index: true, zh: '手机号' })

+ 80 - 0
src/entity/user/company.entity.ts

@@ -0,0 +1,80 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+import isString = require('lodash/isString');
+@modelOptions({
+  schemaOptions: { collection: 'company' },
+})
+export class Company extends BaseModel {
+  @prop({ required: false, index: true, zh: '用户类型', default: '4' })
+  type: string;
+  @prop({ required: false, index: true, zh: '邀请码' })
+  code: string;
+  @prop({ required: false, index: true, zh: '账号' })
+  account: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '密码',
+    select: false,
+    set: (val: string | object) => {
+      if (isString(val)) {
+        return { secret: val };
+      }
+      return val;
+    },
+  })
+  password: {
+    secret: string;
+  };
+  @prop({ required: false, index: true, zh: '姓名' })
+  name: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '电子邮箱' })
+  email: string;
+  @prop({ required: false, index: true, zh: '联系地址' })
+  address: string;
+  @prop({ required: false, index: true, zh: '办公电话' })
+  work_phone: string;
+  @prop({ required: false, index: true, zh: '所属行业' })
+  industry: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '所属辖区',
+    remark: '字典:jl_area',
+  })
+  area: string;
+  @prop({ required: false, index: true, zh: '机构代码' })
+  institution_code: string;
+  @prop({ required: false, index: false, zh: '注册类型' })
+  companytype: string;
+  @prop({ required: false, index: false, zh: '注册时间' })
+  companydate: string;
+  @prop({ required: false, index: false, zh: '注册资金' })
+  companycapital: string;
+  @prop({ required: false, index: false, zh: '企业法人' })
+  companyperson: string;
+  @prop({ required: false, index: false, zh: '上年度企业总收入' })
+  sndqyzsr: string;
+  @prop({ required: false, index: false, zh: '上年度研发费用' })
+  sndyffy: string;
+  @prop({ required: false, index: false, zh: '企业总人数' })
+  companytotal: string;
+  @prop({ required: false, index: false, zh: '专&兼职研发人数' })
+  zjzyfrs: string;
+  @prop({ required: false, index: false, zh: '企业简介' })
+  companybrief: string;
+  @prop({ required: false, index: false, zh: '主要产品' })
+  mainproduct: string;
+  @prop({ required: false, index: false, zh: '企业资质&荣誉' })
+  qualifications: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:comon_status',
+    default: '0',
+  })
+  status: string;
+}

+ 86 - 0
src/entity/user/expert.entity.ts

@@ -0,0 +1,86 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+import isString = require('lodash/isString');
+@modelOptions({
+  schemaOptions: { collection: 'expert' },
+})
+export class Expert extends BaseModel {
+  @prop({ required: false, index: true, zh: '账号类型', default: '5' })
+  type: string;
+  @prop({ required: false, index: true, zh: '邀请码' })
+  code: string;
+  @prop({ required: false, index: true, zh: '账号' })
+  account: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '密码',
+    select: false,
+    set: (val: string | object) => {
+      if (isString(val)) {
+        return { secret: val };
+      }
+      return val;
+    },
+  })
+  password: {
+    secret: string;
+  };
+  @prop({ required: false, index: true, zh: '姓名' })
+  name: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '电子邮箱' })
+  email: string;
+  @prop({ required: false, index: false, zh: '联系地址' })
+  address: string;
+  @prop({ required: false, index: false, zh: '办公电话' })
+  work_phone: string;
+  @prop({ required: false, index: false, zh: '所属行业' })
+  industry: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '所属辖区',
+    remark: '字典:jl_area',
+  })
+  area: string;
+  @prop({ required: false, index: true, zh: '身份证号' })
+  card: string;
+  @prop({ required: false, index: false, zh: '出生日期' })
+  birth: string;
+  @prop({ required: false, index: false, zh: 'qq&&微信' })
+  qqwx: string;
+  @prop({ required: false, index: false, zh: '所在院校' })
+  school: string;
+  @prop({ required: false, index: false, zh: '最高学历' })
+  education: string;
+  @prop({ required: false, index: false, zh: '所学专业' })
+  major: string;
+  @prop({ required: false, index: false, zh: '单位名称' })
+  company: string;
+  @prop({ required: false, index: false, zh: '职务职称' })
+  zwzc: string;
+  @prop({ required: false, index: false, zh: '头像图片' })
+  icon: Array<any>;
+  @prop({ required: false, index: false, zh: '擅长领域' })
+  expertise: string;
+  @prop({ required: false, index: false, zh: '工作经历' })
+  workexperience: string;
+  @prop({ required: false, index: false, zh: '科研综述' })
+  scientific: string;
+  @prop({ required: false, index: false, zh: '承担项目' })
+  undertakingproject: string;
+  @prop({ required: false, index: false, zh: '科技奖励' })
+  scienceaward: string;
+  @prop({ required: false, index: false, zh: '社会任职' })
+  social: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '状态',
+    remark: '字典:common_status',
+    default: '0',
+  })
+  status: string;
+}

+ 16 - 2
src/entity/user/personal.entity.ts

@@ -1,5 +1,6 @@
 import { modelOptions, prop } from '@typegoose/typegoose';
 import { BaseModel } from 'free-midway-component';
+import isString = require('lodash/isString');
 @modelOptions({
   schemaOptions: { collection: 'personal' },
 })
@@ -10,8 +11,21 @@ export class Personal extends BaseModel {
   code: string;
   @prop({ required: false, index: false, zh: '账号' })
   account: string;
-  @prop({ required: false, index: false, zh: '密码' })
-  password: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '密码',
+    select: false,
+    set: (val: string | object) => {
+      if (isString(val)) {
+        return { secret: val };
+      }
+      return val;
+    },
+  })
+  password: {
+    secret: string;
+  };
   @prop({ required: false, index: false, zh: '姓名' })
   name: string;
   @prop({ required: false, index: false, zh: '手机号' })

+ 115 - 0
src/interface/channel/channel.interface.ts

@@ -0,0 +1,115 @@
+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_channel {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '房间号' })
+  'room_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '来源' })
+  'origin': string = undefined;
+  @ApiProperty({ description: '类别' })
+  'channel_type': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_channel extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'room_id',
+      'type',
+      'title',
+      'origin',
+      'channel_type',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '房间号' })
+  'room_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '来源' })
+  'origin': string = undefined;
+  @ApiProperty({ description: '类别' })
+  'channel_type': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_channel extends FVO_channel {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_channel {
+  @ApiProperty({ description: '房间号' })
+  @Rule(RuleType['string']().empty(''))
+  'room_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'title': string = undefined;
+  @ApiProperty({ description: '来源' })
+  @Rule(RuleType['string']().empty(''))
+  'origin': string = undefined;
+  @ApiProperty({ description: '类别' })
+  @Rule(RuleType['string']().empty(''))
+  'channel_type': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_channel extends FVO_channel {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_channel extends CDTO_channel {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_channel extends FVO_channel {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 248 - 0
src/interface/product/product.interface.ts

@@ -0,0 +1,248 @@
+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_product {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '所属用户' })
+  'user_id': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '企业名称' })
+  'company': string = undefined;
+  @ApiProperty({ description: '联系人' })
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: 'qq&微信' })
+  'qqwx': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '需求紧急程度/需求程度' })
+  'demand': string = undefined;
+  @ApiProperty({ description: '所属领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '投资预算' })
+  'budget': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  'cooperation': string = undefined;
+  @ApiProperty({ description: '技术说明' })
+  'requirementdesc': string = undefined;
+  @ApiProperty({ description: '预期目标/商业预期' })
+  'expect': string = undefined;
+  @ApiProperty({ description: '需求现状' })
+  'present': string = undefined;
+  @ApiProperty({ description: '合作条件及要求' })
+  'condition': string = undefined;
+  @ApiProperty({ description: '产品图片(6)' })
+  'file': string = undefined;
+  @ApiProperty({ description: '成果状态' })
+  'achievestatus': string = undefined;
+  @ApiProperty({ description: '成果权属' })
+  'achieveown': string = undefined;
+  @ApiProperty({ description: '成果来源' })
+  'achievesource': string = undefined;
+  @ApiProperty({ description: '意向价格' })
+  'intentionprice': string = undefined;
+  @ApiProperty({ description: '专利信息' })
+  'patent': Array<any> = undefined;
+  @ApiProperty({ description: '项目路演' })
+  'roadshow': Array<any> = undefined;
+  @ApiProperty({ description: '成果简介' })
+  'achievebrief': string = undefined;
+  @ApiProperty({ description: '技术特点' })
+  'features': string = undefined;
+  @ApiProperty({ description: '技术团队' })
+  'team': string = undefined;
+  @ApiProperty({ description: '信息属性' })
+  'messattribute': string = undefined;
+  @ApiProperty({ description: '信息描述' })
+  'informationdesc': string = undefined;
+  @ApiProperty({ description: '核心要素' })
+  'coreelements': string = undefined;
+  @ApiProperty({ description: '价格信息' })
+  'priceinfo': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_product extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'user_id',
+      'type',
+      'company',
+      'contact',
+      'phone',
+      'email',
+      'qqwx',
+      'name',
+      'demand',
+      'field',
+      'budget',
+      'cooperation',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '所属用户' })
+  'user_id': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '企业名称' })
+  'company': string = undefined;
+  @ApiProperty({ description: '联系人' })
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: 'qq&微信' })
+  'qqwx': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '需求紧急程度/需求程度' })
+  'demand': string = undefined;
+  @ApiProperty({ description: '所属领域' })
+  'field': string = undefined;
+  @ApiProperty({ description: '投资预算' })
+  'budget': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  'cooperation': string = undefined;
+}
+
+export class QVO_product extends FVO_product {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_product {
+  @ApiProperty({ description: '所属用户' })
+  @Rule(RuleType['string']().empty(''))
+  'user_id': string = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '企业名称' })
+  @Rule(RuleType['string']().empty(''))
+  'company': string = undefined;
+  @ApiProperty({ description: '联系人' })
+  @Rule(RuleType['string']().empty(''))
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  @Rule(RuleType['string']().empty(''))
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  @Rule(RuleType['string']().empty(''))
+  'email': string = undefined;
+  @ApiProperty({ description: 'qq&微信' })
+  @Rule(RuleType['string']().empty(''))
+  'qqwx': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '需求紧急程度/需求程度' })
+  @Rule(RuleType['string']().empty(''))
+  'demand': string = undefined;
+  @ApiProperty({ description: '所属领域' })
+  @Rule(RuleType['string']().empty(''))
+  'field': string = undefined;
+  @ApiProperty({ description: '投资预算' })
+  @Rule(RuleType['string']().empty(''))
+  'budget': string = undefined;
+  @ApiProperty({ description: '合作方式' })
+  @Rule(RuleType['string']().empty(''))
+  'cooperation': string = undefined;
+  @ApiProperty({ description: '技术说明' })
+  @Rule(RuleType['string']().empty(''))
+  'requirementdesc': string = undefined;
+  @ApiProperty({ description: '预期目标/商业预期' })
+  @Rule(RuleType['string']().empty(''))
+  'expect': string = undefined;
+  @ApiProperty({ description: '需求现状' })
+  @Rule(RuleType['string']().empty(''))
+  'present': string = undefined;
+  @ApiProperty({ description: '合作条件及要求' })
+  @Rule(RuleType['string']().empty(''))
+  'condition': string = undefined;
+  @ApiProperty({ description: '产品图片(6)' })
+  @Rule(RuleType['string']().empty(''))
+  'file': string = undefined;
+  @ApiProperty({ description: '成果状态' })
+  @Rule(RuleType['string']().empty(''))
+  'achievestatus': string = undefined;
+  @ApiProperty({ description: '成果权属' })
+  @Rule(RuleType['string']().empty(''))
+  'achieveown': string = undefined;
+  @ApiProperty({ description: '成果来源' })
+  @Rule(RuleType['string']().empty(''))
+  'achievesource': string = undefined;
+  @ApiProperty({ description: '意向价格' })
+  @Rule(RuleType['string']().empty(''))
+  'intentionprice': string = undefined;
+  @ApiProperty({ description: '专利信息' })
+  @Rule(RuleType['array']().empty(''))
+  'patent': Array<any> = undefined;
+  @ApiProperty({ description: '项目路演' })
+  @Rule(RuleType['array']().empty(''))
+  'roadshow': Array<any> = undefined;
+  @ApiProperty({ description: '成果简介' })
+  @Rule(RuleType['string']().empty(''))
+  'achievebrief': string = undefined;
+  @ApiProperty({ description: '技术特点' })
+  @Rule(RuleType['string']().empty(''))
+  'features': string = undefined;
+  @ApiProperty({ description: '技术团队' })
+  @Rule(RuleType['string']().empty(''))
+  'team': string = undefined;
+  @ApiProperty({ description: '信息属性' })
+  @Rule(RuleType['string']().empty(''))
+  'messattribute': string = undefined;
+  @ApiProperty({ description: '信息描述' })
+  @Rule(RuleType['string']().empty(''))
+  'informationdesc': string = undefined;
+  @ApiProperty({ description: '核心要素' })
+  @Rule(RuleType['string']().empty(''))
+  'coreelements': string = undefined;
+  @ApiProperty({ description: '价格信息' })
+  @Rule(RuleType['string']().empty(''))
+  'priceinfo': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_product extends FVO_product {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_product extends CDTO_product {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_product extends FVO_product {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 154 - 0
src/interface/technology/dock.interface.ts

@@ -0,0 +1,154 @@
+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_dock {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '所属用户' })
+  'user_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '房间号' })
+  'room_id': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '开始时间' })
+  'start_time': string = undefined;
+  @ApiProperty({ description: '结束时间' })
+  'end_time': string = undefined;
+  @ApiProperty({ description: '省份' })
+  'province': string = undefined;
+  @ApiProperty({ description: '市区' })
+  'city': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '主办方' })
+  'sponsor': string = undefined;
+  @ApiProperty({ description: '承办方' })
+  'organizer': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_dock extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'room_id',
+      'title',
+      'start_time',
+      'end_time',
+      'province',
+      'city',
+      'contact',
+      'phone',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '房间号' })
+  'room_id': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '开始时间' })
+  'start_time': string = undefined;
+  @ApiProperty({ description: '结束时间' })
+  'end_time': string = undefined;
+  @ApiProperty({ description: '省份' })
+  'province': string = undefined;
+  @ApiProperty({ description: '市区' })
+  'city': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_dock extends FVO_dock {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dock {
+  @ApiProperty({ description: '所属用户' })
+  @Rule(RuleType['string']().empty(''))
+  'user_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '房间号' })
+  @Rule(RuleType['string']().empty(''))
+  'room_id': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'title': string = undefined;
+  @ApiProperty({ description: '开始时间' })
+  @Rule(RuleType['string']().empty(''))
+  'start_time': string = undefined;
+  @ApiProperty({ description: '结束时间' })
+  @Rule(RuleType['string']().empty(''))
+  'end_time': string = undefined;
+  @ApiProperty({ description: '省份' })
+  @Rule(RuleType['string']().empty(''))
+  'province': string = undefined;
+  @ApiProperty({ description: '市区' })
+  @Rule(RuleType['string']().empty(''))
+  'city': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  @Rule(RuleType['string']().empty(''))
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  @Rule(RuleType['string']().empty(''))
+  'phone': string = undefined;
+  @ApiProperty({ description: '主办方' })
+  @Rule(RuleType['string']().empty(''))
+  'sponsor': string = undefined;
+  @ApiProperty({ description: '承办方' })
+  @Rule(RuleType['string']().empty(''))
+  'organizer': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_dock extends FVO_dock {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dock extends CDTO_dock {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dock extends FVO_dock {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 102 - 0
src/interface/technology/dockChat.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_dockChat {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '发送人id' })
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '发送人' })
+  'sender_name': string = undefined;
+  @ApiProperty({ description: '内容' })
+  'content': string = undefined;
+  @ApiProperty({ description: '发送时间' })
+  'send_time': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_dockChat extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'dock_id',
+      'sender_id',
+      'sender_name',
+      'send_time',
+      'is_use',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '发送人id' })
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '发送人' })
+  'sender_name': string = undefined;
+  @ApiProperty({ description: '发送时间' })
+  'send_time': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_dockChat extends FVO_dockChat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dockChat {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '发送人id' })
+  @Rule(RuleType['string']().empty(''))
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '发送人' })
+  @Rule(RuleType['string']().empty(''))
+  'sender_name': 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_use': string = undefined;
+}
+
+export class CVO_dockChat extends FVO_dockChat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dockChat extends CDTO_dockChat {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dockChat extends FVO_dockChat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 113 - 0
src/interface/technology/dockExpert.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_dockExpert {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '关联专家id' })
+  'expert_id': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '头像' })
+  'icon': string = undefined;
+  @ApiProperty({ description: '最高学历' })
+  'education': string = undefined;
+  @ApiProperty({ description: '所在院校' })
+  'school': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_dockExpert extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'dock_id',
+      'expert_id',
+      'name',
+      'icon',
+      'education',
+      'school',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '关联专家id' })
+  'expert_id': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '头像' })
+  'icon': string = undefined;
+  @ApiProperty({ description: '最高学历' })
+  'education': string = undefined;
+  @ApiProperty({ description: '所在院校' })
+  'school': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_dockExpert extends FVO_dockExpert {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dockExpert {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '关联专家id' })
+  @Rule(RuleType['string']().empty(''))
+  'expert_id': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '头像' })
+  @Rule(RuleType['string']().empty(''))
+  'icon': string = undefined;
+  @ApiProperty({ description: '最高学历' })
+  @Rule(RuleType['string']().empty(''))
+  'education': string = undefined;
+  @ApiProperty({ description: '所在院校' })
+  @Rule(RuleType['string']().empty(''))
+  'school': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_dockExpert extends FVO_dockExpert {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dockExpert extends CDTO_dockExpert {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dockExpert extends FVO_dockExpert {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 94 - 0
src/interface/technology/dockImgtxt.interface.ts

@@ -0,0 +1,94 @@
+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_dockImgtxt {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '发送人' })
+  'user_id': string = undefined;
+  @ApiProperty({ description: '内容' })
+  'content': string = undefined;
+  @ApiProperty({ description: '图片文件' })
+  'img_file': Array<any> = undefined;
+  @ApiProperty({ description: '视频文件' })
+  'video_file': Array<any> = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_dockImgtxt extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['dock_id', 'user_id', 'content', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '发送人' })
+  'user_id': string = undefined;
+  @ApiProperty({ description: '内容' })
+  'content': string = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_dockImgtxt extends FVO_dockImgtxt {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dockImgtxt {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '发送人' })
+  @Rule(RuleType['string']().empty(''))
+  'user_id': string = undefined;
+  @ApiProperty({ description: '内容' })
+  @Rule(RuleType['string']().empty(''))
+  'content': string = undefined;
+  @ApiProperty({ description: '图片文件' })
+  @Rule(RuleType['array']().empty(''))
+  'img_file': Array<any> = undefined;
+  @ApiProperty({ description: '视频文件' })
+  @Rule(RuleType['array']().empty(''))
+  'video_file': Array<any> = undefined;
+  @ApiProperty({ description: '是否启用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_dockImgtxt extends FVO_dockImgtxt {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dockImgtxt extends CDTO_dockImgtxt {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dockImgtxt extends FVO_dockImgtxt {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 134 - 0
src/interface/technology/dockTrans.interface.ts

@@ -0,0 +1,134 @@
+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_dockTrans {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '产品id' })
+  'product_id': string = undefined;
+  @ApiProperty({ description: '供给者id' })
+  's_id': string = undefined;
+  @ApiProperty({ description: '供给者姓名' })
+  's_name': string = undefined;
+  @ApiProperty({ description: '供给者手机号' })
+  's_phone': string = undefined;
+  @ApiProperty({ description: '需求者id' })
+  'd_id': string = undefined;
+  @ApiProperty({ description: '需求者姓名' })
+  'd_name': string = undefined;
+  @ApiProperty({ description: '需求者手机号' })
+  'd_phone': string = undefined;
+  @ApiProperty({ description: '合同备份' })
+  'contract': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_dockTrans extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'dock_id',
+      'product_id',
+      's_id',
+      's_name',
+      's_phone',
+      'd_id',
+      'd_name',
+      'd_phone',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '产品id' })
+  'product_id': string = undefined;
+  @ApiProperty({ description: '供给者id' })
+  's_id': string = undefined;
+  @ApiProperty({ description: '供给者姓名' })
+  's_name': string = undefined;
+  @ApiProperty({ description: '供给者手机号' })
+  's_phone': string = undefined;
+  @ApiProperty({ description: '需求者id' })
+  'd_id': string = undefined;
+  @ApiProperty({ description: '需求者姓名' })
+  'd_name': string = undefined;
+  @ApiProperty({ description: '需求者手机号' })
+  'd_phone': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_dockTrans extends FVO_dockTrans {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dockTrans {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '产品id' })
+  @Rule(RuleType['string']().empty(''))
+  'product_id': string = undefined;
+  @ApiProperty({ description: '供给者id' })
+  @Rule(RuleType['string']().empty(''))
+  's_id': string = undefined;
+  @ApiProperty({ description: '供给者姓名' })
+  @Rule(RuleType['string']().empty(''))
+  's_name': string = undefined;
+  @ApiProperty({ description: '供给者手机号' })
+  @Rule(RuleType['string']().empty(''))
+  's_phone': string = undefined;
+  @ApiProperty({ description: '需求者id' })
+  @Rule(RuleType['string']().empty(''))
+  'd_id': string = undefined;
+  @ApiProperty({ description: '需求者姓名' })
+  @Rule(RuleType['string']().empty(''))
+  'd_name': string = undefined;
+  @ApiProperty({ description: '需求者手机号' })
+  @Rule(RuleType['string']().empty(''))
+  'd_phone': string = undefined;
+  @ApiProperty({ description: '合同备份' })
+  @Rule(RuleType['string']().empty(''))
+  'contract': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_dockTrans extends FVO_dockTrans {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dockTrans extends CDTO_dockTrans {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dockTrans extends FVO_dockTrans {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 110 - 0
src/interface/technology/dockUser.interface.ts

@@ -0,0 +1,110 @@
+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_dockUser {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '申请人id' })
+  'user_id': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '申请时间' })
+  'apply_date': string = undefined;
+  @ApiProperty({ description: '参展项目' })
+  'productList': Array<any> = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_dockUser extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'dock_id',
+      'user_id',
+      'name',
+      'phone',
+      'apply_date',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '申请人id' })
+  'user_id': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '申请时间' })
+  'apply_date': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_dockUser extends FVO_dockUser {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dockUser {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '申请人id' })
+  @Rule(RuleType['string']().empty(''))
+  'user_id': 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(''))
+  'apply_date': string = undefined;
+  @ApiProperty({ description: '参展项目' })
+  @Rule(RuleType['array']().empty(''))
+  'productList': Array<any> = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_dockUser extends FVO_dockUser {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dockUser extends CDTO_dockUser {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dockUser extends FVO_dockUser {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 94 - 0
src/interface/technology/dockVideo.interface.ts

@@ -0,0 +1,94 @@
+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_dockVideo {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '视频文件' })
+  'video_file': Array<any> = undefined;
+  @ApiProperty({ description: '排序' })
+  'sort': string = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_dockVideo extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['dock_id', 'title', 'sort', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '排序' })
+  'sort': string = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_dockVideo extends FVO_dockVideo {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dockVideo {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'dock_id': string = undefined;
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'title': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '视频文件' })
+  @Rule(RuleType['array']().empty(''))
+  'video_file': Array<any> = undefined;
+  @ApiProperty({ description: '排序' })
+  @Rule(RuleType['string']().empty(''))
+  'sort': string = undefined;
+  @ApiProperty({ description: '是否启用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_dockVideo extends FVO_dockVideo {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dockVideo extends CDTO_dockVideo {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dockVideo extends FVO_dockVideo {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 160 - 0
src/interface/train/train.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_train {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '房间号' })
+  'room_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '开始时间' })
+  'start_time': string = undefined;
+  @ApiProperty({ description: '结束时间' })
+  'end_time': string = undefined;
+  @ApiProperty({ description: '省份' })
+  'province': string = undefined;
+  @ApiProperty({ description: '市区' })
+  'city': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '主办方' })
+  'sponsor': string = undefined;
+  @ApiProperty({ description: '承办方' })
+  'organizer': string = undefined;
+  @ApiProperty({ description: '信息简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_train extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'room_id',
+      'type',
+      'password',
+      'title',
+      'start_time',
+      'end_time',
+      'province',
+      'city',
+      'contact',
+      'phone',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '房间号' })
+  'room_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '开始时间' })
+  'start_time': string = undefined;
+  @ApiProperty({ description: '结束时间' })
+  'end_time': string = undefined;
+  @ApiProperty({ description: '省份' })
+  'province': string = undefined;
+  @ApiProperty({ description: '市区' })
+  'city': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_train extends FVO_train {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_train {
+  @ApiProperty({ description: '房间号' })
+  @Rule(RuleType['string']().empty(''))
+  'room_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'title': string = undefined;
+  @ApiProperty({ description: '开始时间' })
+  @Rule(RuleType['string']().empty(''))
+  'start_time': string = undefined;
+  @ApiProperty({ description: '结束时间' })
+  @Rule(RuleType['string']().empty(''))
+  'end_time': string = undefined;
+  @ApiProperty({ description: '省份' })
+  @Rule(RuleType['string']().empty(''))
+  'province': string = undefined;
+  @ApiProperty({ description: '市区' })
+  @Rule(RuleType['string']().empty(''))
+  'city': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  @Rule(RuleType['string']().empty(''))
+  'contact': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  @Rule(RuleType['string']().empty(''))
+  'phone': string = undefined;
+  @ApiProperty({ description: '主办方' })
+  @Rule(RuleType['string']().empty(''))
+  'sponsor': string = undefined;
+  @ApiProperty({ description: '承办方' })
+  @Rule(RuleType['string']().empty(''))
+  'organizer': string = undefined;
+  @ApiProperty({ description: '信息简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_train extends FVO_train {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_train extends CDTO_train {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_train extends FVO_train {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 94 - 0
src/interface/train/trainChat.interface.ts

@@ -0,0 +1,94 @@
+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_trainChat {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'train_id': string = undefined;
+  @ApiProperty({ description: '发送人id' })
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '发送人姓名' })
+  'sender_name': string = undefined;
+  @ApiProperty({ description: '内容' })
+  'content': string = undefined;
+  @ApiProperty({ description: '时间' })
+  'send_time': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_trainChat extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['train_id', 'sender_id', 'sender_name', 'send_time'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'train_id': string = undefined;
+  @ApiProperty({ description: '发送人id' })
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '发送人姓名' })
+  'sender_name': string = undefined;
+  @ApiProperty({ description: '时间' })
+  'send_time': string = undefined;
+}
+
+export class QVO_trainChat extends FVO_trainChat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_trainChat {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'train_id': string = undefined;
+  @ApiProperty({ description: '发送人id' })
+  @Rule(RuleType['string']().empty(''))
+  'sender_id': string = undefined;
+  @ApiProperty({ description: '发送人姓名' })
+  @Rule(RuleType['string']().empty(''))
+  'sender_name': 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_use': string = undefined;
+}
+
+export class CVO_trainChat extends FVO_trainChat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_trainChat extends CDTO_trainChat {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_trainChat extends FVO_trainChat {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 103 - 0
src/interface/train/trainUser.interface.ts

@@ -0,0 +1,103 @@
+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_trainUser {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'train_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_trainUser extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['train_id', 'type', 'account', 'name', 'phone', 'status'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'train_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_trainUser extends FVO_trainUser {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_trainUser {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'train_id': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '账号' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': 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(''))
+  'status': string = undefined;
+}
+
+export class CVO_trainUser extends FVO_trainUser {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_trainUser extends CDTO_trainUser {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_trainUser extends FVO_trainUser {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 94 - 0
src/interface/train/trainVideo.interface.ts

@@ -0,0 +1,94 @@
+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_trainVideo {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '展会id' })
+  'train_id': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '视频文件' })
+  'video_file': Array<any> = undefined;
+  @ApiProperty({ description: '排序' })
+  'sort': number = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_trainVideo extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['train_id', 'title', 'sort', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '展会id' })
+  'train_id': string = undefined;
+  @ApiProperty({ description: '标题' })
+  'title': string = undefined;
+  @ApiProperty({ description: '排序' })
+  'sort': number = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_trainVideo extends FVO_trainVideo {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_trainVideo {
+  @ApiProperty({ description: '展会id' })
+  @Rule(RuleType['string']().empty(''))
+  'train_id': string = undefined;
+  @ApiProperty({ description: '标题' })
+  @Rule(RuleType['string']().empty(''))
+  'title': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '视频文件' })
+  @Rule(RuleType['array']().empty(''))
+  'video_file': Array<any> = undefined;
+  @ApiProperty({ description: '排序' })
+  @Rule(RuleType['number']().empty(''))
+  'sort': number = undefined;
+  @ApiProperty({ description: '是否启用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_trainVideo extends FVO_trainVideo {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_trainVideo extends CDTO_trainVideo {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_trainVideo extends FVO_trainVideo {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 42 - 0
src/interface/user/admin.interface.ts

@@ -124,3 +124,45 @@ export class UVAO_admin extends FVO_admin {
     dealVO(this, data);
   }
 }
+export class FetchVO_admin {
+  constructor(data: object) {
+    for (const key of Object.keys(this)) {
+      this[key] = get(data, key);
+    }
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '角色' })
+  'role': Array<any> = undefined;
+  @ApiProperty({ description: '超级管理员!' })
+  'is_super': boolean = undefined;
+}
+
+export class LoginVO extends FetchVO_admin {
+  constructor(data: object) {
+    super(data);
+    if (get(data, 'is_super')) this.type = '0';
+    else this.type = '1';
+  }
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+}
+
+export class LoginDTO {
+  @ApiProperty({ description: '账号', example: 'test' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码', example: '111111' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+}
+
+export class ResetPasswordDTO {
+  @ApiProperty({ description: '密码', example: '123456' })
+  @Rule(RuleType['string']().required())
+  'password': string = undefined;
+}

+ 304 - 0
src/interface/user/company.interface.ts

@@ -0,0 +1,304 @@
+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_company {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  'area': string = undefined;
+  @ApiProperty({ description: '机构代码' })
+  'institution_code': string = undefined;
+  @ApiProperty({ description: '注册类型' })
+  'companytype': string = undefined;
+  @ApiProperty({ description: '注册时间' })
+  'companydate': string = undefined;
+  @ApiProperty({ description: '注册资金' })
+  'companycapital': string = undefined;
+  @ApiProperty({ description: '企业法人' })
+  'companyperson': string = undefined;
+  @ApiProperty({ description: '上年度企业总收入' })
+  'sndqyzsr': string = undefined;
+  @ApiProperty({ description: '上年度研发费用' })
+  'sndyffy': string = undefined;
+  @ApiProperty({ description: '企业总人数' })
+  'companytotal': string = undefined;
+  @ApiProperty({ description: '专&兼职研发人数' })
+  'zjzyfrs': string = undefined;
+  @ApiProperty({ description: '企业简介' })
+  'companybrief': string = undefined;
+  @ApiProperty({ description: '主要产品' })
+  'mainproduct': string = undefined;
+  @ApiProperty({ description: '企业资质&荣誉' })
+  'qualifications': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_company extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'type',
+      'code',
+      'account',
+      'password',
+      'name',
+      'phone',
+      'email',
+      'address',
+      'work_phone',
+      'industry',
+      'area',
+      'institution_code',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  'area': string = undefined;
+  @ApiProperty({ description: '机构代码' })
+  'institution_code': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_company extends FVO_company {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_company {
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  @Rule(RuleType['string']().empty(''))
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': 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(''))
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  @Rule(RuleType['string']().empty(''))
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  @Rule(RuleType['string']().empty(''))
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  @Rule(RuleType['string']().empty(''))
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  @Rule(RuleType['string']().empty(''))
+  'area': string = undefined;
+  @ApiProperty({ description: '机构代码' })
+  @Rule(RuleType['string']().empty(''))
+  'institution_code': string = undefined;
+  @ApiProperty({ description: '注册类型' })
+  @Rule(RuleType['string']().empty(''))
+  'companytype': string = undefined;
+  @ApiProperty({ description: '注册时间' })
+  @Rule(RuleType['string']().empty(''))
+  'companydate': string = undefined;
+  @ApiProperty({ description: '注册资金' })
+  @Rule(RuleType['string']().empty(''))
+  'companycapital': string = undefined;
+  @ApiProperty({ description: '企业法人' })
+  @Rule(RuleType['string']().empty(''))
+  'companyperson': string = undefined;
+  @ApiProperty({ description: '上年度企业总收入' })
+  @Rule(RuleType['string']().empty(''))
+  'sndqyzsr': string = undefined;
+  @ApiProperty({ description: '上年度研发费用' })
+  @Rule(RuleType['string']().empty(''))
+  'sndyffy': string = undefined;
+  @ApiProperty({ description: '企业总人数' })
+  @Rule(RuleType['string']().empty(''))
+  'companytotal': string = undefined;
+  @ApiProperty({ description: '专&兼职研发人数' })
+  @Rule(RuleType['string']().empty(''))
+  'zjzyfrs': string = undefined;
+  @ApiProperty({ description: '企业简介' })
+  @Rule(RuleType['string']().empty(''))
+  'companybrief': string = undefined;
+  @ApiProperty({ description: '主要产品' })
+  @Rule(RuleType['string']().empty(''))
+  'mainproduct': string = undefined;
+  @ApiProperty({ description: '企业资质&荣誉' })
+  @Rule(RuleType['string']().empty(''))
+  'qualifications': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+export class FetchVO_company {
+  constructor(data: object) {
+    for (const key of Object.keys(this)) {
+      this[key] = get(data, key);
+    }
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '角色' })
+  'role': Array<any> = undefined;
+}
+
+export class CVO_company extends FVO_company {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_company extends CDTO_company {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_company extends FVO_company {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+export class LoginVO {
+  constructor(data: object) {
+    for (const key of Object.keys(this)) {
+      this[key] = get(data, key);
+    }
+    this.type = '4';
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  'area': string = undefined;
+  @ApiProperty({ description: '机构代码' })
+  'institution_code': string = undefined;
+  @ApiProperty({ description: '注册类型' })
+  'companytype': string = undefined;
+  @ApiProperty({ description: '注册时间' })
+  'companydate': string = undefined;
+  @ApiProperty({ description: '注册资金' })
+  'companycapital': string = undefined;
+  @ApiProperty({ description: '企业法人' })
+  'companyperson': string = undefined;
+  @ApiProperty({ description: '上年度企业总收入' })
+  'sndqyzsr': string = undefined;
+  @ApiProperty({ description: '上年度研发费用' })
+  'sndyffy': string = undefined;
+  @ApiProperty({ description: '企业总人数' })
+  'companytotal': string = undefined;
+  @ApiProperty({ description: '专&兼职研发人数' })
+  'zjzyfrs': string = undefined;
+  @ApiProperty({ description: '企业简介' })
+  'companybrief': string = undefined;
+  @ApiProperty({ description: '主要产品' })
+  'mainproduct': string = undefined;
+  @ApiProperty({ description: '企业资质&荣誉' })
+  'qualifications': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class LoginDTO {
+  @ApiProperty({ description: '账号', example: 'test' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码', example: '111111' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+}
+
+export class ResetPasswordDTO {
+  @ApiProperty({ description: '密码', example: '123456' })
+  @Rule(RuleType['string']().required())
+  'password': string = undefined;
+}

+ 295 - 0
src/interface/user/expert.interface.ts

@@ -0,0 +1,295 @@
+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_expert {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '账号类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  'area': string = undefined;
+  @ApiProperty({ description: '身份证号' })
+  'card': string = undefined;
+  @ApiProperty({ description: '出生日期' })
+  'birth': string = undefined;
+  @ApiProperty({ description: 'qq&&微信' })
+  'qqwx': string = undefined;
+  @ApiProperty({ description: '所在院校' })
+  'school': string = undefined;
+  @ApiProperty({ description: '最高学历' })
+  'education': string = undefined;
+  @ApiProperty({ description: '所学专业' })
+  'major': string = undefined;
+  @ApiProperty({ description: '单位名称' })
+  'company': string = undefined;
+  @ApiProperty({ description: '职务职称' })
+  'zwzc': string = undefined;
+  @ApiProperty({ description: '头像图片' })
+  'icon': Array<any> = undefined;
+  @ApiProperty({ description: '擅长领域' })
+  'expertise': string = undefined;
+  @ApiProperty({ description: '工作经历' })
+  'workexperience': string = undefined;
+  @ApiProperty({ description: '科研综述' })
+  'scientific': string = undefined;
+  @ApiProperty({ description: '承担项目' })
+  'undertakingproject': string = undefined;
+  @ApiProperty({ description: '科技奖励' })
+  'scienceaward': string = undefined;
+  @ApiProperty({ description: '社会任职' })
+  'social': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_expert extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'type',
+      'code',
+      'account',
+      'name',
+      'phone',
+      'email',
+      'card',
+      'status',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '账号类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '身份证号' })
+  'card': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_expert extends FVO_expert {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_expert {
+  @ApiProperty({ description: '账号类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  @Rule(RuleType['string']().empty(''))
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': 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(''))
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  @Rule(RuleType['string']().empty(''))
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  @Rule(RuleType['string']().empty(''))
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  @Rule(RuleType['string']().empty(''))
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  @Rule(RuleType['string']().empty(''))
+  'area': string = undefined;
+  @ApiProperty({ description: '身份证号' })
+  @Rule(RuleType['string']().empty(''))
+  'card': string = undefined;
+  @ApiProperty({ description: '出生日期' })
+  @Rule(RuleType['string']().empty(''))
+  'birth': string = undefined;
+  @ApiProperty({ description: 'qq&&微信' })
+  @Rule(RuleType['string']().empty(''))
+  'qqwx': string = undefined;
+  @ApiProperty({ description: '所在院校' })
+  @Rule(RuleType['string']().empty(''))
+  'school': string = undefined;
+  @ApiProperty({ description: '最高学历' })
+  @Rule(RuleType['string']().empty(''))
+  'education': string = undefined;
+  @ApiProperty({ description: '所学专业' })
+  @Rule(RuleType['string']().empty(''))
+  'major': string = undefined;
+  @ApiProperty({ description: '单位名称' })
+  @Rule(RuleType['string']().empty(''))
+  'company': string = undefined;
+  @ApiProperty({ description: '职务职称' })
+  @Rule(RuleType['string']().empty(''))
+  'zwzc': string = undefined;
+  @ApiProperty({ description: '头像图片' })
+  @Rule(RuleType['array']().empty(''))
+  'icon': Array<any> = undefined;
+  @ApiProperty({ description: '擅长领域' })
+  @Rule(RuleType['string']().empty(''))
+  'expertise': string = undefined;
+  @ApiProperty({ description: '工作经历' })
+  @Rule(RuleType['string']().empty(''))
+  'workexperience': string = undefined;
+  @ApiProperty({ description: '科研综述' })
+  @Rule(RuleType['string']().empty(''))
+  'scientific': string = undefined;
+  @ApiProperty({ description: '承担项目' })
+  @Rule(RuleType['string']().empty(''))
+  'undertakingproject': string = undefined;
+  @ApiProperty({ description: '科技奖励' })
+  @Rule(RuleType['string']().empty(''))
+  'scienceaward': string = undefined;
+  @ApiProperty({ description: '社会任职' })
+  @Rule(RuleType['string']().empty(''))
+  'social': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_expert extends FVO_expert {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_expert extends CDTO_expert {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_expert extends FVO_expert {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+export class LoginVO {
+  constructor(data: object) {
+    for (const key of Object.keys(this)) {
+      this[key] = get(data, key);
+    }
+    this.type = '5';
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '账号类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  'area': string = undefined;
+  @ApiProperty({ description: '身份证号' })
+  'card': string = undefined;
+  @ApiProperty({ description: '出生日期' })
+  'birth': string = undefined;
+  @ApiProperty({ description: 'qq&&微信' })
+  'qqwx': string = undefined;
+  @ApiProperty({ description: '所在院校' })
+  'school': string = undefined;
+  @ApiProperty({ description: '最高学历' })
+  'education': string = undefined;
+  @ApiProperty({ description: '所学专业' })
+  'major': string = undefined;
+  @ApiProperty({ description: '单位名称' })
+  'company': string = undefined;
+  @ApiProperty({ description: '职务职称' })
+  'zwzc': string = undefined;
+  @ApiProperty({ description: '头像图片' })
+  'icon': Array<any> = undefined;
+  @ApiProperty({ description: '擅长领域' })
+  'expertise': string = undefined;
+  @ApiProperty({ description: '工作经历' })
+  'workexperience': string = undefined;
+  @ApiProperty({ description: '科研综述' })
+  'scientific': string = undefined;
+  @ApiProperty({ description: '承担项目' })
+  'undertakingproject': string = undefined;
+  @ApiProperty({ description: '科技奖励' })
+  'scienceaward': string = undefined;
+  @ApiProperty({ description: '社会任职' })
+  'social': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class LoginDTO {
+  @ApiProperty({ description: '账号', example: 'test' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码', example: '111111' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+}
+
+export class ResetPasswordDTO {
+  @ApiProperty({ description: '密码', example: '123456' })
+  @Rule(RuleType['string']().required())
+  'password': string = undefined;
+}

+ 57 - 0
src/interface/user/personal.interface.ts

@@ -183,3 +183,60 @@ export class UVAO_personal extends FVO_personal {
     dealVO(this, data);
   }
 }
+export class LoginVO {
+  constructor(data: object) {
+    for (const key of Object.keys(this)) {
+      this[key] = get(data, key);
+    }
+    this.type = '3';
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  'area': string = undefined;
+  @ApiProperty({ description: '身份证号' })
+  'card': string = undefined;
+  @ApiProperty({ description: '职务职称' })
+  'zwzc': string = undefined;
+  @ApiProperty({ description: '所在院系' })
+  'school': string = undefined;
+  @ApiProperty({ description: '所学专业' })
+  'major': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class LoginDTO {
+  @ApiProperty({ description: '账号', example: 'test' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码', example: '111111' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+}
+
+export class ResetPasswordDTO {
+  @ApiProperty({ description: '密码', example: '123456' })
+  @Rule(RuleType['string']().required())
+  'password': string = undefined;
+}

+ 12 - 0
src/interface/util/user.util.interface.ts

@@ -0,0 +1,12 @@
+export interface CheckUpdateCardAndPid {
+  phone?: string;
+  pid?: string;
+  code?: string;
+  name?: string;
+}
+export interface checkPhoneAndPid {
+  phone?: string;
+  pid?: string;
+  code?: string;
+  name?: string;
+}

+ 33 - 0
src/middleware/checkToken.middleware.ts

@@ -0,0 +1,33 @@
+import { IMiddleware } from '@midwayjs/core';
+import { Middleware, Inject } from '@midwayjs/decorator';
+import { NextFunction, Context } from '@midwayjs/koa';
+import get = require('lodash/get');
+import { JwtService } from '@midwayjs/jwt';
+
+@Middleware()
+export class CheckTokenMiddleware
+  implements IMiddleware<Context, NextFunction>
+{
+  @Inject()
+  jwtService: JwtService;
+  resolve() {
+    return async (ctx: Context, next: NextFunction) => {
+      const token: any = get(ctx.request, 'header.token');
+      if (token) {
+        const data = this.jwtService.decodeSync(token);
+        if (data) ctx.user = data;
+      }
+      // 添加管理员身份
+      const adminToken: any = get(ctx.request, 'header.admin-token');
+      if (adminToken) {
+        const data = this.jwtService.decodeSync(adminToken);
+        if (data) ctx.admin = data;
+      }
+      await next();
+    };
+  }
+
+  static getName(): string {
+    return 'checkToken';
+  }
+}

+ 11 - 0
src/service/channel/channel.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Channel } from '../../entity/channel/channel.entity';
+type modelType = ReturnModelType<typeof Channel>;
+@Provide()
+export class ChannelService extends BaseService<modelType> {
+  @InjectEntityModel(Channel)
+  model: modelType;
+}

+ 11 - 0
src/service/product/product.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Product } from '../../entity/product/product.entity';
+type modelType = ReturnModelType<typeof Product>;
+@Provide()
+export class ProductService extends BaseService<modelType> {
+  @InjectEntityModel(Product)
+  model: modelType;
+}

+ 11 - 0
src/service/technology/dock.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Dock } from '../../entity/technology/dock.entity';
+type modelType = ReturnModelType<typeof Dock>;
+@Provide()
+export class DockService extends BaseService<modelType> {
+  @InjectEntityModel(Dock)
+  model: modelType;
+}

+ 11 - 0
src/service/technology/dockChat.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DockChat } from '../../entity/technology/dockChat.entity';
+type modelType = ReturnModelType<typeof DockChat>;
+@Provide()
+export class DockChatService extends BaseService<modelType> {
+  @InjectEntityModel(DockChat)
+  model: modelType;
+}

+ 11 - 0
src/service/technology/dockExpert.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DockExpert } from '../../entity/technology/dockExpert.entity';
+type modelType = ReturnModelType<typeof DockExpert>;
+@Provide()
+export class DockExpertService extends BaseService<modelType> {
+  @InjectEntityModel(DockExpert)
+  model: modelType;
+}

+ 11 - 0
src/service/technology/dockImgtxt.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DockImgtxt } from '../../entity/technology/dockImgtxt.entity';
+type modelType = ReturnModelType<typeof DockImgtxt>;
+@Provide()
+export class DockImgtxtService extends BaseService<modelType> {
+  @InjectEntityModel(DockImgtxt)
+  model: modelType;
+}

+ 11 - 0
src/service/technology/dockTrans.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DockTrans } from '../../entity/technology/dockTrans.entity';
+type modelType = ReturnModelType<typeof DockTrans>;
+@Provide()
+export class DockTransService extends BaseService<modelType> {
+  @InjectEntityModel(DockTrans)
+  model: modelType;
+}

+ 11 - 0
src/service/technology/dockUser.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DockUser } from '../../entity/technology/dockUser.entity';
+type modelType = ReturnModelType<typeof DockUser>;
+@Provide()
+export class DockUserService extends BaseService<modelType> {
+  @InjectEntityModel(DockUser)
+  model: modelType;
+}

+ 11 - 0
src/service/technology/dockVideo.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DockVideo } from '../../entity/technology/dockVideo.entity';
+type modelType = ReturnModelType<typeof DockVideo>;
+@Provide()
+export class DockVideoService extends BaseService<modelType> {
+  @InjectEntityModel(DockVideo)
+  model: modelType;
+}

+ 11 - 0
src/service/train/train.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Train } from '../../entity/train/train.entity';
+type modelType = ReturnModelType<typeof Train>;
+@Provide()
+export class TrainService extends BaseService<modelType> {
+  @InjectEntityModel(Train)
+  model: modelType;
+}

+ 11 - 0
src/service/train/trainChat.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { TrainChat } from '../../entity/train/trainChat.entity';
+type modelType = ReturnModelType<typeof TrainChat>;
+@Provide()
+export class TrainChatService extends BaseService<modelType> {
+  @InjectEntityModel(TrainChat)
+  model: modelType;
+}

+ 11 - 0
src/service/train/trainUser.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { TrainUser } from '../../entity/train/trainUser.entity';
+type modelType = ReturnModelType<typeof TrainUser>;
+@Provide()
+export class TrainUserService extends BaseService<modelType> {
+  @InjectEntityModel(TrainUser)
+  model: modelType;
+}

+ 11 - 0
src/service/train/trainVideo.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { TrainVideo } from '../../entity/train/trainVideo.entity';
+type modelType = ReturnModelType<typeof TrainVideo>;
+@Provide()
+export class TrainVideoService extends BaseService<modelType> {
+  @InjectEntityModel(TrainVideo)
+  model: modelType;
+}

+ 20 - 1
src/service/user/admin.service.ts

@@ -1,11 +1,30 @@
 import { Provide } from '@midwayjs/decorator';
 import { InjectEntityModel } from '@midwayjs/typegoose';
 import { ReturnModelType } from '@typegoose/typegoose';
-import { BaseService } from 'free-midway-component';
+import {
+  BaseService,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
 import { Admin } from '../../entity/user/admin.entity';
+import { LoginDTO } from '../../interface/user/admin.interface';
+import isEqual = require('lodash/isEqual');
 type modelType = ReturnModelType<typeof Admin>;
 @Provide()
 export class AdminService extends BaseService<modelType> {
   @InjectEntityModel(Admin)
   model: modelType;
+
+  async findUserToLogin(data: LoginDTO): Promise<object> {
+    const { account, password } = data;
+    const user = await this.model.findOne({ account }, '+password').lean();
+    if (!user)
+      throw new ServiceError(
+        '未找到用户信息',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
+    if (!isEqual(user.password.secret, password))
+      throw new ServiceError('密码错误', FrameworkErrorEnum.SERVICE_FAULT);
+    return user;
+  }
 }

+ 36 - 0
src/service/user/company.service.ts

@@ -0,0 +1,36 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import {
+  BaseService,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
+import { Company } from '../../entity/user/company.entity';
+import { LoginDTO } from '../../interface/user/company.interface';
+import isEqual = require('lodash/isEqual');
+import get = require('lodash/get');
+type modelType = ReturnModelType<typeof Company>;
+@Provide()
+export class CompanyService extends BaseService<modelType> {
+  @InjectEntityModel(Company)
+  model: modelType;
+
+  async findUserToLogin(data: LoginDTO): Promise<object> {
+    const { account, password } = data;
+    const user = await this.model.findOne({ account }, '+password').lean();
+    if (!user)
+      throw new ServiceError(
+        '未找到用户信息',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
+    if (get(user, 'exam_status') !== '1')
+      throw new ServiceError(
+        '当前用户没有通过审核,拒绝登录',
+        FrameworkErrorEnum.SERVICE_FAULT
+      );
+    if (!isEqual(user.password.secret, password))
+      throw new ServiceError('密码错误', FrameworkErrorEnum.SERVICE_FAULT);
+    return user;
+  }
+}

+ 36 - 0
src/service/user/expert.service.ts

@@ -0,0 +1,36 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import {
+  BaseService,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
+import { Expert } from '../../entity/user/expert.entity';
+import { LoginDTO } from '../../interface/user/expert.interface';
+import isEqual = require('lodash/isEqual');
+import get = require('lodash/get');
+type modelType = ReturnModelType<typeof Expert>;
+@Provide()
+export class ExpertService extends BaseService<modelType> {
+  @InjectEntityModel(Expert)
+  model: modelType;
+
+  async findUserToLogin(data: LoginDTO): Promise<object> {
+    const { account, password } = data;
+    const user = await this.model.findOne({ account }, '+password').lean();
+    if (!user)
+      throw new ServiceError(
+        '未找到用户信息',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
+    if (get(user, 'exam_status') !== '1')
+      throw new ServiceError(
+        '当前用户没有通过审核,拒绝登录',
+        FrameworkErrorEnum.SERVICE_FAULT
+      );
+    if (!isEqual(user.password.secret, password))
+      throw new ServiceError('密码错误', FrameworkErrorEnum.SERVICE_FAULT);
+    return user;
+  }
+}

+ 26 - 1
src/service/user/personal.service.ts

@@ -1,11 +1,36 @@
 import { Provide } from '@midwayjs/decorator';
 import { InjectEntityModel } from '@midwayjs/typegoose';
 import { ReturnModelType } from '@typegoose/typegoose';
-import { BaseService } from 'free-midway-component';
+import {
+  BaseService,
+  FrameworkErrorEnum,
+  ServiceError,
+} from 'free-midway-component';
 import { Personal } from '../../entity/user/personal.entity';
+import { LoginDTO } from '../../interface/user/personal.interface';
+import isEqual = require('lodash/isEqual');
+import get = require('lodash/get');
 type modelType = ReturnModelType<typeof Personal>;
 @Provide()
 export class PersonalService extends BaseService<modelType> {
   @InjectEntityModel(Personal)
   model: modelType;
+
+  async findUserToLogin(data: LoginDTO): Promise<object> {
+    const { account, password } = data;
+    const user = await this.model.findOne({ account }, '+password').lean();
+    if (!user)
+      throw new ServiceError(
+        '未找到用户信息',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
+    if (get(user, 'exam_status') !== '1')
+      throw new ServiceError(
+        '当前用户没有通过审核,拒绝登录',
+        FrameworkErrorEnum.SERVICE_FAULT
+      );
+    if (!isEqual(user.password.secret, password))
+      throw new ServiceError('密码错误', FrameworkErrorEnum.SERVICE_FAULT);
+    return user;
+  }
 }

+ 115 - 0
src/service/util/user.util.ts

@@ -0,0 +1,115 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { FrameworkErrorEnum, ServiceError } from 'free-midway-component';
+import { Admin } from '../../entity/user/admin.entity';
+import { Personal } from '../../entity/user/personal.entity';
+import { Company } from '../../entity/user/company.entity';
+import { Expert } from '../../entity/user/expert.entity';
+import { Types } from 'mongoose';
+const ObjectId = Types.ObjectId;
+import {
+  CheckUpdateCardAndPid,
+  checkPhoneAndPid,
+} from '../../interface/util/user.util.interface';
+
+@Provide()
+export class UserUtilService {
+  @InjectEntityModel(Admin)
+  adminModel: ReturnModelType<typeof Admin>;
+
+  @InjectEntityModel(Personal)
+  personalModel: ReturnModelType<typeof Personal>;
+
+  @InjectEntityModel(Company)
+  companyModel: ReturnModelType<typeof Company>;
+
+  @InjectEntityModel(Expert)
+  expertModel: ReturnModelType<typeof Expert>;
+
+  /**
+   * 检查创建时,手机号和上级id
+   * @param data 参数
+   */
+  async checkPhoneAndPid(data: checkPhoneAndPid) {
+    // 检查手机号
+    const adminan = await this.adminModel.count({ phone: data.phone });
+    if (adminan > 0) {
+      throw new ServiceError(
+        '已有管理员/机构管理员/业务管理员 使用该手机号',
+        FrameworkErrorEnum.BAD_BODY
+      );
+    }
+    const expertan = await this.expertModel.count({
+      phone: data.phone,
+      isdel: '0',
+    });
+    if (expertan > 0) {
+      throw new ServiceError(
+        '已有专家用户使用该手机号',
+        FrameworkErrorEnum.BAD_BODY
+      );
+    }
+    const personalan = await this.personalModel.count({
+      phone: data.phone,
+      code: data.code,
+      isdel: '0',
+    });
+    if (personalan > 0) {
+      throw new ServiceError(
+        `姓名:${data.name} ; 手机号: ${data.phone} ;已有机构所属的个人用户使用该手机号`,
+        FrameworkErrorEnum.BAD_BODY
+      );
+    }
+    // 检查上级id
+    if (data.pid) {
+      const adminid = await this.adminModel.count({
+        _id: new ObjectId(data.pid),
+      });
+      if (adminid <= 0)
+        throw new ServiceError(
+          '未找到上级的信息',
+          FrameworkErrorEnum.NOT_FOUND_DATA
+        );
+    } else {
+      throw new ServiceError(
+        '未找到上级的信息',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
+    }
+  }
+  /**
+   * 检查创建时,手机号和上级id
+   * @param id 当前要修改的数据
+   * @param data 参数
+   */
+  async checkUpdateCardAndPid(id, data: CheckUpdateCardAndPid) {
+    const { phone, code } = data;
+    if (phone && code) {
+      const personalan = await this.personalModel.count({
+        _id: { $ne: id },
+        phone,
+        code,
+        isdel: '0',
+      });
+      if (personalan > 0)
+        throw new ServiceError(
+          `姓名:${data.name} ; 手机号: ${data.phone} ;已有机构所属的个人用户使用该手机号`,
+          FrameworkErrorEnum.BAD_BODY
+        );
+    }
+    if (phone) {
+      const expertan = await this.expertModel.count({
+        _id: { $ne: id },
+        phone,
+        isdel: '0',
+      });
+      if (expertan > 0) {
+        throw new ServiceError(
+          '已有专家用户使用该手机号',
+          FrameworkErrorEnum.BAD_BODY
+        );
+      }
+    }
+  }
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 430 - 0
src/util/pinyin.ts


+ 14 - 0
src/util/util.ts

@@ -0,0 +1,14 @@
+import _ = require('lodash');
+export function randomStr() {
+  return Math.random().toString(36).substr(2, 8);
+}
+export function getDataFromTarget(
+  data: object,
+  target: string,
+  props: Array<string>
+) {
+  const obj = _.get(data, target);
+  if (!obj) return;
+  return _.pick(obj, props);
+}
+export const RegisterCanNotIncludes = ['admin'];