[update]StrokeRestにAPIを追加
1 parent 93ebaed commit a30c9fb1ab781e8b77399198ffd4e6faf92bd7d7
k-fujii authored on 11 Jun 2021
Showing 1 changed file
View
39
app/src/main/java/org/ntlab/acanthus_client/resources/gallery/StrokesRest.java
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<ArrayList<Stroke>> getStrokes(@Path("aid") Integer aid);
 
//-----------------------------------------------------------------
//
@FormUrlEncoded
@POST("gallery/{aid}/pageMap/0/layers/0/strokes")
Call<Integer> 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<ArrayList<Position>> getPositions(@Path("aid") Integer aid, @Path("strokeNo") Integer strokeNo);
 
//-----------------------------------------------------------------
//
@FormUrlEncoded
@POST("gallery/{aid}/pageMap/0/layers/0/strokes/{strokeNo}/position")
Call<Integer> addPositions(@Path("aid") Integer aid, @Path("strokeNo") Integer strokeNo,
@Field("x") Float x, @Field("y") Float y);
//-----------------------------------------------------------------
}