package it.unisannio.ding.ids.wedroid.wrapper.api; import it.unisannio.ding.ids.wedroid.wrapper.entity.Comment; import retrofit2.Call; import retrofit2.http.*; import java.util.List; public interface CardCommentService { /** * Get all comments attached to a card. * * @param boardId The ID of the board * @param cardId The ID of the card * @return The list of the comments */ @GET("/api/boards/{boardId}/cards/{cardId}/comments") Call> getAllComments( @Path("boardId") String boardId, @Path("cardId") String cardId ); /** * Post new comment attached on the give card. * * @param boardId The ID of the board * @param cardId The ID of the card * @param authorId The ID of the author * @param comment The comment * @return The id of the new comment */ @FormUrlEncoded @POST("/api/boards/{boardId}/cards/{cardId}/comments") Call postNewComment( @Path("boardId") String boardId, @Path("cardId") String cardId, @Field("authorId") String authorId, @Field("comment") String comment ); /** * Get a comment attached to a card. * * @param boardId The ID of the board * @param cardId The ID of the card * @param commentId The ID of the comment * @return The comment */ @GET("/api/boards/{boardId}/cards/{cardId}/comments/{commentId}") Call getComment( @Path("boardId") String boardId, @Path("cardId") String cardId, @Path("commentId") String commentId ); /** * Delete a comment attached to a card. * * @param boardId The ID of the board * @param cardId The ID of the card * @param commentId The ID of the comment */ @DELETE("/api/boards/{boardId}/cards/{cardId}/comments/{commentId}") Call deleteComment( @Path("boardId") String boardId, @Path("cardId") String cardId, @Path("commentId") String commentId ); }