Skip to content

Commit

Permalink
Revert "feat: 재고 검색 기능 구현 (#6)"
Browse files Browse the repository at this point in the history
This reverts commit 682d0a2.
  • Loading branch information
kimyongwook98 committed May 27, 2024
1 parent 09932da commit 7dd29f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Optional;

@Slf4j
@RequiredArgsConstructor
Expand Down Expand Up @@ -46,11 +45,4 @@ public BaseResponse<List<InventoryResponseDto>> findAllInventory() {
final List<InventoryResponseDto> data = inventoryService.findAllInventory();
return BaseResponse.success(SuccessCode.INVENTORY_GET_SUCCESS, data);
}

@GetMapping
@ResponseStatus(HttpStatus.OK)
public BaseResponse<List<InventoryResponseDto>> findAllBySrchText(@RequestParam("srchText") Optional<String> srchText) {
final List<InventoryResponseDto> data = inventoryService.findInventoryWithSrchText(srchText.orElse(""));
return BaseResponse.success(SuccessCode.INVENTORY_GET_SUCCESS, data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface InventoryRepository extends JpaRepository<Inventory, Long> {
List<Inventory> findAllByNameContaining(String srchText);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,4 @@ public List<InventoryResponseDto> findAllInventory() {
List<Inventory> inventoryList = inventoryRepository.findAll();
return inventoryList.stream().map(InventoryResponseDto::from).collect(Collectors.toList());
}

public List<InventoryResponseDto> findInventoryWithSrchText(String srchText){
List<Inventory> inventoryList = inventoryRepository.findAllByNameContaining(srchText);
return inventoryList.stream().map(InventoryResponseDto::from).collect(Collectors.toList());
}
}

0 comments on commit 7dd29f9

Please sign in to comment.