Skip to content

Commit

Permalink
#128 feat: 상품 목록 조회 응답에 판매자의 로그인 아이디 sellerId 추가 (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
yonghwankim-dev authored Oct 2, 2023
1 parent 9ab4404 commit 71bf293
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ private Item findItemByItemIdAndMemberId(Long itemId, Long memberId) {

@Transactional
public void deleteItem(Long itemId, Principal writer) {
log.info("상품 게시글 삭제 서비스 요청 : itemId={}, writer={}", itemId, writer);
Item item = findItemByItemIdAndMemberId(itemId, writer.getMemberId());
List<Image> images = imageRepository.findAllByItemId(item.getId());
images.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public class ItemResponse {
private ItemStatus status;
private Long chatCount;
private Long wishCount;
private String sellerId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public Slice<ItemResponse> findByIdAndRegion(Long itemId, String region, int siz
item.price,
item.status,
item.wishCount,
item.chatCount))
item.chatCount,
item.member.loginId.as("sellerId")))
.from(item)
.where(itemRepository.lessThanItemId(itemId),
itemRepository.equalCategoryId(categoryId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ void findAll() {
assertAll(
() -> assertThat(contents.size()).isEqualTo(2),
() -> assertThat(contents.get(0).getTitle()).isEqualTo("노트북"),
() -> assertThat(contents.get(0).getSellerId()).isEqualTo("pieeeeeee"),
() -> assertThat(all.getPaging().isHasNext()).isTrue(),
() -> assertThat(all.getPaging().getNextCursor()).isEqualTo(item.getId()));
}
Expand Down

0 comments on commit 71bf293

Please sign in to comment.