Skip to content

Commit

Permalink
Merge pull request #243 from OutDecision/issue/168
Browse files Browse the repository at this point in the history
🎨 [UPDATE]: 좋아요 response 수정
  • Loading branch information
sye1101 authored May 28, 2024
2 parents 9f9688b + e73965c commit 91938b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class LikesController {
@PostMapping("/{postId}/like")
@Operation(summary = "좋아요 API", description = "게시글에 좋아요를 누릅니다.")
public ApiResponse<?> addLike(@PathVariable Long postId) {
Long likesId = likesService.addLikes(postId);
return ApiResponse.onSuccess(likesId);
int likesCnt = likesService.addLikes(postId);
return ApiResponse.onSuccess(likesCnt);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package KGUcapstone.OutDecision.domain.likes.service;

public interface LikesService {
Long addLikes(Long postId);
int addLikes(Long postId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class LikesServiceImpl implements LikesService{
private final TitleService titleService;
private final PostService postService;

public Long addLikes(Long postId) {
public int addLikes(Long postId) {
Optional<Member> memberOptional = findMemberService.findLoginMember();

if (memberOptional.isPresent()) {
Expand All @@ -45,7 +45,7 @@ public Long addLikes(Long postId) {

// 칭호 획득 가능 여부 확인
titleService.memberGetTitle(post, member);
return likes.getId();
return post.getLikes();
} else {
throw new RuntimeException("User Not Found");
}
Expand Down

0 comments on commit 91938b1

Please sign in to comment.