Files
vanillameta/backend-api/src/widget/widget.controller.ts
HeeseonYoon 73ea4f5c4a [feat] 데이터셋 생성 API,
[bug] 템플릿 삭제값 오류 수정
[feat] 위젯 생성 작업중
2022-09-28 17:23:56 +09:00

42 lines
1022 B
TypeScript

import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { WidgetService } from './widget.service';
import { CreateWidgetDto } from './dto/create-widget.dto';
import { UpdateWidgetDto } from './dto/update-widget.dto';
@Controller('widget')
export class WidgetController {
constructor(private readonly widgetService: WidgetService) {}
/**
* 위젯 생성
* @param createWidgetDto
*/
@Post()
create(@Body() createWidgetDto: CreateWidgetDto) {
return this.widgetService.create(createWidgetDto);
}
/**
* 위젯 목록 조회
*/
@Get()
findAll() {
return this.widgetService.findAll();
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.widgetService.findOne(+id);
}
@Patch(':id')
update(@Param('id') id: string, @Body() updateWidgetDto: UpdateWidgetDto) {
return this.widgetService.update(+id, updateWidgetDto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.widgetService.remove(+id);
}
}