Skip to content

Commit

Permalink
[refactor] 메서드명 변경, 빌더 사용하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
syyling committed May 20, 2024
1 parent 2989e77 commit c353729
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mookive.mookive_backend.watched.application.dto.response;

import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

Expand All @@ -10,6 +11,7 @@ public class WatchedResponse {
public static class WatchedCheckResponse {
private boolean isWatched;

@Builder
public WatchedCheckResponse(boolean isWatched) {
this.isWatched = isWatched;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.mookive.mookive_backend.watched.application.mapper;


import com.mookive.mookive_backend.movie.domain.entity.Movie;
import com.mookive.mookive_backend.user.domain.entity.User;
import com.mookive.mookive_backend.watched.domain.entity.Watched;
import com.mookive.mookive_backend.watched.application.dto.response.WatchedResponse;
import com.mookive.mookive_backend.watched.domain.entity.Watched;

public class WatchedMapper {

Expand All @@ -13,8 +12,11 @@ public static Watched mapToWatched(User user, Movie movie) {
.user(user)
.movie(movie)
.build();

public static WatchedResponse.WatchedCheckResponse toWatchedCheckResponse(boolean isWatched) {
return new WatchedResponse.WatchedCheckResponse(isWatched);
}

public static WatchedResponse.WatchedCheckResponse mapToWatchedCheckResponse(boolean isWatched) {
return WatchedResponse.WatchedCheckResponse.builder()
.isWatched(isWatched)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public class WatchedGetService {

public WatchedResponse.WatchedCheckResponse checkWatched(Long userId, Long movieId) {
boolean isWatched = watchedQueryService.existsByUserIdAndMovieId(userId, movieId);
return WatchedMapper.toWatchedCheckResponse(isWatched);
return WatchedMapper.mapToWatchedCheckResponse(isWatched);
}
}

0 comments on commit c353729

Please sign in to comment.