-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat-Post
- Loading branch information
Showing
23 changed files
with
166 additions
and
35 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
6 changes: 5 additions & 1 deletion
6
src/main/java/com/kimgreen/backend/domain/community/repository/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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
package com.kimgreen.backend.domain.community.repository; | ||
|
||
import com.kimgreen.backend.domain.community.entity.Comment; | ||
import com.kimgreen.backend.domain.member.entity.Member; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
|
||
@Repository | ||
public interface CommentRepository extends JpaRepository<Comment, Long> { | ||
@Query("select count(*) from Comment c join Post p on c.post.postId=p.postId where p.postId= :id") | ||
public Long countComment(@Param("id") Long postId); | ||
} | ||
List<Comment> findByMember(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
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 |
---|---|---|
|
@@ -40,4 +40,4 @@ public void postLike(Member member, Post post) { | |
.member(member) | ||
.build()); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
public class CalendarDetailRequestDto { | ||
private Long memberId; | ||
private String date; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
public class CalendarResponseDto { | ||
private String date; | ||
private int postCount; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/kimgreen/backend/domain/profile/dto/Profile/CommentResponseDto.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,29 @@ | ||
package com.kimgreen.backend.domain.profile.dto.Profile; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class CommentResponseDto { | ||
private Long commentId; | ||
private Long postId; | ||
private String writerBadge; | ||
private String writerNickname; | ||
private String comment; | ||
|
||
public static CommentResponseDto toDto(Long commentId, Long postId, String writerBadge, String writerNickname, String comment) { | ||
return CommentResponseDto.builder() | ||
.commentId(commentId) | ||
.postId(postId) | ||
.writerBadge(writerBadge) | ||
.writerNickname(writerNickname) | ||
.comment(comment) | ||
.build(); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -40,4 +40,4 @@ public GetProfileDto from(Member member, | |
.isMine(isMine) | ||
.build(); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/com/kimgreen/backend/domain/profile/dto/Profile/GetSettingPostDto.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,48 @@ | ||
package com.kimgreen.backend.domain.profile.dto.Profile; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class GetSettingPostDto { | ||
private Long postId; | ||
private String writerNickname; | ||
private String writerBadge; | ||
private String writerProfileImg; | ||
private String content; | ||
private Long likeCount; | ||
private Long commentCount; | ||
private String imgUrl; | ||
private boolean isLiked; | ||
|
||
public static GetSettingPostDto toDto(Long postId, String content, String writerBadge, String writerNickname, String writerProfileImg, Long likeCount, Long commentCount, String imgUrl, boolean isLiked) { | ||
return GetSettingPostDto.builder() | ||
.postId(postId) | ||
.content(content) | ||
.writerBadge(writerBadge) | ||
.writerNickname(writerNickname) | ||
.writerProfileImg(writerProfileImg) | ||
.likeCount(likeCount) | ||
.commentCount(commentCount) | ||
.imgUrl(imgUrl) | ||
.isLiked(isLiked) | ||
.build(); | ||
} | ||
public static GetSettingPostDto toDto(Long postId, String content, String writerBadge, String writerNickname, String writerProfileImg, Long likeCount, Long commentCount, boolean isLiked) { | ||
return GetSettingPostDto.builder() | ||
.postId(postId) | ||
.content(content) | ||
.writerBadge(writerBadge) | ||
.writerNickname(writerNickname) | ||
.writerProfileImg(writerProfileImg) | ||
.likeCount(likeCount) | ||
.commentCount(commentCount) | ||
.isLiked(isLiked) | ||
.build(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.kimgreen.backend.exception; | ||
|
||
public class BlankToken extends RuntimeException{ | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/kimgreen/backend/exception/MalformedToken.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,4 @@ | ||
package com.kimgreen.backend.exception; | ||
|
||
public class MalformedToken extends RuntimeException{ | ||
} |
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 |
---|---|---|
|
@@ -38,4 +38,6 @@ public Response RefreshTokenExpiredResponse() { | |
|
||
|
||
|
||
|
||
|
||
} |
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