wedroid/wrapper/src/main/java/it/unisannio/ding/ids/wedroid/wrapper/api/ListService.java

58 lines
1.5 KiB
Java
Raw Normal View History

2019-11-24 17:48:40 +00:00
package it.unisannio.ding.ids.wedroid.wrapper.api;
2019-11-09 18:22:16 +00:00
2019-11-24 17:48:40 +00:00
import it.unisannio.ding.ids.wedroid.wrapper.entity.WList;
2019-11-09 18:22:16 +00:00
import java.util.List;
2020-01-18 11:54:19 +00:00
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
2019-11-09 18:22:16 +00:00
public interface ListService {
2019-11-14 10:47:53 +00:00
/**
* Get the list of Lists attached to a board
*
* @param boardId the ID of the board
* @return the list of all lists
*/
2019-11-09 18:22:16 +00:00
@GET("/api/boards/{board}/lists")
Call<List<WList>> getAllList(@Path("board") String boardId);
2019-11-14 10:47:53 +00:00
/**
* Add a List to a board
*
* @param boardId the ID of the string
* @param title title of the new list
* @return the new list
*/
@FormUrlEncoded
2019-11-09 18:22:16 +00:00
@POST("/api/boards/{board}/lists")
2019-11-14 10:47:53 +00:00
Call<WList> newList(
@Path("board") String boardId,
@Field("title") String title
);
/**
* Get a List attached to a board
* @param boardId the ID of the board
* @param listId the ID of the list
* @return the list
*/
@GET("/api/boards/{board}/lists/{list}")
Call<WList> getList(@Path("board") String boardId, @Path("list") String listId);
/**
* Delete a List
* @param boardId the ID of the board
* @param listId the ID of the list
* @return ID of the delete list
*/
@DELETE("/api/boards/{board}/lists/{list}")
2019-11-24 17:48:40 +00:00
Call<WList> deleteList(@Path("board") String boardId, @Path("list") String listId);
2019-11-14 10:47:53 +00:00
2019-11-09 18:22:16 +00:00
}