|
@@ -1,7 +1,7 @@
|
|
|
import { Body, Controller, Del, Get, Inject, Param, Post, Query } from '@midwayjs/decorator';
|
|
|
import { BaseController } from 'free-midway-component';
|
|
|
import { ConfigService } from '../service/config.service';
|
|
|
-import { CDTO_config, CVO_config, FVO_config, QDTO_config, QVO_config, UDTO_config, UVAO_config } from '../interface/config.interface';
|
|
|
+import { CDTO_config, CVO_config, FVO_config, QVO_config, UDTO_config, UVAO_config } from '../interface/config.interface';
|
|
|
import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
|
|
|
import { Validate } from '@midwayjs/validate';
|
|
|
@ApiTags(['平台设置'])
|
|
@@ -21,17 +21,13 @@ export class ConfigController extends BaseController {
|
|
|
@Get('/')
|
|
|
@ApiQuery({ name: 'query' })
|
|
|
@ApiResponse({ type: QVO_config })
|
|
|
- async query(@Query() filter: QDTO_config, @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_config(i);
|
|
|
- data.push(newData);
|
|
|
- }
|
|
|
- const total = await this.service.count(filter);
|
|
|
- return { data, total };
|
|
|
+ async query() {
|
|
|
+ const data = await this.service.findByOne();
|
|
|
+ const result = new QVO_config(data);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Get('/:id')
|
|
|
@ApiResponse({ type: FVO_config })
|
|
|
async fetch(@Param('id') id: string) {
|