-
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 #20 from study-hub-inu/feat/SH-110-mypage
Feat/sh 110 mypage
- Loading branch information
Showing
14 changed files
with
127 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
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
19 changes: 19 additions & 0 deletions
19
.../java/kr/co/studyhubinu/studyhubserver/study/dto/response/GetBookmarkedPostsResponse.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,19 @@ | ||
package kr.co.studyhubinu.studyhubserver.study.dto.response; | ||
|
||
import kr.co.studyhubinu.studyhubserver.user.enums.MajorType; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Setter // QueryDsl 때문에 필요함 | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class GetBookmarkedPostsResponse { | ||
|
||
private Long postId; | ||
private MajorType major; | ||
private String title; | ||
private String content; | ||
private int remainingSeat; | ||
private boolean close; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/kr/co/studyhubinu/studyhubserver/study/dto/response/GetMyPostResponse.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,23 @@ | ||
package kr.co.studyhubinu.studyhubserver.study.dto.response; | ||
|
||
import kr.co.studyhubinu.studyhubserver.user.enums.MajorType; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class GetMyPostResponse { | ||
private Long postId; | ||
private MajorType major; | ||
private String title; | ||
private String content; | ||
private int remainingSeat; | ||
private boolean close; | ||
|
||
public GetMyPostResponse(Long postId, MajorType major, String title, String content, int remainingSeat, boolean close) { | ||
this.postId = postId; | ||
this.major = major; | ||
this.title = title; | ||
this.content = content; | ||
this.remainingSeat = remainingSeat; | ||
this.close = close; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/kr/co/studyhubinu/studyhubserver/study/repository/StudyPostRepository.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,16 @@ | ||
package kr.co.studyhubinu.studyhubserver.study.repository; | ||
|
||
import kr.co.studyhubinu.studyhubserver.study.domain.StudyPostEntity; | ||
import kr.co.studyhubinu.studyhubserver.study.dto.response.GetMyPostResponse; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.domain.Slice; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
public interface StudyPostRepository extends JpaRepository<StudyPostEntity, Long>, StudyPostRepositoryCustom { | ||
|
||
@Query("SELECT new kr.co.studyhubinu.studyhubserver.study.dto.response.GetMyPostResponse(sp.id, sp.major, sp.title, sp.content, sp.remainingSeat, sp.close) " + | ||
"FROM StudyPostEntity sp " + | ||
"WHERE sp.postedUserId = :userId") | ||
Slice<GetMyPostResponse> findByPostedUserId(Long userId, Pageable pageable); | ||
} |
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