import { Body , Controller , Get , Param , Post } from '@nestjs/common' ; import { RolesService } from "./roles.service" ; import { CreateRoleDto } from "./dto/create-role.dto" ; @ Controller ( 'roles' ) export class RolesController { constructor ( private roleService ) { } @ Post ( ) create ( @ Body ( ) dto ) { return this . roleService . createRole ( dto ) ; } @ Get ( '/:value' ) getByValue ( @ Param ( 'value' ) value ) { return this . roleService . getRoleByValue ( value ) ; } }