完成资源CRUD
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put } from "@nestjs/common";
|
||||
import { Body, Controller, Delete, Get, Param, ParseUUIDPipe, Post, Put } from "@nestjs/common";
|
||||
import { CreateResourceDto } from "src/admin/dto/admin-web/create-resource.dto";
|
||||
import { ResourceService } from "src/resource/resource.service";
|
||||
|
||||
@@ -14,6 +14,11 @@ export class AdminWebResourceController {
|
||||
return this.resourceService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async get(@Param('id', new ParseUUIDPipe({ version: '4' })) id: string) {
|
||||
return this.resourceService.findById(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Body() data: CreateResourceDto) {
|
||||
return this.resourceService.create(data);
|
||||
|
||||
Reference in New Issue
Block a user