diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index d8d8714..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index a2598f9..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/sbt.xml b/.idea/sbt.xml
deleted file mode 100644
index 2018743..0000000
--- a/.idea/sbt.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 44e7c4d..f249ad3 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
+#Thu May 30 17:11:53 JST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
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 56e936d..883f781 100644
--- a/src/main/java/com/example/cosmos_serversb/resources/GroupsRest.java
+++ b/src/main/java/com/example/cosmos_serversb/resources/GroupsRest.java
@@ -6,6 +6,8 @@
import javax.ws.rs.*;
+import com.example.cosmos_serversb.models.*;
+
@Component
public class GroupsRest {
@@ -13,7 +15,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.getInstance().getGroupsListByUid(uId));
return json;
}
@@ -21,15 +23,15 @@
@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.getInstance().createGroup(name, uId));
return json;
}
@Path("/{gId}")
@GET
- public String getGroupInfoByGid(@PathParam("gId") String gId, @QueryParam("token") String token) throws JsonProcessingException{
+ 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.getInstance().getGroupByGid(gId));
return json;
}
@@ -37,7 +39,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.getInstance().deleteGroup(gId));
return json;
}
@@ -45,7 +47,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.getInstance().getMembersListByGid(gId));
return json;
}
@@ -53,7 +55,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.getInstance().addMember(gId, uId));
return json;
}
@@ -61,7 +63,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.getInstance().deleteMember(gId, uId));
return json;
}
@@ -69,7 +71,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.getInstance().getRequestsListByGid(gId));
return json;
}
@@ -77,7 +79,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.getInstance().addRequests(gId, uId, product, deadline, location));
return json;
}
@@ -85,7 +87,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.getInstance().getRequestDetailByGidAndRid(gId, rId));
return json;
}
@@ -93,7 +95,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.getInstance().updateRequest(gId, rId, uId, product, deadline, location, done));
return json;
}
@@ -101,7 +103,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.getInstance().deleteRequest(gId, rId));
return json;
}
}