refactor: Fix yellow code smells #27

Merged
jank merged 11 commits from refactor/fix-yellow-code-smells into main 2024-10-02 08:43:02 +00:00
Showing only changes of commit 981f63b247 - Show all commits

@ -45,22 +45,6 @@ public class HelloController {
return this.helloMapper.mapToGetDto(helloEntity); return this.helloMapper.mapToGetDto(helloEntity);
} }
@Operation(summary = "delivers a list of hellos")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "list of hellos",
content = {@Content(mediaType = "application/json",
schema = @Schema(implementation = HelloGetDto.class))}),
@ApiResponse(responseCode = "401", description = "not authorized",
content = @Content)})
@GetMapping
public List<HelloGetDto> findAll() {
return this.service
.readAll()
.stream()
.map(e -> this.helloMapper.mapToGetDto(e))
.toList();
}
@Operation(summary = "deletes a Hello by id") @Operation(summary = "deletes a Hello by id")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(responseCode = "204", description = "delete successful"), @ApiResponse(responseCode = "204", description = "delete successful"),
@ -78,22 +62,4 @@ public class HelloController {
this.service.delete(entity); this.service.delete(entity);
} }
} }
@Operation(summary = "find hellos by message")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "List of hellos who have the given message",
content = {@Content(mediaType = "application/json",
schema = @Schema(implementation = HelloGetDto.class))}),
@ApiResponse(responseCode = "404", description = "qualification description does not exist",
content = @Content),
@ApiResponse(responseCode = "401", description = "not authorized",
content = @Content)})
@GetMapping("/findByMessage")
public List<HelloGetDto> findAllEmployeesByQualification(@RequestParam String message) {
return this.service
.findByMessage(message)
.stream()
.map(e -> this.helloMapper.mapToGetDto(e))
.toList();
}
} }