-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [refac] change variable name * [feat] set repository * [feat] add service logic * [feat] add controller logic * [refac] refactor entitiy code * [refac] change JPQL to Query Method
- Loading branch information
1 parent
053ed20
commit e397810
Showing
8 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/org/hankki/hankkiserver/api/user/service/response/UserFavoriteResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.hankki.hankkiserver.api.user.service.response; | ||
|
||
import org.hankki.hankkiserver.domain.favorite.model.Favorite; | ||
|
||
public record UserFavoriteResponse( | ||
Long id, | ||
String title, | ||
String imageUrl | ||
) { | ||
|
||
public static UserFavoriteResponse of(Favorite favorite) { | ||
return new UserFavoriteResponse(favorite.getId(), favorite.getName(), favorite.getImageUrl()); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...main/java/org/hankki/hankkiserver/api/user/service/response/UserFavoritesGetResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.hankki.hankkiserver.api.user.service.response; | ||
|
||
import java.util.List; | ||
import org.hankki.hankkiserver.domain.favorite.model.Favorite; | ||
|
||
public record UserFavoritesGetResponse( | ||
List<UserFavoriteResponse> favorites | ||
) { | ||
|
||
public static UserFavoritesGetResponse of(List<Favorite> favorites) { | ||
return new UserFavoritesGetResponse(favorites.stream().map(UserFavoriteResponse::of).toList()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,4 +65,5 @@ public void decreaseHeartCount() { | |
public void increaseHeartCount() { | ||
this.heartCount++; | ||
} | ||
|
||
} |