23 lines
720 B
TypeScript
23 lines
720 B
TypeScript
|
|
import { Controller, Get, Post, Param, HttpCode, HttpStatus, Body } from '@nestjs/common';
|
||
|
|
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||
|
|
import { DocumentImportService } from './document-import.service';
|
||
|
|
|
||
|
|
@ApiTags('document-import')
|
||
|
|
@Controller('imports')
|
||
|
|
export class DocumentImportController {
|
||
|
|
constructor(private readonly service: DocumentImportService) {}
|
||
|
|
|
||
|
|
@Post()
|
||
|
|
@HttpCode(HttpStatus.CREATED)
|
||
|
|
@ApiOperation({ summary: '创建导入任务' })
|
||
|
|
async createImport(@Body() body: any) {
|
||
|
|
return this.service.createImport(body);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get(':id/status')
|
||
|
|
@ApiOperation({ summary: '查询导入状态' })
|
||
|
|
async getStatus(@Param('id') id: string) {
|
||
|
|
return this.service.getStatus(id);
|
||
|
|
}
|
||
|
|
}
|