package com.sheep.gamegroup.model.api;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sheep.gamegroup.model.entity.BaseMessage;

import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import rx.Observable;

/**
 * 暂时没接口
 * Created by ljy on 2018/3/8.
 */
public interface ApiService {
    @GET("/?app=ip.get&ip=8.8.8.8&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json")
    Observable<Object> getRetrofitData();

    //表格形式发送
    @FormUrlEncoded
    @POST("/")
    Call<Object> getTimeInfoPostForm(@FieldMap Map<String, String> map);

    /**
     *
     * @param jsonObject
     * @return
     */
    @Streaming
    @POST("app/auth/sms_for_login/")
    Observable<BaseMessage> getCaptcha(@Body JSONObject jsonObject);

    @POST("app/auth/login_by_sms/")
    Observable<BaseMessage> loginByCaptcha(@Body JSONObject jsonObject);

    /**
     * 获取用户信息
     */
    @GET("app/user/get_info/")
    Observable<BaseMessage> getInfo();
    /**
     * 获取用户的已经挂机微信
     */
    @GET("app/wechat/")
    Observable<BaseMessage> getWebchat();
    /**
     * 提交用户的微信账号与密码
     */
    @POST("app/wechat/")
    Observable<BaseMessage> postWebchat(@Body JSONObject jsonObject);
    /**
     * 提交用户的微信账号与密码
     */
    @PUT("app/wechat/{id}")
    Observable<BaseMessage> putWebchat(@Path("id") int id, @Body JSONObject jsonObject);
    /**
     * 获取微信挂机功能是否开启
     */
    @GET("app/wechat/is_open")
    Observable<BaseMessage> getWebchatIsOpen();
    /**
     * 绑定手机号
     */
    @PUT("app/user/bind_mobile/")
    Observable<BaseMessage> bindMobile(@Query("mobile") String mobile, @Query("sec_code") String sec_code);
    /**
     * 绑定真实姓名
     */
    @PUT("app/user/bind_real_name/")
    Observable<BaseMessage> bindRealname(@Body JSONObject object);
//    Observable<BaseMessage> bindRealname(@Query("real_name") String real_name);
    /**
     * 绑定身份证号
     */
    @PUT("app/user/bind_id_number/")
//    Observable<BaseMessage> bindIdNumber(@Query("id_number") String id_number);
    Observable<BaseMessage> bindIdNumber(@Body JSONObject objec);
    /**
     * 绑定银行卡
     */
    @PUT("app/user/bind_bank_card/")
    Observable<BaseMessage> bindBankCard(@Body JSONObject objec);

    /**
     * 用户提现
     * amount   type
     * type "体现渠道 1：微信 2：支付宝 3：手机充值"
     * now only 1：微信
     */
    @POST("app/withdraw/")
    Observable<BaseMessage> goWithdrawal(@Body JSONObject parame);

    /**
     * 提现绑定微信号
     */
    @GET("app/user/bind_wx/")
    Observable<BaseMessage> bindWeixin(@Query("code") String code);

    /**
     * 获取已接受任务
     */
    @GET("app/accepted_task/")
    Observable<BaseMessage> acceptedTask(@Query("page") int page, @Query("per_page") int per_page);

    /**
     * 提交任务
     */
    @POST("app/accepted_task/")
    Observable<BaseMessage> acceptedTask(@Body JSONObject param);

    /**
     * 获取自己正在运行的任务
     */
    @GET("app/accepted_task/run_task/")
    Observable<BaseMessage> returnTask(@Query("is_succession") int is_succession);
    /**
     * 自动提交时长任务
     *
     "gps": "string",
     "release_task_id": 0,
     "task_time": 0
     */
    @POST("app/accepted_task/auto_check/")
    Observable<BaseMessage> commitAutoTask(@Body JSONObject param);

    /**
     * 获取正在运行的任务
     */
    @GET("app/release_task")
    Observable<BaseMessage> releaseTask(@Query("page") int page, @Query("per_page") int per_page,
                                        @Query("platform") int platform, @Query("is_hot") int is_hot,
                                        @Query("is_recommend") int is_recommend, @Query("about_to_begin") int about_to_begin,
                                        @Query("task_type") int task_type, @Query("is_succession") int is_succession);



