social-service/src/main/java/org/gcube/social_networking/rest/Posts.java

114 lines
3.5 KiB
Java

package org.gcube.social_networking.rest;
import com.webcohesion.enunciate.metadata.rs.RequestHeader;
import com.webcohesion.enunciate.metadata.rs.RequestHeaders;
import com.webcohesion.enunciate.metadata.rs.ResourceGroup;
import com.webcohesion.enunciate.metadata.rs.ResourceLabel;
import org.gcube.social_networking.socialnetworking.model.shared.Attachment;
import org.gcube.social_networking.socialnetworking.model.shared.Comment;
import org.gcube.social_networking.socialnetworking.model.shared.Post;
import javax.ws.rs.*;
import java.util.List;
@Path("posts")
@ResourceGroup("Posts APIs")
@ResourceLabel("Posts APIs")
@RequestHeaders({
@RequestHeader( name = "Authorization", description = "Bearer token, see <a href=\"https://dev.d4science.org/how-to-access-resources\">https://dev.d4science.org/how-to-access-resources</a>")
})
public class Posts {
@POST
@Path("/postuser")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
@Consumes({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void saveUserPost(Post post) {
}
@POST
@Path("/postuser")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
@Consumes({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void saveUserPost(Post post, List<Attachment> attachments){
}
@PUT
@Path("/{id}")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void deletePost(@PathParam("id") String postid) {
}
@POST
@Path("/postapp")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
@Consumes({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void saveAppPost(Post post) {
}
@POST
@Path("/postapp/")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
@Consumes({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void saveAppPost(Post post, List<Attachment> attachments){
}
@GET
@Path("/{id}/")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void readPost(@PathParam("id") String postid){
}
@GET
@Path("/portalprivacy")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void getAllPortalPrivacyLevelPosts(){
}
@GET
@Path("/{id}/comments")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void getAllCommentByPost(@PathParam("id") String postid){
}
@GET
@Path("/{id}/likes")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void getAllLikesByPost(@PathParam("id") String postid){
}
//the following two methods had vreid why?
@POST
@Path("/{id}/hashtags")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
@Consumes({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void saveHashTags(@PathParam("id") String postid, List<String> hashtags) {
}
@DELETE
@Path("/{id}/hashtags")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
@Consumes({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void deleteHashTagsComment(@PathParam("id") String postid, List<String> hashtags) {
}
@GET
@Path("/{id}/attachments")
@Produces({"application/json;charset=UTF-8", "application/vnd.api+json"})
public void getAttachmentsByPostId(@PathParam("id") String postid) {
}
}