package com.joker.fourfun.net;

import com.joker.fourfun.model.ArticleOne;
import com.joker.fourfun.model.Movie;
import com.joker.fourfun.model.Music;
import com.joker.fourfun.model.Picture;
import com.joker.fourfun.model.LoginInfo;
import com.joker.fourfun.model.User;
import com.joker.fourfun.model.Zhihu;

import java.util.List;
import java.util.Map;

import io.reactivex.Flowable;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * Created by joker on 2016/11/27.
 */

public interface UserService {
    @GET("PicZhihuServlet")
    Flowable<HttpResult<List<Zhihu>>> zhihuPic();

    @GET("PicOneServlet")
    Flowable<HttpResult<List<Picture>>> picOne(@Query("date") String date);

    @GET("PicOneServlet")
    Flowable<HttpResult<List<Picture>>> picOneNum(@Query("num") String num);

    @GET("ArOneServlet")
    Flowable<HttpResult<List<ArticleOne>>> article(@Query("num") int num);

    @GET("MusicServlet")
    Flowable<HttpResult<List<Music>>> music(@Query("date") String date);

    @Streaming
    @GET
    Flowable<ResponseBody> downloadMusic(@Url String url);

    @GET("MovieServlet")
    Flowable<HttpResult<List<Movie>>> movie(@Query("date") String date);

    @GET("login")
    Flowable<HttpResult<List<LoginInfo>>> login(@QueryMap Map<String, String> userInfo);

    @POST("register")
    Flowable<HttpResult<List<LoginInfo>>> register(@Body User user);
}
@@ -68,16 +68,58 @@
 cleOne;%0A
+import com.joker.fourfun.model.LoginInfo;%0A
 import c
@@ -148,16 +148,16 @@
 .Movie;%0A
-
 import c
@@ -230,50 +230,8 @@
 re;%0A
-import com.joker.fourfun.model.LoginInfo;%0A
 impo
@@ -328,30 +328,8 @@
 ist;
-%0Aimport java.util.Map;
 %0A%0Aim
@@ -468,16 +468,16 @@
 p.POST;%0A
+
 import r
@@ -501,40 +501,8 @@
 ry;%0A
-import retrofit2.http.QueryMap;%0A
 impo
@@ -1378,40 +1378,84 @@
 uery
-Map Map%3CString, String%3E userInfo
+(%22userName%22) String username, @Query(%22password%22)%0A            String password
 );%0A%0A

add an interface