File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/main/java/org/jnosql/demoee Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ public class CameraResource {
25
25
CameraService service ;
26
26
27
27
@ GET
28
- public List <Camera > listAll (@ QueryParam ("name " ) String name ) {
29
- if (name == null ) {
28
+ public List <Camera > listAll (@ QueryParam ("brand " ) String brand ) {
29
+ if (brand == null || brand . isBlank () ) {
30
30
return service .findAll ();
31
31
}
32
- return service .findAll ( );
32
+ return service .findByBrand ( brand );
33
33
}
34
34
35
35
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ public List<Camera> findAll() {
21
21
return template .select (Camera .class ).result ();
22
22
}
23
23
24
- public List <Camera > findByName (String name ) {
25
- LOGGER .info ("Selecting cameras by name : " + name );
24
+ public List <Camera > findByBrand (String brand ) {
25
+ LOGGER .info ("Selecting cameras by brand : " + brand );
26
26
return template .select (Camera .class )
27
- .where ("name " )
28
- .like (name )
27
+ .where ("brand " )
28
+ .like (brand )
29
29
.result ();
30
30
}
31
31
You can’t perform that action at this time.
0 commit comments