Newer
Older
NemophilaClient / app / src / main / java / com / example / nemophila / resources / PostsRest.java
package com.example.nemophila.resources;

import com.example.nemophila.entities.Post;
import com.example.nemophila.entities.PostJson;

import java.util.ArrayList;
import java.util.Collection;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface PostsRest {
    @FormUrlEncoded
    @POST("accounts/{uid}/posts")
    Call<String> postAccountPost(
            @Path("uid") String uid,
            @Field("token") String token,
            @Field("sid") String sid,
            @Field("rate") String rate,
            @Field("genre") String genre,
            @Field("comment")String comment,
            @Field("image1") String img1,
            @Field("image2") String img2,
            @Field("image3") String img3
    );

    @GET("accounts/{uid}/posts")
    Call<Collection<Post>> getAccountPosts(
            @Path("uid") String uid
    );

    @GET("shops/{sid}/posts")
    Call<ArrayList<PostJson>> getShopPosts(
            @Path("sid") String sid
    );
}