Ver Fonte

新增表

zs há 1 ano atrás
pai
commit
3fd086af3a

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

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

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

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

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

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

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

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

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

@@ -0,0 +1,68 @@
+import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { StateService } from '../../service/users/state.service';
+import { CDTO_state, CVO_state, FVO_state, QDTO_state, QVO_state, UDTO_state, UVAO_state } from '../../interface/users/state.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['政府部门'])
+@Controller('/state')
+export class StateController extends BaseController {
+  @Inject()
+  service: StateService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_state })
+  async create(@Body() data: CDTO_state) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_state(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_state })
+  async query(@Query() filter: QDTO_state, @Query('skip') skip: number, @Query('limit') limit: number) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_state(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_state })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_state(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_state })
+  async update(@Param('id') id: string, @Body() body: UDTO_state) {
+    const result = await this.service.updateOne(id, body);
+    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.');
+  }
+}

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

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

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

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

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

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

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

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

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

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

+ 106 - 0
src/interface/users/association.interface.ts

@@ -0,0 +1,106 @@
+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_association {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_association extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'name', 'person_phone', 'is_show', 'status'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_association extends FVO_association {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_association {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  @Rule(RuleType['string']().empty(''))
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  @Rule(RuleType['string']().empty(''))
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '地址' })
+  @Rule(RuleType['string']().empty(''))
+  'address': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_association extends FVO_association {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_association extends CDTO_association {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_association extends FVO_association {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 103 - 0
src/interface/users/competition.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_competition {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人名称' })
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_competition extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'name', 'person', 'person_phone', 'is_show', 'status'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人名称' })
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_competition extends FVO_competition {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_competition {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人名称' })
+  @Rule(RuleType['string']().empty(''))
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  @Rule(RuleType['string']().empty(''))
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_competition extends FVO_competition {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_competition extends CDTO_competition {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_competition extends FVO_competition {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 106 - 0
src/interface/users/incubator.interface.ts

@@ -0,0 +1,106 @@
+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_incubator {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人姓名' })
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_incubator extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'name', 'person_phone', 'is_show', 'status'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_incubator extends FVO_incubator {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_incubator {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人姓名' })
+  @Rule(RuleType['string']().empty(''))
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  @Rule(RuleType['string']().empty(''))
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '地址' })
+  @Rule(RuleType['string']().empty(''))
+  'address': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_incubator extends FVO_incubator {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_incubator extends CDTO_incubator {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_incubator extends FVO_incubator {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 123 - 0
src/interface/users/investment.interface.ts

@@ -0,0 +1,123 @@
+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_investment {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '投资人姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '投资人证件类型' })
+  'cardType': string = undefined;
+  @ApiProperty({ description: '投资人证件号码' })
+  'card': string = undefined;
+  @ApiProperty({ description: ' 投资人出资额' })
+  'money': string = undefined;
+  @ApiProperty({ description: '投资人出资方式' })
+  'type': string = undefined;
+  @ApiProperty({ description: '投资人的住所地' })
+  'address': string = undefined;
+  @ApiProperty({ description: '投资人的联系方式' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_investment extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'name', 'type', 'brief', 'is_show', 'status'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '投资人姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '投资人出资方式' })
+  'type': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_investment extends FVO_investment {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_investment {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '投资人姓名' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '投资人证件类型' })
+  @Rule(RuleType['string']().empty(''))
+  'cardType': string = undefined;
+  @ApiProperty({ description: '投资人证件号码' })
+  @Rule(RuleType['string']().empty(''))
+  'card': string = undefined;
+  @ApiProperty({ description: ' 投资人出资额' })
+  @Rule(RuleType['string']().empty(''))
+  'money': string = undefined;
+  @ApiProperty({ description: '投资人出资方式' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '投资人的住所地' })
+  @Rule(RuleType['string']().empty(''))
+  'address': string = undefined;
+  @ApiProperty({ description: '投资人的联系方式' })
+  @Rule(RuleType['string']().empty(''))
+  'phone': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_investment extends FVO_investment {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_investment extends CDTO_investment {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_investment extends FVO_investment {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 113 - 0
src/interface/users/state.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_state {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '部门类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_state extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['user', 'name', 'type', 'address', 'is_show', 'status'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '平台用户id' })
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '部门类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QVO_state extends FVO_state {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_state {
+  @ApiProperty({ description: '平台用户id' })
+  @Rule(RuleType['string']().empty(''))
+  'user': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '负责人' })
+  @Rule(RuleType['string']().empty(''))
+  'person': string = undefined;
+  @ApiProperty({ description: '负责人电话' })
+  @Rule(RuleType['string']().empty(''))
+  'person_phone': string = undefined;
+  @ApiProperty({ description: '部门类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '地址' })
+  @Rule(RuleType['string']().empty(''))
+  'address': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  @Rule(RuleType['string']().empty(''))
+  'is_show': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_state extends FVO_state {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_state extends CDTO_state {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_state extends FVO_state {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 11 - 0
src/service/users/association.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 { Association } from '../../entity/users/association.entity';
+type modelType = ReturnModelType<typeof Association>;
+@Provide()
+export class AssociationService extends BaseService<modelType> {
+  @InjectEntityModel(Association)
+  model: modelType;
+}

+ 11 - 0
src/service/users/competition.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 { Competition } from '../../entity/users/competition.entity';
+type modelType = ReturnModelType<typeof Competition>;
+@Provide()
+export class CompetitionService extends BaseService<modelType> {
+  @InjectEntityModel(Competition)
+  model: modelType;
+}

+ 11 - 0
src/service/users/incubator.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 { Incubator } from '../../entity/users/incubator.entity';
+type modelType = ReturnModelType<typeof Incubator>;
+@Provide()
+export class IncubatorService extends BaseService<modelType> {
+  @InjectEntityModel(Incubator)
+  model: modelType;
+}

+ 11 - 0
src/service/users/investment.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 { Investment } from '../../entity/users/investment.entity';
+type modelType = ReturnModelType<typeof Investment>;
+@Provide()
+export class InvestmentService extends BaseService<modelType> {
+  @InjectEntityModel(Investment)
+  model: modelType;
+}

+ 11 - 0
src/service/users/state.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 { State } from '../../entity/users/state.entity';
+type modelType = ReturnModelType<typeof State>;
+@Provide()
+export class StateService extends BaseService<modelType> {
+  @InjectEntityModel(State)
+  model: modelType;
+}