Skip to content
Snippets Groups Projects
Commit e5c0f6a6 authored by Lucas Bertrand-Christen's avatar Lucas Bertrand-Christen
Browse files

fix:created-by-rename

parent d82041f2
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,10 @@ import com.google.gson.stream.JsonWriter;
import fr.miage23.filestore.TypeNode;
import fr.miage23.filestore.api.dto.CollectionDto;
import fr.miage23.filestore.api.dto.GETNodeDto;
import fr.miage23.filestore.api.dto.GETOutputNodeDto;
import fr.miage23.filestore.api.dto.InputNodeDto;
import fr.miage23.filestore.api.dto.POSTNodeDto;
import fr.miage23.filestore.api.dto.POSTOutputNodeDto;
import fr.miage23.filestore.files.FileService;
import fr.miage23.filestore.files.InMemoryFileServiceBean;
import fr.miage23.filestore.files.entity.Node;
......@@ -57,8 +59,8 @@ public class NodesResource {
.create();
Node node = service.get("root");
return Response.ok(gson.toJson(
(new GETNodeDto(node.getType(), node.getId(), node.getParent(), node.getName(), node.getSize(), node.getCreation(), node.getModification())),
GETNodeDto.class),
(new GETOutputNodeDto(node.getType(), node.getId(), node.getParent(), node.getName(), node.getSize(), node.getCreation(), node.getModification())),
GETOutputNodeDto.class),
MediaType.APPLICATION_JSON).build();
} catch (NodeNotFoundException e) {
return Response.status(Response.Status.NOT_FOUND).entity("Node not found.").build();
......@@ -111,8 +113,8 @@ public class NodesResource {
.create();
Node node = service.get(id);
return Response.ok(gson.toJson(
(new GETNodeDto(node.getType(), node.getId(), node.getParent(), node.getName(), node.getSize(), node.getCreation(), node.getModification())),
GETNodeDto.class),
(new GETOutputNodeDto(node.getType(), node.getId(), node.getParent(), node.getName(), node.getSize(), node.getCreation(), node.getModification())),
GETOutputNodeDto.class),
MediaType.APPLICATION_JSON).build();
}
......@@ -141,8 +143,8 @@ public class NodesResource {
Node node = service.get(newid);
return Response.ok(gson.toJson(
(new POSTNodeDto(node.getId())),
POSTNodeDto.class),
(new POSTOutputNodeDto(node.getId())),
POSTOutputNodeDto.class),
MediaType.APPLICATION_JSON).build();
}
......@@ -173,8 +175,8 @@ public class NodesResource {
.create();
Node node = service.get(newid);
return Response.ok(gson.toJson(
(new POSTNodeDto(node.getId())),
POSTNodeDto.class),
(new POSTOutputNodeDto(node.getId())),
POSTOutputNodeDto.class),
MediaType.APPLICATION_JSON).build();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment