-
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 #181 from THEGOODs-repo/feature/10
โจ ํผ๋, ๋๊ธ, ์ข์์ api ๊ตฌํ
- Loading branch information
Showing
17 changed files
with
432 additions
and
29 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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/umc/TheGoods/repository/post/CommentLikeRepository.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,12 @@ | ||
package com.umc.TheGoods.repository.post; | ||
|
||
|
||
import com.umc.TheGoods.domain.mapping.comment.CommentLike; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface CommentLikeRepository extends JpaRepository<CommentLike, Long> { | ||
|
||
Optional<CommentLike> findByMember_IdAndComment_Id(Long memberId, Long commentId); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/umc/TheGoods/repository/post/CommentRepository.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,20 @@ | ||
package com.umc.TheGoods.repository.post; | ||
|
||
import com.umc.TheGoods.domain.community.Comment; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
public interface CommentRepository extends JpaRepository<Comment, Long> { | ||
@Modifying(clearAutomatically = true) | ||
@Query("update Comment c SET c.content= :comment WHERE c.id= :commentId") | ||
void updateComment(Long commentId, String comment); | ||
|
||
@Modifying(clearAutomatically = true) | ||
@Query("UPDATE Comment c SET c.likesCount = c.likesCount +1 WHERE c.id= :commentId") | ||
void updateLikeCount(Long commentId); | ||
|
||
@Modifying(clearAutomatically = true) | ||
@Query("UPDATE Comment c SET c.likesCount = c.likesCount -1 WHERE c.id= :commentId") | ||
void updateUnlikeCount(Long commentId); | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/umc/TheGoods/repository/post/PostImgRepository.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,10 @@ | ||
package com.umc.TheGoods.repository.post; | ||
|
||
import com.umc.TheGoods.domain.images.PostImg; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface PostImgRepository extends JpaRepository<PostImg, Long> { | ||
List<PostImg> findByPostId(Long postId); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/umc/TheGoods/repository/post/PostLikeRepository.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,12 @@ | ||
package com.umc.TheGoods.repository.post; | ||
|
||
|
||
import com.umc.TheGoods.domain.mapping.post.PostLike; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface PostLikeRepository extends JpaRepository<PostLike, Long> { | ||
|
||
Optional<PostLike> findByMember_IdAndPost_Id(Long memberId, Long postId); | ||
} |
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
20 changes: 20 additions & 0 deletions
20
src/main/java/com/umc/TheGoods/service/PostService/PostCommandService.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,11 +1,31 @@ | ||
package com.umc.TheGoods.service.PostService; | ||
|
||
import com.umc.TheGoods.domain.member.Member; | ||
import com.umc.TheGoods.web.dto.post.PostRequestDto; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
import java.util.List; | ||
|
||
public interface PostCommandService { | ||
|
||
void follow(Long followingId, Member follower); | ||
|
||
void deleteFollow(Long followingId, Long followerId); | ||
|
||
void registerPost(Member member, String content, List<MultipartFile> multipartFileList); | ||
|
||
void updatePost(Member member, Long postId, String content, List<MultipartFile> multipartFileList); | ||
|
||
void deletePost(Member member, Long postId); | ||
|
||
void likePost(Member member, Long postId); | ||
|
||
|
||
void uploadComment(Member member, Long postId, PostRequestDto.CommentDTO request); | ||
|
||
void updateComment(Member member, Long postId, Long commentId, PostRequestDto.UpdateCommentDTO request); | ||
|
||
void likeComment(Member member, Long commentId); | ||
|
||
|
||
} |
Oops, something went wrong.