Collector
This commit is contained in:
parent
6c8ea6bcdf
commit
70abe8569c
|
@ -14,7 +14,7 @@ public class CollectorController {
|
||||||
private CollectorRepository repository;
|
private CollectorRepository repository;
|
||||||
|
|
||||||
@RequestMapping(value = "/collector/{productId}", method = RequestMethod.GET)
|
@RequestMapping(value = "/collector/{productId}", method = RequestMethod.GET)
|
||||||
public Collector get(@PathVariable(value = "productId") long productId) {
|
public Collector get(@PathVariable(value = "productId") String productId) {
|
||||||
return repository.findByPID(productId);
|
return repository.findByPID(productId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||||
public interface CollectorRepository extends JpaRepository<Collector, Long> {
|
public interface CollectorRepository extends JpaRepository<Collector, Long> {
|
||||||
|
|
||||||
@Query("SELECT c FROM Collector c where c.productId = :productId")
|
@Query("SELECT c FROM Collector c where c.productId = :productId")
|
||||||
Collector findByPID(@Param("productId") Long productId);
|
Collector findByPID(@Param("productId") String productId);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user