-
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.
Merge pull request #23 from Parkjyun/feat/21
[feat] 게시글과 댓글의 좋아요, 좋아요 취소 api 생성
- Loading branch information
Showing
18 changed files
with
206 additions
and
24 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
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
4 changes: 3 additions & 1 deletion
4
src/main/java/com/newsnack/www/newsnackserver/common/exception/ArticleException.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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/newsnack/www/newsnackserver/common/exception/CommentException.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,18 @@ | ||
package com.newsnack.www.newsnackserver.common.exception; | ||
|
||
import com.newsnack.www.newsnackserver.common.code.failure.FailureCode; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class CommentException extends RuntimeException { | ||
private final FailureCode failureCode; | ||
|
||
public CommentException(FailureCode failureCode) { | ||
super("[CommentException] : " + failureCode.getMessage()); | ||
this.failureCode = failureCode; | ||
} | ||
|
||
public int getHttpStatusCode() { | ||
return failureCode.getHttpStatus().value(); | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ver/domain/article/model/SearchOrder.java → ...ver/controller/parameter/SearchOrder.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
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
5 changes: 5 additions & 0 deletions
5
...newsnack/www/newsnackserver/domain/articleheart/repository/ArticleHeartJpaRepository.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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package com.newsnack.www.newsnackserver.domain.articleheart.repository; | ||
|
||
import com.newsnack.www.newsnackserver.domain.article.model.Article; | ||
import com.newsnack.www.newsnackserver.domain.articleheart.model.ArticleHeart; | ||
import com.newsnack.www.newsnackserver.domain.member.model.Member; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface ArticleHeartJpaRepository extends JpaRepository<ArticleHeart, Long> { | ||
boolean existsByArticleIdAndMemberId(Long articleId, Long memberId); | ||
Optional<ArticleHeart> findByArticleAndMember(Article article, Member member); | ||
} |
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
5 changes: 5 additions & 0 deletions
5
...newsnack/www/newsnackserver/domain/commentheart/repository/CommentHeartJpaRepository.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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package com.newsnack.www.newsnackserver.domain.commentheart.repository; | ||
|
||
import com.newsnack.www.newsnackserver.domain.comment.model.Comment; | ||
import com.newsnack.www.newsnackserver.domain.commentheart.model.CommentHeart; | ||
import com.newsnack.www.newsnackserver.domain.member.model.Member; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface CommentHeartJpaRepository extends JpaRepository<CommentHeart, Long> { | ||
Optional<CommentHeart> findByCommentAndMember(Comment comment, Member member); | ||
} |
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
Oops, something went wrong.