Skip to content

Commit

Permalink
fix: service transactional 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
dongchandev committed Jun 12, 2024
1 parent 54a12d4 commit a8573b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ private ExceptionCode mapExceptionToCodeOnCreateWakeupSong(Throwable cause) {
return WakeupSongExceptionCode.URL_MALFORMED;
} else if (cause instanceof UnsupportedVideoTypeException) {
return WakeupSongExceptionCode.UNSUPPORTED_TYPE;
} else {
} else if(cause instanceof WakeupSongAlreadyCreatedException){
return WakeupSongExceptionCode.ALREADY_APPLIED;
}else {
return GlobalExceptionCode.INTERNAL_SERVER;
}
}
Expand Down Expand Up @@ -155,10 +157,12 @@ public Response deleteMyWakeupSong(int id) {
return Response.ok("기상송 신청 취소 성공");
}

@Transactional(readOnly = true)
public CompletableFuture<ResponseData<List<ChartRes>>> getChartList() {
return chartClient.getList().thenApply(res -> ResponseData.ok("차트 조회 성공", res));
}

@Transactional(readOnly = true)
public ResponseData<List<YoutubeRes>> getYoutubeList(String keyword) {
List<YoutubeRes> videoList = videoClient.searchVideoByKeyword(keyword, 5).getItems().stream()
.map(YoutubeApiUtil::getYoutubeRes).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class WakeupSongService {
private final WakeupSongRepository wakeupSongRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public <T, V> Mono<T> post(String url, V body, Class<T> responseClass, String...

private Function<ClientResponse, Mono<? extends Throwable>> onError() {
return response -> {
log.info("{}",response.statusCode());
throw new WebClientException(response.statusCode().value());
};
}
Expand Down

0 comments on commit a8573b6

Please sign in to comment.