35 lines
978 B
TypeScript
35 lines
978 B
TypeScript
|
|
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
||
|
|
import { CreateProductInfoDto } from './dto/create-product-info.dto'
|
||
|
|
import { UpdateProductInfoDto } from './dto/update-product-info.dto'
|
||
|
|
import { ProductInfoService } from './product-info.service'
|
||
|
|
|
||
|
|
@Controller('product-info')
|
||
|
|
export class ProductInfoController {
|
||
|
|
constructor(private readonly productInfoService: ProductInfoService) {}
|
||
|
|
|
||
|
|
@Post()
|
||
|
|
create(@Body() dto: CreateProductInfoDto) {
|
||
|
|
return this.productInfoService.create(dto)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get()
|
||
|
|
findAll() {
|
||
|
|
return this.productInfoService.findAll()
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get(':id')
|
||
|
|
findOne(@Param('id') id: string) {
|
||
|
|
return this.productInfoService.findOne(Number(id))
|
||
|
|
}
|
||
|
|
|
||
|
|
@Patch(':id')
|
||
|
|
update(@Param('id') id: string, @Body() dto: UpdateProductInfoDto) {
|
||
|
|
return this.productInfoService.update(Number(id), dto)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Delete(':id')
|
||
|
|
remove(@Param('id') id: string) {
|
||
|
|
return this.productInfoService.remove(Number(id))
|
||
|
|
}
|
||
|
|
}
|