diff --git a/app/src/main/java/org/ntlab/acanthus_client/resources/gallery/StrokesRest.java b/app/src/main/java/org/ntlab/acanthus_client/resources/gallery/StrokesRest.java index 827ca44..0ef487d 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/resources/gallery/StrokesRest.java +++ b/app/src/main/java/org/ntlab/acanthus_client/resources/gallery/StrokesRest.java @@ -1,4 +1,43 @@ package org.ntlab.acanthus_client.resources.gallery; +import org.ntlab.acanthus_client.entities.Position; +import org.ntlab.acanthus_client.entities.Stroke; + +import java.util.ArrayList; + +import retrofit2.Call; +import retrofit2.http.Field; +import retrofit2.http.FormUrlEncoded; +import retrofit2.http.GET; +import retrofit2.http.POST; +import retrofit2.http.Path; + +//----------------------------------------------------------------- +// RestAPI: /gallery/{aid}/pageMap/{pid}/layers/{layerNo}/ public interface StrokesRest { + + //----------------------------------------------------------------- + // + @GET("gallery/{aid}/pageMap/0/layers/0/strokes") + Call> getStrokes(@Path("aid") Integer aid); + + //----------------------------------------------------------------- + // + @FormUrlEncoded + @POST("gallery/{aid}/pageMap/0/layers/0/strokes") + Call addStrokes(@Path("aid") Integer aid, @Field("uid") Integer uid, @Field("uidToken") String uidToken, + @Field("pen") Integer pen, @Field("color") Integer color, @Field("thick") Integer thick); + + //----------------------------------------------------------------- + // + @GET("gallery/{aid}/pageMap/0/layers/0/strokes/{strokeNo}/position") + Call> getPositions(@Path("aid") Integer aid, @Path("strokeNo") Integer strokeNo); + + //----------------------------------------------------------------- + // + @FormUrlEncoded + @POST("gallery/{aid}/pageMap/0/layers/0/strokes/{strokeNo}/position") + Call addPositions(@Path("aid") Integer aid, @Path("strokeNo") Integer strokeNo, + @Field("x") Float x, @Field("y") Float y); + //----------------------------------------------------------------- }