34 lines
993 B
TypeScript
34 lines
993 B
TypeScript
|
|
import { Controller, Get, Post, Patch, Body, Param } from '@nestjs/common';
|
||
|
|
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||
|
|
import { FocusItemsService } from './focus-items.service';
|
||
|
|
|
||
|
|
@ApiTags('focus-items')
|
||
|
|
@Controller('focus-items')
|
||
|
|
export class FocusItemsController {
|
||
|
|
constructor(private readonly focusItemsService: FocusItemsService) {}
|
||
|
|
|
||
|
|
@Get()
|
||
|
|
@ApiOperation({ summary: '获取待巩固项列表' })
|
||
|
|
async findAll() {
|
||
|
|
return this.focusItemsService.findAll();
|
||
|
|
}
|
||
|
|
|
||
|
|
@Post()
|
||
|
|
@ApiOperation({ summary: '创建待巩固项' })
|
||
|
|
async create(@Body() dto: any) {
|
||
|
|
return this.focusItemsService.create(dto);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Patch(':id')
|
||
|
|
@ApiOperation({ summary: '更新待巩固项' })
|
||
|
|
async update(@Param('id') id: string, @Body() dto: any) {
|
||
|
|
return this.focusItemsService.update(id, dto);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Post(':id/complete')
|
||
|
|
@ApiOperation({ summary: '完成待巩固项' })
|
||
|
|
async complete(@Param('id') id: string) {
|
||
|
|
return this.focusItemsService.complete(id);
|
||
|
|
}
|
||
|
|
}
|