package it.unisannio.ding.ids.wedroid.wrapper.api; import it.unisannio.ding.ids.wedroid.wrapper.entity.Action; import it.unisannio.ding.ids.wedroid.wrapper.entity.Board; import it.unisannio.ding.ids.wedroid.wrapper.entity.User; import java.util.List; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.DELETE; import retrofit2.http.Field; import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; import retrofit2.http.Headers; import retrofit2.http.POST; import retrofit2.http.Path; public interface UserService { /** * Get all users. * * @return the list with all users */ @GET("api/users") Call> getAllUser(); /** * Get user information * * @param userId ID user * @return user information */ @GET("api/users/{user}") Call getUser(@Path("user") String userId); /** * Get current User * @return the current user */ @GET("api/user") Call getCurrentUser(); /** * Delete user * @param userId * @return */ @DELETE("api/users/{user}") Call delete(@Path("user") String userId); /******************** Don't work ****************************************************/ @FormUrlEncoded @POST("api/users") @Headers("Content-Type: multipart/form-data") Call newUser(@Field("username") String username, @Field("email") String email, @Field("password") String password ); @FormUrlEncoded @Headers("Content-Type: multipart/form-data") @POST("/api/boards/{board}/members/{user}/add") Call addMemberToBoard(@Path("board") String boardId, @Path("user") String userId, @Field("action") String action, @Field("isAdmin") boolean b1, @Field("isNoComments") boolean b2, @Field("isCommentOnly") boolean b3); @POST("api/boards/{board}/members/{user}/remove") Call removeUserFromBoard(@Path("board") String boardId, @Path("user") String userId, @Body Action action); }