import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' import { CreateUserDto, UpdateUserDto } from './dto/user.dto' import { AdminUsersService } from './users.service' import type { AdminUsersServiceCreateResponseDto, AdminUsersServiceDeleteResponseDto, AdminUsersServiceFindAllResponseDto, AdminUsersServiceFindOneResponseDto, AdminUsersServiceUpdateResponseDto } from './dto/users-response.dto' @Controller('admin/users') export class AdminUsersController { constructor(private readonly usersService: AdminUsersService) {} @Get() async findAll(): Promise { return this.usersService.findAll() } @Get(':id') async findOne(@Param('id') id: string): Promise { return this.usersService.findOne(id) } @Post() async create(@Body() data: any): Promise { return this.usersService.create(data as CreateUserDto) } @Patch(':id') async update(@Param('id') id: string, @Body() data: any): Promise { return this.usersService.update(id, data as UpdateUserDto) } @Delete(':id') async delete(@Param('id') id: string): Promise { return this.usersService.delete(id) } }