Skip to content

Commit

Permalink
[refac] Refacotr dto naming
Browse files Browse the repository at this point in the history
  • Loading branch information
PicturePark1101 committed Dec 21, 2024
1 parent 2be3070 commit b07c438
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -81,7 +81,7 @@ public HankkiResponse<FavoriteOwnershipGetResponse> checkFavoriteOwnership(@User
}

@GetMapping("/favorites/{favoriteId}/users/me")
public HankkiResponse<FavoriteNicknameGetResponse> getFavoriteUserNickname(@PathVariable("favoriteId") final long id) {
public HankkiResponse<FavoriteUserNicknameGetResponse> getFavoriteUserNickname(@PathVariable("favoriteId") final long id) {
return HankkiResponse.success(CommonSuccessCode.OK, favoriteQueryService.getFavoriteUserNickname(id));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit b07c438

Please sign in to comment.