diff --git a/.idea/misc.xml b/.idea/misc.xml index f66521e..a2598f9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/src/main/java/com/example/cosmos_serversb/resources/GroupsRest.java b/src/main/java/com/example/cosmos_serversb/resources/GroupsRest.java index 0388d13..28a0bd3 100644 --- a/src/main/java/com/example/cosmos_serversb/resources/GroupsRest.java +++ b/src/main/java/com/example/cosmos_serversb/resources/GroupsRest.java @@ -13,7 +13,7 @@ @GET public String getGroupsListByUid(@QueryParam("uId") String uId, @QueryParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.getGroupsListByUid(uId)); return json; } @@ -21,7 +21,7 @@ @POST public String createGroup(@FormParam("name") String name, @FormParam("uId") String uId, @FormParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.createGroup(name, uId)); return json; } @@ -29,7 +29,7 @@ @GET public String getGroupByGid(@PathParam("gId") String gId, @QueryParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.getGroupByGid(gId)); return json; } @@ -37,7 +37,7 @@ @DELETE public String deleteGroup(@PathParam("gId") String gId, @FormParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.deleteGroup(gId)); return json; } @@ -45,7 +45,7 @@ @GET public String getGroupMembersListByGid(@PathParam("gId") String gId, @QueryParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.getMembersListByGid(gId)); return json; } @@ -53,7 +53,7 @@ @POST public String addMember(@PathParam("gId") String gId, @FormParam("uId") String uId, @FormParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.addMember(gId, uId)); return json; } @@ -61,7 +61,7 @@ @DELETE public String deleteMember(@PathParam("gId") String gId, @FormParam("uId") String uId, @FormParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.deleteMember(gId, uId)); return json; } @@ -69,7 +69,7 @@ @GET public String getRequestsListByGid(@PathParam("gId") String gId, @QueryParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.getRequestsListByGid(gId)); return json; } @@ -77,7 +77,7 @@ @POST public String addRequests(@PathParam("gId") String gId, @FormParam("uId") String uId, @FormParam("product") String product, @FormParam("deadline") String deadline, @FormParam("location") int location, @FormParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.addRequests(gId, uId, product, deadline, location)); return json; } @@ -85,7 +85,7 @@ @GET public String getRequestsDetailByGidAndRid(@PathParam("gId") String gId, @PathParam("rId") String rId, @QueryParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.getRequestsDetailByGidAndRid(gId, rId)); return json; } @@ -93,7 +93,7 @@ @PUT public String updateRequest(@PathParam("gId") String gId, @PathParam("rId") String rId, @FormParam("uId") String uId, @FormParam("product") String product, @FormParam("deadline") String deadline, @FormParam("location") int location, @FormParam("done") boolean done, @FormParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.updateRequest(gId, rId, uId, product, deadline, location, done)); return json; } @@ -101,7 +101,7 @@ @DELETE public String deleteRequest(@PathParam("gId") String gId, @PathParam("rId") String rId, @FormParam("token") String token) throws JsonProcessingException{ ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(null); + String json = mapper.writeValueAsString(Groups.deleteRequest(gId, rId)); return json; } }