From aafc05cc32ea0861f0e924104aa4f0466eef754c Mon Sep 17 00:00:00 2001 From: norangebit Date: Sun, 10 Nov 2019 13:55:50 +0100 Subject: [PATCH] prepare for pull request - add javadoc - rename Permission to BoardPermission - edit BoardPrototype.Builder, now uses MemberPermission - add getter to Label, Member and MemberPermission --- .../java/wekan/wrapper/api/BoardService.java | 52 ++++++++++++- .../main/java/wekan/wrapper/entity/Board.java | 4 +- .../{Permission.java => BoardPermission.java} | 2 +- .../wekan/wrapper/entity/BoardPrototype.java | 77 +++++++++++++------ .../main/java/wekan/wrapper/entity/Label.java | 12 +++ .../wekan/wrapper/entity/LabelPrototype.java | 7 ++ .../java/wekan/wrapper/entity/Member.java | 20 +++++ .../wrapper/entity/MemberPermission.java | 27 +++++++ .../wekan/wrapper/api/BoardServiceTest.java | 2 +- 9 files changed, 172 insertions(+), 31 deletions(-) rename wrapper/src/main/java/wekan/wrapper/entity/{Permission.java => BoardPermission.java} (85%) diff --git a/wrapper/src/main/java/wekan/wrapper/api/BoardService.java b/wrapper/src/main/java/wekan/wrapper/api/BoardService.java index 5f1d96c..78d7f27 100644 --- a/wrapper/src/main/java/wekan/wrapper/api/BoardService.java +++ b/wrapper/src/main/java/wekan/wrapper/api/BoardService.java @@ -10,31 +10,77 @@ import wekan.wrapper.entity.BoardPrototype; import java.util.List; public interface BoardService { + + /** + * Get all public boards. + * + * @return the list with all public boards + */ @GET("api/boards") Call> getPublicBoards(); + /** + * Create a board. + * + * @param boardPrototype the prototype of the new board + * @return the new board + * @see BoardPrototype + */ @POST("api/boards") Call newBoard(@Body BoardPrototype boardPrototype); + /** + * Get the board with that particular ID. + * + * @param boardId The ID of the board + * @return The board with the matching ID + */ @GET("api/boards/{boardId}") Call getBoard(@Path("boardId") String boardId); + /** + * Delete the board with that particular ID + * + * @param boardId The ID of the board + */ @DELETE("api/boards/{boardId}") Call deleteBoard(@Path("boardId") String boardId); + /** + * Add a label to a board. + * + * @param boardId The ID of the board + * @param labelPrototype The prototype of new label + * @return The ID of new label + * @see LabelPrototype + */ @PUT("/api/boards/{boardId}/labels") Call addLabel( - @Path("boardId") String board, + @Path("boardId") String boardId, @Body LabelPrototype labelPrototype ); + /** + * Change the permission of a member of a board. + * + * @param boardId The ID of the board + * @param memberId The ID of the member + * @param memberPermission The new role of the member + * @see MemberPermission + */ @POST("/api/boards/{boardId}/members/{memberId}") Call setMemberPermission( - @Path("boardId") String board, - @Path("memberId") String member, + @Path("boardId") String boardId, + @Path("memberId") String memberId, @Body MemberPermission memberPermission ); + /** + * Get all boards attached to a user. + * + * @param userId The ID of the user + * @return The list with all user's boards + */ @GET("api/users/{userId}/boards") Call> getBoardsFromUser(@Path("userId") String userId); } diff --git a/wrapper/src/main/java/wekan/wrapper/entity/Board.java b/wrapper/src/main/java/wekan/wrapper/entity/Board.java index 96a9eea..175afdf 100644 --- a/wrapper/src/main/java/wekan/wrapper/entity/Board.java +++ b/wrapper/src/main/java/wekan/wrapper/entity/Board.java @@ -16,7 +16,7 @@ public class Board { private int starts; private List