import { Controller, Get, Post, Patch, Delete, Body, Param } from '@nestjs/common';
import { UsersService } from './users.service';

@Controller()
export class UsersController {
  constructor(private svc: UsersService) {}

  @Get('users')
  findAll() { return this.svc.findAll(); }

  @Get('users/:id')
  findOne(@Param('id') id: string) { return this.svc.findOne(id); }

  @Post('users')
  create(@Body() body: any) { return this.svc.create(body); }

  @Patch('users/:id')
  update(@Param('id') id: string, @Body() body: any) { return this.svc.update(id, body); }

  @Delete('users/:id')
  remove(@Param('id') id: string) { return this.svc.remove(id); }

  @Get('perfis')
  perfis() { return this.svc.findAllPerfis(); }
}
