Skip to content

Commit

Permalink
refactor: 람다식 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee committed Jul 19, 2024
1 parent a1a139e commit 32d2a44
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ public void update(ActivityGroupBoardUpdateRequestDto requestDto, UploadedFileSe
Optional.ofNullable(requestDto.getTitle()).ifPresent(this::setTitle);
Optional.ofNullable(requestDto.getContent()).ifPresent(this::setContent);
Optional.ofNullable(requestDto.getDueDateTime()).ifPresent(this::setDueDateTime);
Optional.ofNullable(requestDto.getFileUrls()).ifPresent(urls -> {
this.setUploadedFiles(uploadedFileService.getUploadedFilesByUrls(urls));
});
Optional.ofNullable(requestDto.getFileUrls()).ifPresent(urls -> this.setUploadedFiles(uploadedFileService.getUploadedFilesByUrls(urls)));
}

public void addChild(ActivityGroupBoard child) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ public ApiResponse<List<String>> broadcastEmail(
EmailDto emailDto,
@RequestParam(name = "multipartFile", required = false) List<MultipartFile> files
) {
CompletableFuture<List<String>> emailTask = CompletableFuture.supplyAsync(() -> {
return emailService.broadcastEmail(emailDto, files);
});

CompletableFuture<List<String>> emailTask = CompletableFuture.supplyAsync(() -> emailService.broadcastEmail(emailDto, files));
List<String> successfulAddresses = emailTask.join();
return ApiResponse.success(successfulAddresses);
}
Expand All @@ -49,10 +46,7 @@ public ApiResponse<List<String>> broadcastEmailToAllMember(
EmailDto emailDto,
@RequestParam(name = "multipartFile", required = false) List<MultipartFile> files
) {
CompletableFuture<List<String>> emailTask = CompletableFuture.supplyAsync(() -> {
return emailService.broadcastEmailToAllMember(emailDto, files);
});

CompletableFuture<List<String>> emailTask = CompletableFuture.supplyAsync(() -> emailService.broadcastEmailToAllMember(emailDto, files));
List<String> successfulEmails = emailTask.join();
return ApiResponse.success(successfulEmails);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/page/clab/api/global/util/IPInfoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public static IPInfoResponse getIpInfo(String ipAddress) {
.header("Authorization", "Bearer " + accessToken)
.accept(MediaType.APPLICATION_JSON)
.retrieve()
.onStatus(HttpStatusCode::is4xxClientError, ((request, response) -> {
log.warn("4xx error occurred while getting ip info. Status code: {}", response.getStatusCode());
}))
.onStatus(HttpStatusCode::is4xxClientError, ((request, response) ->
log.warn("4xx error occurred while getting ip info. Status code: {}", response.getStatusCode())))
.body(IPInfoResponse.class);
}

Expand Down

0 comments on commit 32d2a44

Please sign in to comment.