File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/main/java/org/jnosql/demoee Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 11package org .jnosql .demoee ;
22
3+ import io .quarkus .virtual .threads .VirtualThreads ;
34import jakarta .inject .Inject ;
45import jakarta .ws .rs .Consumes ;
56import jakarta .ws .rs .DELETE ;
@@ -26,6 +27,7 @@ public class CameraResource {
2627 CameraService service ;
2728
2829 @ GET
30+ @ VirtualThreads
2931 public List <Camera > listAll (@ QueryParam ("brand" ) String brand ) {
3032 if (brand == null || brand .isBlank ()) {
3133 return service .findAll ();
@@ -35,19 +37,22 @@ public List<Camera> listAll(@QueryParam("brand") String brand) {
3537
3638
3739 @ POST
40+ @ VirtualThreads
3841 public Camera add (Camera camera ) {
3942 return service .insert (camera );
4043 }
4144
4245 @ Path ("{id}" )
4346 @ GET
47+ @ VirtualThreads
4448 public Camera get (@ PathParam ("id" ) String id ) {
4549 return service .findById (id )
4650 .orElseThrow (() -> new WebApplicationException (Response .Status .NOT_FOUND ));
4751 }
4852
4953 @ Path ("{id}" )
5054 @ PUT
55+ @ VirtualThreads
5156 public Camera update (@ PathParam ("id" ) String id , Camera request ) {
5257 var camera = service .findById (id )
5358 .orElseThrow (() -> new WebApplicationException (Response .Status .NOT_FOUND ));
@@ -57,6 +62,7 @@ public Camera update(@PathParam("id") String id, Camera request) {
5762
5863 @ Path ("{id}" )
5964 @ DELETE
65+ @ VirtualThreads
6066 public void delete (@ PathParam ("id" ) String id ) {
6167 service .deleteById (id );
6268 }
You can’t perform that action at this time.
0 commit comments