diff --git a/src/main/java/org/hankki/hankkiserver/api/favorite/controller/FavoriteController.java b/src/main/java/org/hankki/hankkiserver/api/favorite/controller/FavoriteController.java index c6a0d3a4..5525c84a 100644 --- a/src/main/java/org/hankki/hankkiserver/api/favorite/controller/FavoriteController.java +++ b/src/main/java/org/hankki/hankkiserver/api/favorite/controller/FavoriteController.java @@ -10,7 +10,7 @@ import org.hankki.hankkiserver.api.favorite.service.FavoriteQueryService; import org.hankki.hankkiserver.api.favorite.service.command.*; import org.hankki.hankkiserver.api.favorite.service.response.FavoriteGetResponse; -import org.hankki.hankkiserver.api.favorite.service.response.FavoriteNicknameGetResponse; +import org.hankki.hankkiserver.api.favorite.service.response.FavoriteUserNicknameGetResponse; import org.hankki.hankkiserver.api.favorite.service.response.FavoriteOwnershipGetResponse; import org.hankki.hankkiserver.api.favorite.service.response.FavoritesWithStatusGetResponse; import org.hankki.hankkiserver.auth.UserId; @@ -81,7 +81,7 @@ public HankkiResponse checkFavoriteOwnership(@User } @GetMapping("/favorites/{favoriteId}/users/me") - public HankkiResponse getFavoriteUserNickname(@PathVariable("favoriteId") final long id) { + public HankkiResponse getFavoriteUserNickname(@PathVariable("favoriteId") final long id) { return HankkiResponse.success(CommonSuccessCode.OK, favoriteQueryService.getFavoriteUserNickname(id)); } } diff --git a/src/main/java/org/hankki/hankkiserver/api/favorite/service/FavoriteQueryService.java b/src/main/java/org/hankki/hankkiserver/api/favorite/service/FavoriteQueryService.java index d211c263..75410d68 100644 --- a/src/main/java/org/hankki/hankkiserver/api/favorite/service/FavoriteQueryService.java +++ b/src/main/java/org/hankki/hankkiserver/api/favorite/service/FavoriteQueryService.java @@ -7,7 +7,7 @@ import org.hankki.hankkiserver.api.favorite.service.command.FavoritesGetCommand; import org.hankki.hankkiserver.api.favorite.service.command.FavoritesWithStatusGetCommand; import org.hankki.hankkiserver.api.favorite.service.response.FavoriteGetResponse; -import org.hankki.hankkiserver.api.favorite.service.response.FavoriteNicknameGetResponse; +import org.hankki.hankkiserver.api.favorite.service.response.FavoriteUserNicknameGetResponse; import org.hankki.hankkiserver.api.favorite.service.response.FavoriteOwnershipGetResponse; import org.hankki.hankkiserver.api.favorite.service.response.FavoritesWithStatusGetResponse; import org.hankki.hankkiserver.api.store.service.StoreFinder; @@ -76,8 +76,8 @@ private boolean isOwner(final long ownerId, final long userId) { } @Transactional(readOnly = true) - public FavoriteNicknameGetResponse getFavoriteUserNickname(final long id) { - return FavoriteNicknameGetResponse.of(getNicknameByOwnerId(getOwnerIdById(id))); + public FavoriteUserNicknameGetResponse getFavoriteUserNickname(final long id) { + return FavoriteUserNicknameGetResponse.of(getNicknameByOwnerId(getOwnerIdById(id))); } private String getNicknameByOwnerId(final long userId) { diff --git a/src/main/java/org/hankki/hankkiserver/api/favorite/service/response/FavoriteNicknameGetResponse.java b/src/main/java/org/hankki/hankkiserver/api/favorite/service/response/FavoriteNicknameGetResponse.java deleted file mode 100644 index 3189f2ec..00000000 --- a/src/main/java/org/hankki/hankkiserver/api/favorite/service/response/FavoriteNicknameGetResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.hankki.hankkiserver.api.favorite.service.response; - -public record FavoriteNicknameGetResponse( - String nickname -) { - public static FavoriteNicknameGetResponse of(final String nickname) { - return new FavoriteNicknameGetResponse(nickname); - } -} diff --git a/src/main/java/org/hankki/hankkiserver/api/favorite/service/response/FavoriteUserNicknameGetResponse.java b/src/main/java/org/hankki/hankkiserver/api/favorite/service/response/FavoriteUserNicknameGetResponse.java new file mode 100644 index 00000000..7c611a9a --- /dev/null +++ b/src/main/java/org/hankki/hankkiserver/api/favorite/service/response/FavoriteUserNicknameGetResponse.java @@ -0,0 +1,9 @@ +package org.hankki.hankkiserver.api.favorite.service.response; + +public record FavoriteUserNicknameGetResponse( + String nickname +) { + public static FavoriteUserNicknameGetResponse of(final String nickname) { + return new FavoriteUserNicknameGetResponse(nickname); + } +}