This commit is contained in:
2020-08-03 09:11:54 +08:00
parent 537441d239
commit 06952bab00
737 changed files with 52091 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
package my_loader;
import java.util.Map;
import http.ObjectLoader;
import http.RetrofitServiceManager;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Url;
import rx.Observable;
import rx.functions.Func1;
/**
* Created by 90432 on 2017/12/23.
*/
public class Loader extends ObjectLoader {
private LoaderService mMovieService;
public Loader(){
mMovieService = RetrofitServiceManager.getInstance().create(LoaderService.class);
}
/**
* 获取电影列表
* @param start
* @param count
* @return
*/
public Observable<Resultcode> getMovie(String start, Map<String,String> count){
return observe(mMovieService.getTop250(start,count))
.map(new Func1<Resultcode, Resultcode>() {
@Override
public Resultcode call(Resultcode resultcode) {
return resultcode;
}
});
}
/**
* 获取电影列表
* @param
* @param
* @return
*/
/* public Observable<String> getWeatherList(String cityId,String key){
return observe(mMovieService.getWeather(cityId,key)).map(new Func1<String, String>() {
@Override
public String call(String s) {
return null;
}
});
}
*/
public interface LoaderService{
//获取豆瓣Top250 榜单appid以及type
/* @GET("top250")
Observable<Resultcode> getTop250(@Query("appid") String start, @Query("type") int type);*/
@FormUrlEncoded
/* @POST("api/user/getVerificationCode")*/
@POST()
Observable<Resultcode> getTop250(@Url String url, @FieldMap Map<String, String> params);
/* @FormUrlEncoded
@POST("/x3/weather")
//@Multipart
//Observable<String> getWeather(@Field("cityId") String cityId, @Field("key") String key, @Part MultipartBody.Part file);
Observable<String> getWeather(@Field("cityId") String cityId, @Field("key") String key);*/
}}

View File

@@ -0,0 +1,15 @@
package my_loader;
/**
* Created by 90432 on 2017/12/23.
*/
public class Resultcode<T> {
public int status ;
public String msg;
public Object data;
}