24 lines
705 B
TypeScript
24 lines
705 B
TypeScript
|
|
import { Body, Controller, Get, Param, Post } from '@nestjs/common'
|
||
|
|
import { CreateGoodDto } from './dto/create-good.dto'
|
||
|
|
import { GoodsService } from './goods.service'
|
||
|
|
|
||
|
|
@Controller('admin/guilds/:guildId/goods')
|
||
|
|
export class GoodsController {
|
||
|
|
constructor(private readonly goodsService: GoodsService) {}
|
||
|
|
|
||
|
|
@Get()
|
||
|
|
findAll(@Param('guildId') guildId: string) {
|
||
|
|
return this.goodsService.findAll(guildId)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get(':id')
|
||
|
|
findOne(@Param('guildId') guildId: string, @Param('id') goodId: string) {
|
||
|
|
return this.goodsService.findOne(guildId, goodId)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Post()
|
||
|
|
create(@Param('guildId') guildId: string, @Body() data: CreateGoodDto) {
|
||
|
|
return this.goodsService.create(guildId, data)
|
||
|
|
}
|
||
|
|
}
|