Newer
Older
NemophilaClient / app / src / main / java / com / example / nemophila / resources / PostsRest.java
m-mifune on 22 Jun 2023 1 KB rateをintに
  1. package com.example.nemophila.resources;
  2.  
  3. import com.example.nemophila.entities.Post;
  4. import com.example.nemophila.entities.PostJson;
  5.  
  6. import java.util.ArrayList;
  7. import java.util.Collection;
  8.  
  9. import retrofit2.Call;
  10. import retrofit2.http.Field;
  11. import retrofit2.http.FormUrlEncoded;
  12. import retrofit2.http.GET;
  13. import retrofit2.http.POST;
  14. import retrofit2.http.Path;
  15.  
  16. public interface PostsRest {
  17. @FormUrlEncoded
  18. @POST("accounts/{uid}/posts")
  19. Call<String> postAccountPost(
  20. @Path("uid") String uid,
  21. @Field("token") String token,
  22. @Field("sid") String sid,
  23. @Field("rate") int rate,
  24. @Field("genre") String genre,
  25. @Field("comment")String comment,
  26. @Field("image1") String img1,
  27. @Field("image2") String img2,
  28. @Field("image3") String img3
  29. );
  30.  
  31. @GET("accounts/{uid}/posts")
  32. Call<Collection<PostJson>> getAccountPosts(
  33. @Path("uid") String uid
  34. );
  35.  
  36. @GET("shops/{sid}/posts")
  37. Call<ArrayList<PostJson>> getShopPosts(
  38. @Path("sid") String sid
  39. );
  40. }