-
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.
- @transactional 어노테이션 적용 - 사용하지 않는 메서드 제거 - queryDsl 적용
- Loading branch information
Showing
34 changed files
with
388 additions
and
631 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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/seoultech/synergybe/domain/follow/repository/FollowRepositoryCustom.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,11 @@ | ||
package com.seoultech.synergybe.domain.follow.repository; | ||
|
||
import com.seoultech.synergybe.domain.follow.Follow; | ||
|
||
import java.util.List; | ||
|
||
public interface FollowRepositoryCustom { | ||
List<Long> findFollowingIdsByFollowerToken(String followerToken); | ||
List<Long> findFollowerIdsByFollowingToken(String followingToken); | ||
Follow findByFollowerTokenAndFollowingToken(String userToken, String followingToken); | ||
} |
45 changes: 45 additions & 0 deletions
45
...ain/java/com/seoultech/synergybe/domain/follow/repository/FollowRepositoryCustomImpl.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,45 @@ | ||
package com.seoultech.synergybe.domain.follow.repository; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import com.seoultech.synergybe.domain.follow.Follow; | ||
import com.seoultech.synergybe.domain.follow.FollowStatus; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
|
||
import static com.seoultech.synergybe.domain.follow.QFollow.follow; | ||
|
||
@RequiredArgsConstructor | ||
@Repository | ||
public class FollowRepositoryCustomImpl implements FollowRepositoryCustom { | ||
private final JPAQueryFactory queryFactory; | ||
|
||
@Override | ||
public List<Long> findFollowingIdsByFollowerToken(String followerToken) { | ||
return queryFactory | ||
.select(follow.follower.id) | ||
.where( | ||
follow.follower.userToken.eq(followerToken).and(follow.status.eq(FollowStatus.FOLLOW))) | ||
.fetch(); | ||
} | ||
|
||
@Override | ||
public List<Long> findFollowerIdsByFollowingToken(String followingToken) { | ||
return queryFactory | ||
.select(follow.follower.id) | ||
.where( | ||
follow.following.userToken.eq(followingToken).and(follow.status.eq(FollowStatus.FOLLOW))) | ||
.fetch(); | ||
} | ||
|
||
@Override | ||
public Follow findByFollowerTokenAndFollowingToken(String userToken, String followingToken) { | ||
return queryFactory | ||
.selectFrom(follow) | ||
.where( | ||
follow.follower.userToken.eq(userToken).and(follow.following.userToken.eq(followingToken)) | ||
) | ||
.fetchOne(); | ||
} | ||
} |
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
87 changes: 0 additions & 87 deletions
87
src/main/java/com/seoultech/synergybe/domain/post/business/PostService.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.