Service

public interface APIService {

    @POST("/{token}/item/create")
    @FormUrlEncoded
    Call<Result> create(
            @Path("token") String token,
            @Field("name") String name,
            @Field("brand") String brand,
            @Field("price") Integer price
    );


    @POST("/{token}/item/{id}/update")
    @FormUrlEncoded
    Call<Result> update(
            @Path("token") String token,
            @Path("id") int id,
            @Field("name") String name,
            @Field("brand") String brand,
            @Field("price") Integer price
    );

    @GET("/{token}/item")
    Call<Result> getAll(
            @Path("token") String token
    );

    @GET("/{token}/item/{id}")
    Call<Result> getItem(
            @Path("token") String token,
            @Path("id") int id
    );

    @GET("/{token}/item/{id}/delete")
    Call<Result> delete(
            @Path("token") String token,
            @Path("id") int id
    );
}

Last updated

Was this helpful?