transform core api codes into this project, update modules as admin/pos context modules
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { Body, Controller, Get, Param, Post, Put } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CreateGuildDto } from './dto/create-guild.dto'
|
||||
import { UpdateGuildDto } from './dto/update-guild.dto'
|
||||
import { GuildsService } from './guilds.service'
|
||||
|
||||
@ApiTags('guilds')
|
||||
@Controller('admin/guilds')
|
||||
export class GuildsController {
|
||||
constructor(private readonly guildsService: GuildsService) {}
|
||||
|
||||
@Get()
|
||||
async findAll() {
|
||||
return this.guildsService.findAll()
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@Param('id') id: string) {
|
||||
return this.guildsService.findOne(id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Body() data: CreateGuildDto) {
|
||||
return await this.guildsService.create(data)
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdateGuildDto) {
|
||||
return await this.guildsService.update(id, data)
|
||||
}
|
||||
|
||||
// @Delete(':id')
|
||||
// async delete(@Param('id') id: string) {
|
||||
// await this.guildsService.delete(id)
|
||||
// return ResponseMapper.delete()
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user