mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-07 08:59:09 +00:00
FIX: better code organization
This commit is contained in:
@@ -36,24 +36,6 @@ export class UsersController {
|
||||
this.logger = dadosferaLogger.logger;
|
||||
}
|
||||
|
||||
@Post()
|
||||
@ApiOkResponse({ type: CreateUserRes })
|
||||
async createUser(@User() user, @Body() body: CreateUserReq) {
|
||||
this.logger.info('createUser', { user });
|
||||
}
|
||||
|
||||
@Post('batch')
|
||||
@ApiOkResponse({ type: CreateUserRes })
|
||||
async batchCreateUser(@User() user, @Body() body: CreateUserReq) {
|
||||
this.logger.info('batchCreateUser', { user });
|
||||
}
|
||||
@Delete(':id')
|
||||
@ApiOkResponse({ type: DeleteUserRes })
|
||||
async deleteUser(@User() user, @Param('id') id: string) {
|
||||
this.logger.info('deleteUser', { user });
|
||||
return await this.userService.deleteUser({ id });
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOkResponse({
|
||||
type: GetAllUsersByCustomerIdRes,
|
||||
@@ -70,6 +52,25 @@ export class UsersController {
|
||||
);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@ApiOkResponse({ type: CreateUserRes })
|
||||
async createUser(@User() user, @Body() body: CreateUserReq) {
|
||||
this.logger.info('createUser', { user });
|
||||
}
|
||||
|
||||
@Post('batch')
|
||||
@ApiOkResponse({ type: CreateUserRes })
|
||||
async batchCreateUser(@User() user, @Body() body: CreateUserReq) {
|
||||
this.logger.info('batchCreateUser', { user });
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@ApiOkResponse({ type: DeleteUserRes })
|
||||
async deleteUser(@User() user, @Param('id') id: string) {
|
||||
this.logger.info('deleteUser', { user });
|
||||
return await this.userService.deleteUser({ id });
|
||||
}
|
||||
|
||||
@Put('role')
|
||||
async assignRoleToUser(@User() user, @Body() body: AssignRoleToUserReq) {
|
||||
this.logger.info('assignRoleToUser', { user });
|
||||
|
||||
Reference in New Issue
Block a user