@@ -27,12 +27,12 @@ public class DevelopersResource {
27
27
DocumentTemplate template ;
28
28
29
29
@ GET
30
- public List <Developer > listAll (@ QueryParam ("name" ) String name ) {
30
+ public List <Camera > listAll (@ QueryParam ("name" ) String name ) {
31
31
if (name == null ) {
32
- return template .select (Developer .class ).result ();
32
+ return template .select (Camera .class ).result ();
33
33
}
34
34
35
- return template .select (Developer .class )
35
+ return template .select (Camera .class )
36
36
.where ("name" )
37
37
.like (name )
38
38
.result ();
@@ -42,15 +42,15 @@ public record NewDeveloperRequest(String name, LocalDate birthday) {
42
42
}
43
43
44
44
@ POST
45
- public Developer add (NewDeveloperRequest request ) {
46
- var newDeveloper = Developer .newDeveloper (request .name (), request .birthday ());
45
+ public Camera add (NewDeveloperRequest request ) {
46
+ var newDeveloper = Camera .newDeveloper (request .name (), request .birthday ());
47
47
return template .insert (newDeveloper );
48
48
}
49
49
50
50
@ Path ("{id}" )
51
51
@ GET
52
- public Developer get (@ PathParam ("id" ) String id ) {
53
- return template .find (Developer .class , id )
52
+ public Camera get (@ PathParam ("id" ) String id ) {
53
+ return template .find (Camera .class , id )
54
54
.orElseThrow (() -> new WebApplicationException (Response .Status .NOT_FOUND ));
55
55
}
56
56
@@ -59,8 +59,8 @@ public record UpdateDeveloperRequest(String name, LocalDate birthday) {
59
59
60
60
@ Path ("{id}" )
61
61
@ PUT
62
- public Developer update (@ PathParam ("id" ) String id , UpdateDeveloperRequest request ) {
63
- var developer = template .find (Developer .class , id )
62
+ public Camera update (@ PathParam ("id" ) String id , UpdateDeveloperRequest request ) {
63
+ var developer = template .find (Camera .class , id )
64
64
.orElseThrow (() -> new WebApplicationException (Response .Status .NOT_FOUND ));
65
65
var updatedDeveloper = developer .update (request .name (), request .birthday ());
66
66
return template .update (updatedDeveloper );
@@ -70,7 +70,7 @@ public Developer update(@PathParam("id") String id, UpdateDeveloperRequest reque
70
70
@ Path ("{id}" )
71
71
@ DELETE
72
72
public void delete (@ PathParam ("id" ) String id ) {
73
- template .delete (Developer .class , id );
73
+ template .delete (Camera .class , id );
74
74
}
75
75
76
76
}
0 commit comments