package com.sunzee.retrofit;

import com.sunzee.model.EmailResult;
import com.sunzee.model.HttpResult;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;


public interface ApiStores {
    //baseUrl
    String API_SERVER_URL = "http://clean.sunzee.com.cn/";
//    String API_SERVER_URL = "http://192.168.0.184:8008";

    // 用bean接收 返回值
    @POST("api/coinOrder/email.htm")
    Observable<EmailResult> testEmail(@QueryMap Map<String, String> param);

    // 用map接收 返回值
    @GET("api/order/getOrderStatus.htm")
    Observable<HashMap> getOrderStatus(@Query("sn") String sn);


    @FormUrlEncoded
    @POST("/api/app_equipment/index/init.htm")
    Observable<HttpResult<String>> init(@FieldMap Map<String, String> params);

    //获取广告规则
    @GET("api/app_ADIndex/ADIndex/getTimeRule.htm")
    Observable<HttpResult<String>> getTimeRule(@QueryMap Map<String, Long> params);

    //获取指定的广告，上传设备id,返回该id的的广告资源
    @GET("/api/app_ADIndex/ADIndex/getAdNew.htm")
    Observable<HttpResult<String>> uploadID(@QueryMap Map<String, String> params);

    //同步规则
    @GET("api/app_synchro/synchroIndex/synTimeRule.htm")
    Observable<HttpResult<String>> synTimeRule(@QueryMap Map<String, String> params);

    //下载失败上传
    @FormUrlEncoded
    @POST("/api/app_ADIndex/ADIndex/pushTimeUpdate.htm")
    Observable<HttpResult<String>> pushTimeUpdate(@FieldMap Map<String, String> params);

    //检查更新:获取版本数据
    @GET("api/appApkInfo/apkinfo.htm")
    Observable<HttpResult<String>> updataAPK(@QueryMap Map<String, String> params);

    //上传心跳
    @POST("api/app_equipment/index/heart.htm")
    Observable<HttpResult<String>> heart(@Body RequestBody body);

    //重置密码
    @FormUrlEncoded
    @POST("api/app_equipment/index/updatePwd.htm")
    Observable<HttpResult<String>> updatePaw(@FieldMap Map<String, String> params);

    //上传进阶参数
    @POST()
    Observable<HttpResult<String>> updateParamApi(@Url String url, @Body RequestBody body);

    //请求清洗规则
    @GET("api/app_synchro/synchroIndex/cleanRule.htm")
    Observable<HttpResult<String>> cleanRule(@QueryMap Map<String, String> params);

    //上传报警记录
    @POST("api/app_alarmRecord/alarmRecodeIndex/addAlarmRecord.htm")
    Observable<HttpResult<String>> addAlarmRecord(@Body RequestBody body);
}
