broker direcrtory renewed, imageservice updated, demo data

This commit is contained in:
2024-03-25 20:17:49 +01:00
parent 73ab12a694
commit 840d7a63b1
30 changed files with 616 additions and 212 deletions

View File

@@ -7,22 +7,30 @@ import { UserEntity } from 'src/models/server.model.js';
@Controller('user')
export class UserController {
constructor(private userService:UserService,@Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger){}
@Get(':id')
findById(@Param('id') id:string): any {
return this.userService.getUserById(id);
}
constructor(private userService: UserService, @Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger) {}
@Post()
save(@Body() user: any):Promise<UserEntity>{
this.logger.info(`User persisted: `);
return this.userService.saveUser(user);
}
@Post('search')
find(@Body() criteria: any): any {
return this.userService.findUser(criteria);
}
@Get(':id')
findById(@Param('id') id: string): any {
this.logger.info(`Searching for user with ID: ${id}`);
const user = this.userService.getUserById(id);
this.logger.info(`Found user: ${JSON.stringify(user)}`);
return user;
}
@Post()
save(@Body() user: any): Promise<UserEntity> {
this.logger.info(`Saving user: ${JSON.stringify(user)}`);
const savedUser = this.userService.saveUser(user);
this.logger.info(`User persisted: ${JSON.stringify(savedUser)}`);
return savedUser;
}
@Post('search')
find(@Body() criteria: any): any {
this.logger.info(`Searching for users with criteria: ${JSON.stringify(criteria)}`);
const foundUsers = this.userService.findUser(criteria);
this.logger.info(`Found users: ${JSON.stringify(foundUsers)}`);
return foundUsers;
}
}