Skip to content

Commit

Permalink
[#4] 경매품 검색 DTO 수정
Browse files Browse the repository at this point in the history
[#4] 경매품 검색 DTO 수정
  • Loading branch information
haroya01 authored Sep 24, 2023
2 parents e92c7d6 + b8d4f55 commit 2575e70
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
@RequiredArgsConstructor
public class AuctionItemSearchController {

private final AuctionItemService auctionItemService;
private final AuctionItemRepository AuctionItemRepository;
private final AuctionItemSearchService auctionItemSearchService;
private final AuctionItemService auctionItemService;
private final AuctionItemRepository AuctionItemRepository;
private final AuctionItemSearchService auctionItemSearchService;

@Operation(summary = "Search AuctionItem", description = "경매품 검색하기")
@GetMapping("")
public ResponseEntity<AuctionItemSearchResponse> findItemCategory(
@ModelAttribute SearchAuctionItemSortedRequest searchAuctionItemSortedRequest) {
AuctionItemSearchResponse result =
this.auctionItemSearchService.findAuctionItemByRequest(searchAuctionItemSortedRequest);
return ResponseEntity.ok(result);
}
@Operation(summary = "Search AuctionItem", description = "경매품 검색하기")
@GetMapping("")
public ResponseEntity<AuctionItemSearchResponse> findItemCategory(
@ModelAttribute SearchAuctionItemSortedRequest searchAuctionItemSortedRequest) {
AuctionItemSearchResponse result =
this.auctionItemSearchService.findAuctionItemByRequest(searchAuctionItemSortedRequest);
return ResponseEntity.ok(result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public AuctionItemSearchResponse searchAuctionItemPage(SearchAuctionItemSortedRe
keywordStatus,
sellBuilder);

if (searchAuctionItemSortedRequest.getNick_name() != null) {
query.where(auctionItem.user.nickname.in(searchAuctionItemSortedRequest.getNick_name()));
}
// if (searchAuctionItemSortedRequest.getNick_name() != null) {
// query.where(auctionItem.user.nickname.in(searchAuctionItemSortedRequest.getNick_name()));
// }

Long page = searchAuctionItemSortedRequest.getPage();
int itemsPerPage = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class AuctionItemFirstView {

private Long id;
private String nickname;
// private String nickname;

private String name;

Expand All @@ -42,17 +42,20 @@ public class AuctionItemFirstView {

private String image_url;

private Long comment_count;

@Builder
public static AuctionItemFirstView of(AuctionItem auctionItem, Image image) {
return AuctionItemFirstView.builder()
.id(auctionItem.getId())
.nickname(auctionItem.getUser().getNickname())
// .nickname(auctionItem.getUser().getNickname())
.name(auctionItem.getName())
.address(auctionItem.getUser().getAddress())
.like_count(auctionItem.getLike_count())
.view_count(auctionItem.getView_count())
.price(auctionItem.getPrice())
.closedTime(auctionItem.getClosedTime())
.comment_count(auctionItem.getComment_count())
// .auctionItemStatus(auctionItem.getItemStatus())
.status(auctionItem.getStatus())
.now_price(20000L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public void applySearchCategory(BooleanBuilder status, QAuctionItem item) {

public void applySearchPrice(List<OrderSpecifier<?>> order, QAuctionItem item) {
if (this.search_price) {
order.add(item.price.desc());
} else {
order.add(item.price.asc());
} else {
order.add(item.price.desc());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spring:
database: postgresql
generate-ddl: true
hibernate:
ddlAuto: create
ddlAuto: update
properties:
hibernate.jdbc.batch_size: 20
hibernate.cache.use_query_cache: false
Expand Down

0 comments on commit 2575e70

Please sign in to comment.