Merge pull request #5 from nitta-lab-2019/CreateGroupsRest
確認しました。次はパラメータの型をお願いします。
commit a05d4d4ab29a90ebccfa8f8415c15472853f38c8
2 parents e0de15c + f7bec56
Narumasa kande authored on 24 May 2019
Showing 2 changed files
View
2
■■■
.idea/misc.xml
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="12" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
View
93
src/main/java/com/example/cosmos_serversb/resources/GroupsRest.java
package com.example.cosmos_serversb.resources;
 
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Component;
 
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.*;
 
@Component
@Path("/groups")
public class GroupsRest {
 
@GET
public String index() {
return "{1:Tiger}";
public String getGroupsListByUid(String uId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@POST
public String createGroup(String name, String uId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@Path("/{gId}")
@GET
public String getGroupInfoByGid(String gId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@DELETE
public String deleteGroup(String gId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@Path("/members")
@GET
public String getGroupMembersListByGid(String gId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@POST
public String addMember(String gId, String uId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@DELETE
public String deleteMember(String gId, String uId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@Path("/requests")
@GET
public String getRequestsListByGid(String gId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@POST
public String addRequests(String gId, String uId, String product, String deadline, int location, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@Path("/{rId}")
@GET
public String getRequestsDetailByGidAndRid(String gId, String rId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
@PUT
public String updateRequest(String gId, String rId, String uId, String product, String deadline, int location, boolean done, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
 
@DELETE
public String deleteRequest(String gId, String rId, String token) throws JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(null);
return json;
}
}