8000 feat: create inital structure on resource · soujava/mongodb-virtual-threads@8bc399f · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bc399f

Browse files
committed
feat: create inital structure on resource
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
1 parent d3c398c commit 8bc399f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/org/jnosql/demoee/Camera.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ public static Camera of(Faker faker) {
2323
String brandWithModel = faker.camera().brandWithModel();
2424
return new Camera(UUID.randomUUID().toString(), brand, model, brandWithModel);
2525
}
26+
27+
public Camera update(Camera request) {
28+
return null;
29+
}
2630
}

src/main/java/org/jnosql/demoee/DevelopersResource.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,12 @@ public Camera get(@PathParam("id") String id) {
4646
.orElseThrow(() -> new WebApplicationException(Response.Status.NOT_FOUND));
4747
}
4848

49-
public record UpdateDeveloperRequest(String name, LocalDate birthday) {
50-
}
51-
5249
@Path("{id}")
5350
@PUT
54-
public Camera update(@PathParam("id") String id, UpdateDeveloperRequest request) {
55-
var developer = service.findById(id)
51+
public Camera update(@PathParam("id") String id, Camera request) {
52+
var camera = service.findById(id)
5653
.orElseThrow(() -> new WebApplicationException(Response.Status.NOT_FOUND));
57-
var updatedDeveloper = developer.update(request.name(), request.birthday());
58-
return service.update(updatedDeveloper);
54+
return service.update(camera.update(request));
5955

6056
}
6157

0 commit comments

Comments
 (0)
0