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 1
1
package org .jnosql .demoee ;
2
2
3
+ import io .quarkus .virtual .threads .VirtualThreads ;
3
4
import jakarta .inject .Inject ;
4
5
import jakarta .ws .rs .Consumes ;
5
6
import jakarta .ws .rs .DELETE ;
@@ -26,6 +27,7 @@ public class CameraResource {
26
27
CameraService service ;
27
28
28
29
@ GET
30
+ @ VirtualThreads
29
31
public List <Camera > listAll (@ QueryParam ("brand" ) String brand ) {
30
32
if (brand == null || brand .isBlank ()) {
31
33
return service .findAll ();
@@ -35,19 +37,22 @@ public List<Camera> listAll(@QueryParam("brand") String brand) {
35
37
36
38
37
39
@ POST
40
+ @ VirtualThreads
38
41
public Camera add (Camera camera ) {
39
42
return service .insert (camera );
40
43
}
41
44
42
45
@ Path ("{id}" )
43
46
@ GET
47
+ @ VirtualThreads
44
48
public Camera get (@ PathParam ("id" ) String id ) {
45
49
return service .findById (id )
46
50
.orElseThrow (() -> new WebApplicationException (Response .Status .NOT_FOUND ));
47
51
}
48
52
49
53
@ Path ("{id}" )
50
54
@ PUT
55
+ @ VirtualThreads
51
56
public Camera update (@ PathParam ("id" ) String id , Camera request ) {
52
57
var camera = service .findById (id )
53
58
.orElseThrow (() -> new WebApplicationException (Response .Status .NOT_FOUND ));
@@ -57,6 +62,7 @@ public Camera update(@PathParam("id") String id, Camera request) {
57
62
58
63
@ Path ("{id}" )
59
64
@ DELETE
65
+ @ VirtualThreads
60
66
public void delete (@ PathParam ("id" ) String id ) {
61
67
service .deleteById (id );
62
68
}
You can’t perform that action at this time.
0 commit comments