    /**
     * 邀请赚钱
     */
    @GET("app/auth/login_by_we_chat")
    Observable<BaseMessage> askMakeMoney(@Body String jsonObject);
    /**
     * 用户提现记录
     */
    @GET("app/withdraw/")
    Observable<BaseMessage> goWithdrawal(@Query("page") int page, @Query("per_page") int per_page, @Query("start_time ") String start_time , @Query("end_time ") String end_time );



    /**
     * 获取正在运行的任务
     * @param jsonObject
     */
    @POST("app/auth/login_by_we_chat")
    Observable<BaseMessage> LoginByWX(@Body com.alibaba.fastjson.JSONObject jsonObject);



    /**
     * 获取正在运行的任务
     * @param jsonObject
     */
    @POST("app/auth/login_by_qq")
    Observable<BaseMessage> LoginByQQ(@Body com.alibaba.fastjson.JSONObject jsonObject);



    @GET("app/user/friend_count_and_award")
    Observable<BaseMessage> FriendCountAndAward();

    /**
     * 放弃任务
     */
    @PUT("app/accepted_task/give_up/")
    Observable<BaseMessage> giveUpTask(@Query("id") int id);

    /**
     * 获取任务显示状态
     */
    @GET("app/task_log/node/{id}")
    Observable<BaseMessage> giveTaskStatue(@Path("id") int id);



    @PUT("app/user/change_base_info")
    Observable<BaseMessage> changeBaseInfo (@Body com.alibaba.fastjson.JSONObject jsonObject);

    /**
     * 更换手机号
     */
    @POST("app/user/switch_phone")
    Observable<BaseMessage> switchPhone(@Body JSONObject jsonObject);



    /**
     * 更换手机号
     */
    @PUT("app/user/bind_all_real_info")
    Observable<BaseMessage> bindALl(@Body JSONObject jsonObject);
    /**
     * 绑定手机号
     */
    @PUT("app/user/bind_mobile")
    Observable<BaseMessage> bindPhone(@Body JSONObject jsonObject);

    /**
     * 更换手机号
     */
    @GET("app/user/award_detail")
    Observable<BaseMessage> awardDetail(@Query("page") int page,@Query("per_page") int per_page);
    /**
     * 发送绑定手机号短信，只传mobile
     */
    @POST("app/user/sms_for_bind_mobile")
    Observable<BaseMessage> smsBindMobile(@Body JSONObject jsonObject);
    /**
     * 修改任务进度
     */
    @GET("app/accepted_task/status")
    Observable<BaseMessage> taskStatus(@Query("id") int id,@Query("screenshots") String screenshots,
        @Query("remark") String remark,@Query("package_name") String package_name,@Query("status") String status);
//    @GET("app/accepted_task/status")
//    Observable<BaseMessage> taskStatus(@Body JSONObject jsonObject);

    /**
     *下载任务回调
     * @param jsonObject
     * @return
     */
    @PUT("app/accepted_task/download_task_notify/")
    Observable<BaseMessage> taskDownloadNotify(@Body JSONObject jsonObject);

    /**
     * 获取可用余额
     * @return
     */
    @GET("app/user/get_can_withdraw_amount")
    Observable<BaseMessage> getCanWithdrawAmount();

    @GET("loan/userRecord")
    Observable<BaseMessage> userRecord();
    @GET("loan/getYinkerLoanUrl")
    Observable<BaseMessage> getYinkerLoanUrl();
    @GET("loan/getYinkerRepaymentUrl")
    Observable<BaseMessage> getYinkerRepaymentUrl();


    /**
     * 统计数据
     */
    @POST("app/event_tracking")
    Observable<BaseMessage> appEventTracking(@Body JSONObject jsonObject);

    @GET("app/newbie_task")
    Observable<BaseMessage> getNewbieTask();
    @PUT("app/newbie_task")
    Observable<BaseMessage> putNewbieTask(@Body JSONObject jsonObject);
    @POST("app/newbie_task/learn_finish")
    Observable<BaseMessage> appNewbieTaskLearnFinish();

