第一次提交
This commit is contained in:
22
src/keywords/keywords.controller.ts
Normal file
22
src/keywords/keywords.controller.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Controller, Get, Post, Body, Delete, Param } from '@nestjs/common';
|
||||
import { KeywordsService } from './keywords.service';
|
||||
|
||||
@Controller('api/keywords')
|
||||
export class KeywordsController {
|
||||
constructor(private readonly keywordsService: KeywordsService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.keywordsService.findAll();
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body('word') word: string, @Body('weight') weight: number) {
|
||||
return this.keywordsService.create(word, weight);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.keywordsService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user