Skip to content

Commit

Permalink
spotless Apply #128
Browse files Browse the repository at this point in the history
  • Loading branch information
bongsh0112 committed Dec 13, 2023
1 parent cfbf38e commit cabfdbd
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import tify.server.domain.domains.user.adaptor.UserAdaptor;
import tify.server.domain.domains.user.adaptor.UserBlockAdaptor;
import tify.server.domain.domains.user.domain.Neighbor;
import tify.server.domain.domains.user.domain.UserBlock;
import tify.server.domain.domains.user.dto.condition.NeighborCondition;
import tify.server.domain.domains.user.dto.model.RetrieveNeighborDTO;

@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import tify.server.core.annotation.UseCase;
import tify.server.domain.domains.user.adaptor.NeighborAdaptor;
import tify.server.domain.domains.user.adaptor.UserBlockAdaptor;
import tify.server.domain.domains.user.domain.Neighbor;
import tify.server.domain.domains.user.domain.UserBlock;
import tify.server.domain.domains.user.dto.condition.NeighborCondition;
import tify.server.domain.domains.user.dto.model.RetrieveNeighborDTO;

@UseCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import tify.server.domain.domains.user.adaptor.NeighborAdaptor;
import tify.server.domain.domains.user.adaptor.UserAdaptor;
import tify.server.domain.domains.user.adaptor.UserBlockAdaptor;
import tify.server.domain.domains.user.domain.Neighbor;
import tify.server.domain.domains.user.domain.UserBlock;
import tify.server.domain.domains.user.dto.condition.NeighborCondition;
import tify.server.domain.domains.user.dto.model.RetrieveNeighborDTO;

@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import tify.server.domain.domains.user.domain.Neighbor;
import tify.server.domain.domains.user.domain.NeighborApplication;
import tify.server.domain.domains.user.domain.User;
import tify.server.domain.domains.user.dto.condition.NeighborCondition;
import tify.server.domain.domains.user.dto.model.GetNeighborApplicationDTO;
import tify.server.domain.domains.user.dto.model.RetrieveNeighborDTO;
import tify.server.domain.domains.user.exception.NeighborApplicationNotFoundException;
Expand Down Expand Up @@ -57,8 +56,7 @@ public List<RetrieveNeighborDTO> searchNeighbors(Long userId) {
return neighborRepository.searchNeighbors(userId);
}

public Slice<RetrieveNeighborDTO> searchNeighbors(
Long userId, Pageable pageable) {
public Slice<RetrieveNeighborDTO> searchNeighbors(Long userId, Pageable pageable) {
return neighborRepository.searchNeighborsToPage(userId, pageable);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.List;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import tify.server.domain.domains.user.dto.condition.NeighborCondition;
import tify.server.domain.domains.user.dto.model.RetrieveNeighborDTO;

public interface NeighborCustomRepository {
Expand All @@ -13,6 +12,5 @@ public interface NeighborCustomRepository {

List<RetrieveNeighborDTO> searchBirthdayNeighbors(Long userId);

Slice<RetrieveNeighborDTO> searchNeighborsToPage(
Long userId, Pageable pageable);
Slice<RetrieveNeighborDTO> searchNeighborsToPage(Long userId, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import tify.server.domain.common.util.SliceUtil;
import tify.server.domain.domains.user.dto.condition.NeighborCondition;
import tify.server.domain.domains.user.dto.model.RetrieveNeighborDTO;

@RequiredArgsConstructor
Expand Down Expand Up @@ -71,16 +70,13 @@ public List<RetrieveNeighborDTO> searchBirthdayNeighbors(Long userId) {
.from(neighbor)
.join(user)
.on(user.id.eq(neighbor.toUserId))
.where(
neighbor.fromUserId.eq(userId),
user.profile.birth.contains(monthAndYear))
.where(neighbor.fromUserId.eq(userId), user.profile.birth.contains(monthAndYear))
.orderBy(neighbor.order.asc())
.fetch();
}

@Override
public Slice<RetrieveNeighborDTO> searchNeighborsToPage(
Long userId, Pageable pageable) {
public Slice<RetrieveNeighborDTO> searchNeighborsToPage(Long userId, Pageable pageable) {
List<RetrieveNeighborDTO> retrieveNeighborDTOS =
queryFactory
.select(
Expand All @@ -101,8 +97,7 @@ public Slice<RetrieveNeighborDTO> searchNeighborsToPage(
.from(neighbor)
.join(user)
.on(user.id.eq(neighbor.toUserId))
.where(
neighbor.fromUserId.eq(userId))
.where(neighbor.fromUserId.eq(userId))
.orderBy(neighbor.order.asc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
Expand Down

0 comments on commit cabfdbd

Please sign in to comment.