feat: Phase 1-3 全部完成 — 沙盒增强、学情分析、学习路径
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { ContentsService } from './contents.service';
|
||||
|
||||
@ApiTags('内容')
|
||||
@Controller('contents')
|
||||
export class ContentsController {
|
||||
constructor(private contentsService: ContentsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@Query() query: { page?: number; pageSize?: number; categoryId?: number; contentType?: string }) {
|
||||
return this.contentsService.findAll(query);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findById(@Param('id') id: string) {
|
||||
return this.contentsService.findById(+id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Body() body: any) {
|
||||
return this.contentsService.create(body);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
async update(@Param('id') id: string, @Body() body: any) {
|
||||
return this.contentsService.update(+id, body);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async remove(@Param('id') id: string) {
|
||||
return this.contentsService.remove(+id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user