Add BoardService implementation. #3

Merged
UmbertoF merged 10 commits from feature_board into develop 2019-11-10 22:44:41 +00:00
2 changed files with 42 additions and 0 deletions
Showing only changes of commit 991b19a1b8 - Show all commits

View File

@ -3,6 +3,7 @@ package wekan.wrapper.api;
import retrofit2.Call;
import retrofit2.http.*;
import wekan.wrapper.entity.Board;
import wekan.wrapper.entity.MemberPermission;
import wekan.wrapper.entity.BoardPrototype;
import java.util.List;
@ -20,6 +21,13 @@ public interface BoardService {
@DELETE("api/boards/{boardId}")
Call<Void> deleteBoard(@Path("boardId") String boardId);
@POST("/api/boards/{boardId}/members/{memberId}")
Call<Void> setBoardMemberPermission(
@Path("boardId") String board,
@Path("memberId") String member,
@Body MemberPermission memberPermission
);
@GET("api/users/{userId}/boards")
Call<List<Board>> getBoardsFromUser(@Path("userId") String userId);
}

View File

@ -0,0 +1,34 @@
package wekan.wrapper.entity;
public class MemberPermission {
public final static MemberPermission ADMIN = new MemberPermission(
true,
false,
false
);
public final static MemberPermission NORMAL = new MemberPermission(
false,
false,
false
);
public final static MemberPermission NO_COMMENTS = new MemberPermission(
false,
true,
false
);
public final static MemberPermission COMMENT_ONLY = new MemberPermission(
false,
false,
true
);
private boolean isAdmin;
private boolean isNoComments;
private boolean isCommentOnly;
private MemberPermission(boolean isAdmin, boolean isNoComments, boolean isCommentOnly) {
this.isAdmin = isAdmin;
this.isNoComments = isNoComments;
this.isCommentOnly = isCommentOnly;
}
}