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 java.util.Collection;

import kotlin.jvm.JvmDefaultWithoutCompatibility;
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

//-----------------------------------------------------------------
// RestAPI: /gallery/{aid}/pageMap/{pid}/layers/{layerNo}/
public interface StrokesRest {

    //-----------------------------------------------------------------
    //
    @GET("gallery/{aid}/pageMap/{pid}/layers/{layerNo}/strokes")
    Call<Collection<Stroke>> getStrokes(@Path("aid") Integer aid, @Path("pid") Integer pid, @Path("layerNo") Integer layerNo);

    //-----------------------------------------------------------------
    //
    @FormUrlEncoded
    @POST("gallery/{aid}/pageMap/{pid}/layers/{layerNo}/strokes")
    Call<Integer> addStroke(@Path("aid") Integer aid, @Path("pid") Integer pid, @Path("layerNo") Integer layerNo,
                            @Field("uid") Integer uid,@Field("strokeNo") Integer strokeNo,@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}/positions")
    Call<Collection<Position>> getPositions(@Path("aid") Integer aid, @Path("strokeNo") Integer strokeNo);

    //-----------------------------------------------------------------
    //
    @FormUrlEncoded
    @POST("gallery/{aid}/pageMap/{pid}/layers/0/strokes/{strokeNo}/positions")
    Call<Integer> addPositions(@Field("positionNo") int i, @Path("aid") Integer aid,
                               @Path("pid") int pid, @Path("strokeNo") Integer strokeNo,
                               @Field("x") double x, @Field("y") double y);

    //-----------------------------------------------------------------
    //
    @DELETE("gallery/{aid}/pageMap/{pid}/layers/0/strokes")
    Call<String> deleteStrokes(@Path("aid") Integer aid, @Path("pid") Integer pid, @Query("uid") Integer uid);

    //-----------------------------------------------------------------
    //
    @DELETE("gallery/{aid}/pageMap/0/layers/0/strokes/{strokeNo}/positions")
    Call<String> deleteStrokeNo(@Path("aid") Integer aid, @Path("strokeNo") Integer strokeNo);

    //-----------------------------------------------------------------
    //
    @GET("gallery/{aid}/pageMap/{pid}/image")
    Call<String> getLayers(@Path("aid") Integer aid, @Path("pid") Integer pid);
}