    @GET("app/user/friend_list")
    Observable<BaseMessage> getUserFriendList(@Query("page") int page, @Query("per_page") int per_page);
    @GET("app/release_task/credit_card")
    Observable<BaseMessage> getReleaseTaskCreditCard();
    @POST("app/release_task/credit_card")
    Observable<BaseMessage> releaseTaskCreditCard(@Body JSONObject jsonObject);
    @PUT("app/release_task/{id}/credit_card")
    Observable<BaseMessage> releaseTaskCreditCard(@Path("id") int id, @Body JSONObject jsonObject);
    @GET("app/release_task/{id}/desc")
    Observable<BaseMessage> getReleaseTaskCreditCardDesc(@Path("id") int id);

    /**
     * 首页轮播图
     */
    @GET("app/slideshow")
    Observable<BaseMessage> slideshow(@Query("platform") int platform);

    /**
     * 首页公告
     */
    @GET("app/bulletin")
    Observable<BaseMessage> bulletin(@Query("page") int page, @Query("per_page") int per_page);
    /**
     * 获取微信辅助h5链接
     */
    @GET("qr/task/get_url")
    Observable<BaseMessage> wxfzGetUrl();

    /**
     * 获取任务详情
     */
    @GET("app/release_task/{id}/desc")
    Observable<BaseMessage> taskDesc(@Path("id") int id);
    @GET("app/credit/{id}")
    Observable<BaseMessage> getCredit(@Path("id") int id);
    @POST("app/newbie_task/add_qq")
    Observable<BaseMessage> newbieTaskAddQq(@Body JSONObject jsonObject);

    @GET("app/accepted_task/get_schedule_list")
    Observable<BaseMessage> getCreditCardScheduleList();

    /**
     * 获取提现金额
     */
    @GET("app/withdraw_amount_option")
    Observable<BaseMessage> getWithdrawAmountOption();

    /**
     * 任务类型
     */
    @GET("app/release_task/get_child_task")
    Observable<BaseMessage> getChildTask(@Query("id") int id);


    /**
     * 获取我的资产
     */
    @GET("app/user/my_assets")
    Observable<BaseMessage> getMyAssets();
    /**
     * 充值记录
     */
    @GET("app/recharge/recharge_balance_log")
    Observable<BaseMessage> getRechargeBalanceLog(@Query("page") int page, @Query("per_page") int per_page);
    /**
     * 充值q币记录
     */
    @GET("app/recharge/recharge_qq_log")
    Observable<BaseMessage> getRechargeQQLog(@Query("page") int page, @Query("per_page") int per_page);



    /******div***/

    /**
     * 获取下发充值类型
     * @param page
     * @return
     */
    @GET("app/recharge/pay_way")
    Observable<BaseMessage> getRechargePayway(@Query("type") String page);

    /**
     * 充值
     * @param jsonObject
     * @return
     */
    @POST("app/recharge/recharge_balance")
    Observable<BaseMessage> getRechargeBalance(@Body JSONObject jsonObject);


    /**
     * 绵羊币充值
     * @param parame
     * @return
     */
    @POST("app/recharge/recharge_qq_coin")
    Observable<BaseMessage> goRechargeQ(@Body JSONObject parame);

    /******div***/

    /**
     * 关于我们
     */
    @GET("app/about_us")
    Observable<BaseMessage> aboutUs();

    /**
     * 首页list
     */
    @GET("app/home_list")
    Observable<BaseMessage> homeList();

    /**
     * 已经反馈
     */
    @POST("app/feedback")
    Observable<BaseMessage> feedback(@Body JSONObject jsonObject);

    /**
     * 获取协议
     */
    @GET("app/user/agreement/")
    Observable<BaseMessage> getAgreement();
    /**
     * 提交协议
     */
    @POST("app/user/agreement_back/")
    Observable<BaseMessage> agreementBack(@Body JSONArray jsonArray);
}
