import { BadRequestException , Controller , Get , InternalServerErrorException , Post , Body } from '@nestjs/common' ; import { CreateCatDto } from './create-cat.dto' ; /**
 * Controller: /cats
 */ @ Controller ( 'cats' ) export class CatsController { /**
     * Fetching cats ok
     */ @ Get ( 'ok' ) public ok ( ) { return 'This action returns all cats' ; } /**
     * Fetching bad request
     */ @ Get ( 'badrequest' ) public badRequest ( ) { throw new BadRequestException ( `The request is malformed.` ) ; } /**
     * Fetching internalerror
     */ @ Get ( 'internalerror' ) public internalerror ( ) { throw new InternalServerErrorException ( `A critical error happened.` ) ; } /**
     * Create a cat
     */ @ Post ( 'create' ) public create ( @ Body ( ) _createCatDto ) { return 'This action adds a new cat' ; } }