|
@@ -6,6 +6,7 @@ import { omit, pick } from 'lodash';
|
|
|
import { ServiceError, ErrorCode } from '../../error/service.error';
|
|
|
import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayjs/core';
|
|
|
import { BaseController } from '../../frame/BaseController';
|
|
|
+import { ServiceUtilService } from '../../service/serviceUtil.service';
|
|
|
const namePrefix = '收藏';
|
|
|
@ApiTags(['收藏'])
|
|
|
@Controller('/news', { tagName: namePrefix })
|
|
@@ -13,6 +14,9 @@ export class NewsController implements BaseController {
|
|
|
@Inject()
|
|
|
service: NewsService;
|
|
|
|
|
|
+ @Inject()
|
|
|
+ serviceUtil: ServiceUtilService;
|
|
|
+
|
|
|
@Get('/')
|
|
|
@ApiTags('列表查询')
|
|
|
@ApiQuery({ name: 'query' })
|
|
@@ -63,4 +67,12 @@ export class NewsController implements BaseController {
|
|
|
const result = await this.service.delete({ id });
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ @Get('/detail/:id')
|
|
|
+ @ApiResponse({ type: FVO_news })
|
|
|
+ async detail(@Param('id') id: string) {
|
|
|
+ let data = await this.service.fetch({ id });
|
|
|
+ data = await this.serviceUtil.fillCollection(data);
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|