package com.tengshisoft.mainmodule.net;

import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
import com.tenlionsoft.baselib.core.retrofit_net.bean.VersionBean;
import com.tengshisoft.mainmodule.beans.BaseUserBean;
import com.tengshisoft.mainmodule.beans.GirdPBean;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;

/**
 * 作者: adam
 * 日期: 2020/10/13 - 4:40 PM
 * 邮箱: itgaojian@163.com
 * 描述:
 */
public interface MainApi {


    /**
     * 获取网格员信息
     *
     * @param token
     * @return
     */
    @Headers({"base_url_name:house", "base_url_name:city", "Content-Type: application/json", "Accept: application/json"})
    @GET("app/gridpersonnel/getgridpersonnelofmine")
    Observable<GirdPBean> getGridInfo(@Header("token") String token);

    /**
     * 上传图片文件
     * image
     *
     * @param file
     * @param token
     * @return
     */
    @Multipart
    @POST("app/file/uploadimage")
    Observable<BaseSuccessBean> uploadImage(@Part MultipartBody.Part file, @Header("token") String token);

    /**
     * 获取App版本
     * "base_url_name:dict",
     *
     * @param token
     * @return
     */
    @Headers({"base_url_name:house", "Content-Type: application/json", "Accept: application/json"})
    @GET("app/appversion/getappversionnumber/{appVersionId}")
    Observable<VersionBean> doCheckAppVersion(@Path("appVersionId") String appVersionId, @Header("token") String token);

    //获取历史任务数量
    @Headers({"base_url_name:house", "Content-Type: application/json", "Accept: application/json"})
    @GET("app/check/countcheckofmine")
    Observable<BaseSuccessBean> getHistoryCount(@Header("token") String token);


}
