Newer
Older
CosmosServer / src / main / java / com / example / cosmos_serversb / resources / GroupsRest.java
t-kume on 23 May 2019 3 KB 細かな修正
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.*;

@Component
@Path("/groups")
public class GroupsRest {

    @GET
    public String getGroups(String uId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

    @POST
    public String createGroup(String name, String uId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

@Path("/{gId}")
    @GET
    public String getGroupInfo(String gId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

    @DELETE
    public String deleteGroup(String gId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

@Path("/members")
    @GET
    public String getGroupMembersInfo(String gId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

    @POST
    public String addGroupMembers(String gId, String uId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

    @DELETE
    public String deleteGroupMembers(String gId, String uId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

@Path("/requests")
    @GET
    public String getGroupRequestsInfo(String gId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

    @POST
    public String createGroupRequests(String gId, String uId, String product, String deadline, int location) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

@Path("/{rId}")
    @GET
    public String getGroupRequestInfo(String gId, String rId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }
    @PUT
    public String changeGroupRequest(String gId, String rId, String uId, String product, String deadline, int location, boolean done) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }

    @DELETE
    public String GroupsInfo(String gId, String rId) throws JsonProcessingException{
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(null);
        return json;
    }
}