|
@@ -1,13 +1,13 @@
|
|
import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/core';
|
|
import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/core';
|
|
import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
|
|
import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
|
|
import { Validate } from '@midwayjs/validate';
|
|
import { Validate } from '@midwayjs/validate';
|
|
-import { UtilService } from '../../service/util.service';
|
|
|
|
import { BaseController } from '../../frame/BaseController';
|
|
import { BaseController } from '../../frame/BaseController';
|
|
import { omit, pick } from 'lodash';
|
|
import { omit, pick } from 'lodash';
|
|
import { ErrorCode, ServiceError } from '../../error/service.error';
|
|
import { ErrorCode, ServiceError } from '../../error/service.error';
|
|
import { Context } from '@midwayjs/koa';
|
|
import { Context } from '@midwayjs/koa';
|
|
import { InvestmentService } from '../../service/users/investment.service';
|
|
import { InvestmentService } from '../../service/users/investment.service';
|
|
import { QVO_investment, FVO_investment, CVO_investment, UVAO_investment } from '../../interface/users/investment.interface';
|
|
import { QVO_investment, FVO_investment, CVO_investment, UVAO_investment } from '../../interface/users/investment.interface';
|
|
|
|
+import { ServiceUtilService } from '../../service/serviceUtil.service';
|
|
const namePrefix = '投资人';
|
|
const namePrefix = '投资人';
|
|
@ApiTags(['投资人'])
|
|
@ApiTags(['投资人'])
|
|
@Controller('/investment', { tagName: namePrefix })
|
|
@Controller('/investment', { tagName: namePrefix })
|
|
@@ -18,7 +18,7 @@ export class InvestmentController implements BaseController {
|
|
ctx: Context;
|
|
ctx: Context;
|
|
|
|
|
|
@Inject()
|
|
@Inject()
|
|
- utilService: UtilService;
|
|
|
|
|
|
+ serviceUtil: ServiceUtilService;
|
|
|
|
|
|
@Get('/')
|
|
@Get('/')
|
|
@ApiTags('列表查询')
|
|
@ApiTags('列表查询')
|
|
@@ -46,6 +46,7 @@ export class InvestmentController implements BaseController {
|
|
@ApiResponse({ type: CVO_investment })
|
|
@ApiResponse({ type: CVO_investment })
|
|
async create(@Body() data: object) {
|
|
async create(@Body() data: object) {
|
|
const dbData = await this.service.create(data);
|
|
const dbData = await this.service.create(data);
|
|
|
|
+ this.serviceUtil.fillIdentity(data, 'Investment');
|
|
const result = new CVO_investment(dbData);
|
|
const result = new CVO_investment(dbData);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -57,7 +58,7 @@ export class InvestmentController implements BaseController {
|
|
async update(@Param('id') id: number, @Body() data: object) {
|
|
async update(@Param('id') id: number, @Body() data: object) {
|
|
if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
|
|
if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
|
|
const result = await this.service.update({ id }, data);
|
|
const result = await this.service.update({ id }, data);
|
|
- await this.utilService.updateUserAfter(id, data, 'Association');
|
|
|
|
|
|
+ this.serviceUtil.fillIdentity(data, 'Investment');
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|