package com.rc.httpcore.client.retrofit;

import com.rc.httpcore.apk.ProcessedBean;
import com.rc.httpcore.bean.ChemicalABean;
import com.rc.httpcore.bean.ChemicalConfsBean;
import com.rc.httpcore.bean.ConfigBean;
import com.rc.httpcore.bean.EarlyWarningBean;
import com.rc.httpcore.bean.HxpChemicalVo;
import com.rc.httpcore.bean.HxpControlConfig;
import com.rc.httpcore.bean.InventoryListBean;
import com.rc.httpcore.bean.BelongingPersonBean;
import com.rc.httpcore.bean.ChemicalInfoBean;
import com.rc.httpcore.apk.AppInfo;
import com.rc.httpcore.bean.ChemicalSearchBean;
import com.rc.httpcore.bean.LockVoListBean;
import com.rc.httpcore.bean.MsdsBean;
import com.rc.httpcore.bean.MsdsListBean;
import com.rc.httpcore.bean.PageHxpStockBean;
import com.rc.httpcore.bean.QueryTwoBean;
import com.rc.httpcore.bean.ReturnDetailsBean;
import com.rc.httpcore.bean.ReturnGiveBackBean;
import com.rc.httpcore.bean.ReturningChemicalsBean;
import com.rc.httpcore.bean.RuleBean;
import com.rc.httpcore.bean.ChemicalTypeBean;
import com.rc.httpcore.bean.SearchBean;
import com.rc.httpcore.bean.SearchSpecBean;
import com.rc.httpcore.bean.TopicDataBean;
import com.rc.httpcore.bean.UnifiedVerBean;
import com.rc.httpcore.bean.UseBean;
import com.rc.httpcore.bean.UseLedBean;
import com.rc.httpcore.bean.UseNoBean;
import com.rc.httpcore.bean.UseNoTwoBean;
import com.rc.httpcore.bean.UserData;
import com.rc.httpcore.bean.UserValidationBean;
import com.rc.httpcore.bean.WasteChemicalsBean;
import com.rc.httpcore.bean.HxpStockWaitModeBean;
import com.rc.httpcore.vo.CommonDataResponse;
import com.rc.httpcore.vo.CommonListResponse;
import com.rc.httpcore.vo.CommonResponse;
import com.rc.httpcore.vo.request.FaceCompareReq;
import com.rc.httpcore.vo.request.LearnLoginReq;
import com.rc.httpcore.vo.response.ConfLogo;
import com.rc.httpcore.vo.response.LearnLoginVo;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiService {

    /**
     * 查询LOGO配置列表
     */
    @GET("system/logo/config/getConfInfo")
    Observable<CommonDataResponse<ConfLogo>> queryLogoConfInfo();

    /**
     * 查询APK版本
     */
//    @GET("laboratory/apkfile/onepcApkDetail/{id}")
//    Observable<CommonDataResponse<ApkInfoResp>> apkVersion(@Path("id") String id);

//    //更新apk
//    @GET("system/app/upgrade/check")
//    Observable<CommonDataResponse<AppUpDateBean>> apkVersion(@Query("deviceNum") String deviceNum, @Query("type") int type, @Query("version") double version);

    //上报信息 获取当前设备基础信息
    @GET("iot/aio/report")
    Observable<CommonDataResponse<AppInfo>> getCheck(@Query("deviceNo") String deviceNum, @Query("code") String type, @Query("version") double version);


    //刷卡认证  获取token
    @GET("auth/cardNum")
    Observable<CommonDataResponse<UserData>> cardNum(@Query("cardNum") String cardNum);

    //刷卡登录 验证当前人员身份 是否属于当前实验室
    @GET("chemical/aio/verify/userCardValidation")
    Observable<CommonDataResponse<UserValidationBean>> userCardValidation(@Query("userId") String userId, @Query("subId") String subId);

//    //    @POST("chemical/aio/userValidation")
//    @POST("chemical/aio/identity/userValidation")
//    Observable<CommonDataResponse<UserValidationBean>> userValidation(@Body RequestBody requestBody);

    @POST("chemical/aio/verify/useCardVerify")
    Observable<CommonDataResponse<UserValidationBean>> useCardVerify(@Body RequestBody requestBody);

//    //化学品/cas搜索
//    @GET("chemical/aio/searchChemica")
//    Observable<CommonDataResponse<ChemicalDataBean>> searchChemica(@Query("searchValue") String searchValue, @Query("chemicalLevel") String chemicalLevel);

    //化学品/cas搜索
    @GET("chemical/aio/searchChemica")
    Observable<CommonListResponse<ChemicalSearchBean>> searchChemica(@Query("searchValue") String searchValue, @Query("chemicalLevel") String chemicalLevel);

    //化学品  品类查询
    @GET("system/dict/item/option")
    Observable<CommonListResponse<ChemicalTypeBean>> getOptions(@Query("dictCode") String dictCode);

    //厂家搜索
    @GET("chemical/aio/searchProducer")
    Observable<CommonListResponse<SearchBean>> searchProducer();

    //根据规格 查询 包装值
    @GET("chemical/aio/searchSpec")
    Observable<CommonDataResponse<SearchSpecBean>> searchSpec(@Query("specNum") String specNum);

    //通过名字or工号 查询课题组 信息 system/user/select
    @POST("system/user/select")
    Observable<CommonListResponse<BelongingPersonBean>> getSelects(@Body RequestBody requestBody);

    //查询归属课题信息
//    @POST("system/topic/topicList")
    @GET("system/topic/getTopicByUserId")
    Observable<CommonListResponse<TopicDataBean>> getTopicList(@Query("userId") String userId);

    @GET("chemical/aio/getCabinetList")
    Observable<CommonListResponse<RuleBean>> getCabinetList(@Query("subId") String subId);

    @GET("auth/scanCode")
    Observable<CommonDataResponse<UserData>> getScanCode(@Query("macId") String macId, @Query("code") String code, @Query("subjectId") String subId);

    @POST("chemical/aio/certitude")
    Observable<CommonDataResponse<ChemicalABean>> certitude(@Body ChemicalABean param);

    @POST("chemical/aio/certitude")
    Observable<CommonDataResponse<HxpChemicalVo>> certitude(@Body HxpChemicalVo param);

    @POST("laboratory/subRelInfo/getRelList")
    Observable<CommonListResponse<ChemicalInfoBean>> getRelList(@Body RequestBody requestBody);

    @GET("chemical/aio/verify/getUserIds")
    Observable<CommonListResponse> getUserIds(@Query("subId") String subId);

    @GET("chemical/aio/getCabinetBySubId")
    Observable<CommonListResponse<RuleBean>> getCabinetBySubId(@Query("subId") String subId);

    @POST("chemical/aio/addStock")
    Observable<CommonDataResponse<Boolean>> stockWaitAdd(@Body RequestBody requestBody);

    //校验当前数据是否合法
    @POST("chemical/aio/addStockCheck")
    Observable<CommonDataResponse<Boolean>> addStockCheck(@Body RequestBody requestBody);

    @GET("chemical/aio/getStockWaitDetails")
    Observable<CommonDataResponse<UnifiedVerBean>> getStockWaitDetails(@Query("waitId") String waitId);

    @POST("chemical/aio/waitList")
    Observable<CommonDataResponse<PageHxpStockBean>> waitList(@Body RequestBody requestBody);

    //领用列表查询
    @POST("chemical/aio/stockList")
    Observable<CommonDataResponse<HxpStockWaitModeBean>> getStockList(@Body RequestBody requestBody);

    //通过rfid-tagcode码 查询当前需要领用得信息
    @GET("chemical/aio/byRfid")
    Observable<CommonDataResponse<UseBean>> getByRfid(@Query("rfidCode") String rfidCode);

    @GET("chemical/aio/indexDetailbyRfid")
    Observable<CommonDataResponse<UseNoBean>> indexDetailbyRfid(@Query("rfidCode") String rfidCode);

    @GET("chemical/aio/getStockDetailsByCode")
    Observable<CommonDataResponse<UseNoTwoBean>> getStockDetailsByCode(@Query("rfidCode") String rfidCode);

    @POST("chemical/aio/addUserecord")
    Observable<CommonDataResponse<String>> addUseRecord(@Body RequestBody requestBody);

    //归还列表查询
    @POST("chemical/aio/useList")
    Observable<CommonDataResponse<ReturningChemicalsBean>> useList(@Body RequestBody requestBody);

    //更换rfid
    @POST("chemical/aio/updateRfid")
    Observable<CommonDataResponse<String>> updateRfid(@Body RequestBody requestBody);

    //归还化学品信息详情
    @GET("chemical/aio/backDetail")
    Observable<CommonDataResponse<ReturnDetailsBean>> backDetail(@Query("rfidCode") String rfidCode);

    @GET("chemical/stockWait/scanCodeChemical")
    Observable<CommonDataResponse<ChemicalSearchBean>> scanCodeChemical(@Query("label") String label, @Query("subId") String subId);

    //废弃化学品信息详情
    @GET("chemical/aio/discardDetail")
    Observable<CommonDataResponse<ReturnDetailsBean>> discardDetail(@Query("rfidCode") String rfidCode);

    @POST("chemical/aio/giveBack")
    Observable<CommonDataResponse> giveBack(@Body RequestBody requestBody);


    //归还单独调用
    @POST("chemical/aio/giveBack")
    Observable<CommonDataResponse<ReturnGiveBackBean>> returnGiveBack(@Body RequestBody requestBody);

    //废弃列表查询
    @POST("chemical/aio/stockDetailsList")
    Observable<CommonDataResponse<WasteChemicalsBean>> stockDetailsList(@Body RequestBody requestBody);

    @GET("chemical/aio/getCabinetLock")
    Observable<CommonListResponse<LockVoListBean>> getCabinetLock(@Query("doorId") String doorId);

    //查询--查询当前所有化学品库存信息 --
    @POST("chemical/aio/indexStockList")
    Observable<CommonDataResponse<HxpStockWaitModeBean>> indexStockList(@Body RequestBody requestBody);

    //查询--查询当前所有化学品库存信息 --
    @POST("chemical/aio/indexDetailsList")
    Observable<CommonDataResponse<QueryTwoBean>> indexDetailsList(@Body RequestBody requestBody);

    @POST("system/aioUnify/warningNoticeList")
    Observable<CommonDataResponse<EarlyWarningBean>> warningNoticeList(@Body RequestBody requestBody);

    @GET("system/aioUnify/warningNoticeDetail")
    Observable<CommonDataResponse<ProcessedBean>> warningNoticeDetail(@Query("id") String id);

    @POST("system/warningNotice/handleMessage")
    Observable<CommonDataResponse<ProcessedBean>> handleMessage(@Body RequestBody requestBody);

    @GET("system/aioUnify/warningNoticeCount")
    Observable<CommonDataResponse<String>> warningNoticeCount(@Query("subId") String subId);

    //领用使用的双人认证
    @POST("chemical/aio/identity/useValidation")
    Observable<CommonDataResponse<UserValidationBean>> useValidation(@Body RequestBody requestBody);

    @POST("chemical/aio/verify/aioScanLogin")
    Observable<CommonDataResponse<UserValidationBean>> aioScanLogin(@Body RequestBody requestBody);

    @POST("chemical/aio/lockOperate")
    Observable<CommonDataResponse> lockOperate(@Body RequestBody requestBody);

    //业务异常的提醒  开锁后 当页面返回后  调用
    @POST("chemical/aio/outTimeWarn")
    Observable<CommonDataResponse> outTimeWarn(@Body RequestBody requestBody);

    //查询开锁状态
    @GET("chemical/aio/getLockStatus")
    Observable<CommonDataResponse<Boolean>> getLocks(@Query("subId") String subId, @Query("lockNum") String lockNum);

    //获取基础信息  刷卡 人脸  扫码
    @GET("chemical/aio/basicConfig")
    Observable<CommonDataResponse<ConfigBean>> basicConfig(@Query("subId") String subId);

    @POST("chemical/aio/useRecords")
    Observable<CommonDataResponse<UseLedBean>> useRecords(@Body RequestBody requestBody);

    @POST("chemical/aio/stockLedger")
    Observable<CommonDataResponse<InventoryListBean>> stockLedger(@Body RequestBody requestBody);

    @POST("chemical/aio/useReturnList")
    Observable<CommonDataResponse<UseLedBean>> useReturnList(@Body RequestBody requestBody);

    @POST("chemical/aio/tagDetailsList")
    Observable<CommonDataResponse<QueryTwoBean>> tagDetailsList(@Body RequestBody requestBody);

    @GET("chemical/aio/getDetailsById")
    Observable<CommonDataResponse<ReturnDetailsBean>> getDetailsById(@Query("id") String id);

    //列表
    @GET("chemical/aio/msds")
    Observable<CommonDataResponse<MsdsBean>> getMsdsDetails(@Query("searchValue") String id);

    //列表查询单挑
    @GET("chemical/aio/msdsDetails")
    Observable<CommonDataResponse<MsdsListBean>> msdsDetails(@Query("id") String id);

    //化学品基础信息配置  是否打印 是否超重
    @GET("chemical/aio/controlConfig")
    Observable<CommonDataResponse<ChemicalConfsBean>> controlConfigs(@Query("chemicalLevel") int id);

    //化学品基础信息配置  是否打印 是否超重
    @GET("chemical/aio/controlConfig")
    Observable<CommonDataResponse<HxpControlConfig>> getControlConfigs(@Query("chemicalLevel") int id);

    //校验rfid的唯一性
    @GET("chemical/aio/checkRfid")
    Observable<CommonDataResponse<Boolean>> checkRfids(@Query("rfid") String rfid);

    //详情

    /**
     * 退出登录
     */
    @GET("auth/logout")
    Observable<CommonResponse> loginOut();

    @GET("iot/aio/monitor")
    Observable<CommonResponse> monitor(@Query("deviceNo") String deviceNo);

    /**
     * 上传APK更新状态
     *
     * @param state 0:升级失败; 1:升级成功; 2:升级中
     */
    @PUT("laboratory/apkfile/onepcApkUpdate/{id}/{state}")
    Observable<CommonResponse> onepcApkUpdate(@Path("id") String id, @Path("state") String state);

    /**
     * 用户端登录
     */
    @POST("auth/learn/login")
    Observable<CommonDataResponse<LearnLoginVo>> learnLogin(@Body LearnLoginReq param);

//    /**
//     * 退出登录
//     */
//    @POST("auth/learn/loginOut")
//    Observable<CommonResponse> loginOut();

    /**
     * 人脸比对
     */
    @POST("{basePath}/faceApi/compare")
    Observable<CommonDataResponse<String>> faceCompare(@Path("basePath") String basePath, @Body FaceCompareReq param);

    /**
     * 人脸比对  登录使用
     */
    @Multipart
//    @POST("{basePath}/faceApi/newCompare")
    @POST("auth/faceByPic")
    Observable<CommonDataResponse<UserData>> faceNewCompare(@Part MultipartBody.Part filePart, @PartMap Map<String, RequestBody> files);

    /**
     * 人脸比对  人脸认证
     */
    @Multipart
//    @POST("chemical/aio/identity/checkUserFaceByPic")
    @POST("chemical/aio/verify/checkUserFaceByPic")
    Observable<CommonDataResponse<UserValidationBean>> checkUserFaceByPic(@Part MultipartBody.Part filePart, @PartMap Map<String, RequestBody> files);

//    /**
//     * 双人验证 刷卡识别身份权限
//     */
//    @POST("chemical/api/userValidation")
//    Observable<CommonDataResponse<UserValidationVo>> userValidation(@Body UserValidationVo param);

}
