package http.client.retrofit;

import java.util.List;
import java.util.Map;

import http.vo.CommonDataResponse;
import http.vo.CommonResponse;
import http.vo.CommonRowsResponse;
import http.vo.request.AuthFaceReq;
import http.vo.request.BannerImageReq;
import http.vo.request.FaceCompareReq;
import http.vo.request.LotDeviceReq;
import http.vo.request.MonitorReq;
import http.vo.request.NoticeReq;
import http.vo.request.OnLineUserReq;
import http.vo.request.PatrolSignInReq;
import http.vo.request.SafetyListReq;
import http.vo.request.SignInReq;
import http.vo.request.SubIdReq;
import http.vo.request.TerminalAuthReq;
import http.vo.response.ApkInfoResp;
import http.vo.response.BannerImageBean;
import http.vo.response.CheckMachineVo;
import http.vo.response.DutyPersonVo;
import http.vo.response.HazardBook;
import http.vo.response.HomeMiddleResp;
import http.vo.response.HomeRightResp;
import http.vo.response.HomeTopResp;
import http.vo.response.LabBulletinBoardVo;
import http.vo.response.LabHazardVo;
import http.vo.response.LabPersonVo;
import http.vo.response.LabWarnVo;
import http.vo.response.LaboratoryVo;
import http.vo.response.LotDeviceVo;
import http.vo.response.MonitorVo;
import http.vo.response.RecordsResponse;
import http.vo.response.SafeBook;
import http.vo.response.SignInCheckResp;
import http.vo.response.SpeakInfo;
import http.vo.response.UserFingerVo;
import http.vo.response.UserVo;
import io.reactivex.rxjava3.core.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import xn.xxp.room.bean.LabConfig;
import xn.xxp.room.bean.NoticeSummary;

public interface ApiService {

    /**
     * ZD-A002: 查询APK版本
     * <p>
     * code: aio_infobord/aio_manager
     * deviceNo:
     * version:
     */
    @GET("iot/aio/report")
    Observable<CommonDataResponse<ApkInfoResp>> apkVersion(@QueryMap Map<String, String> filters);

    /**
     * ZD-A004: 实验室信息
     */
    @GET("terminal/lab/onemachine/{id}")
    Observable<CommonDataResponse<LaboratoryVo>> laboratoryInfo(@Path("id") String id);

    /**
     * ZD-A005: 危险源信息
     */
    @GET("terminal/lab/onemachine/{subId}/Hazard/list")
    Observable<CommonDataResponse<List<LabHazardVo>>> hazardlist(@Path("subId") String subId, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);

    /**
     * ZD-A006: 签到验证（进入）
     */
    @GET("terminal/lab/onemachine/{subId}/SignInCheck/{username}")
    Observable<CommonDataResponse<SignInCheckResp>> signInCheck(@Path("subId") String subId, @Path("username") String username);

    /**
     * ZD-A007: 签到验证（进入）
     */
    @GET("terminal/lab/onemachine/{subId}/SignInXxpCheck/{userId}")
    Observable<CommonDataResponse<SignInCheckResp>> signInXxpCheck(@Path("subId") String subId, @Path("userId") String userId);

    /**
     * ZD-A008: 签到提交-人脸验证
     */
    @POST("terminal/lab/onemachine/{code}/SignIn2")
    Observable<CommonDataResponse<String>> signInFace(@Path("code") String code, @Body SignInReq data);

    /**
     * ZD-A009: 签到-安全准入检测三合一
     */
    @Multipart
    @POST("terminal/lab/signIn/check/checkInAll")
    Observable<CommonDataResponse<String>> checkInAll(@PartMap Map<String, RequestBody> params, @Part MultipartBody.Part file);

    /**
     * ZD-A010: 签到-安全准入检测三合一
     */
    @Multipart
    @POST("terminal/lab/signIn/check/checkInXxpAll")
    Observable<CommonDataResponse<String>> checkInXxpAll(@PartMap Map<String, RequestBody> params, @Part MultipartBody.Part file);

    /**
     * ZD-A010: 签到-安全准入检测三合一
     */
    @Multipart
    @POST("terminal/lab/signIn/check/checkInXxpAll")
    Observable<CommonDataResponse<String>> checkInXxpNewAll(@QueryMap Map<String, String> params, @Part MultipartBody.Part file);

    /**
     * ZD-A011: 签到提交
     */
    @POST("terminal/lab/onemachine/{id}/SignIn/commit")
    Observable<CommonResponse> signIn(@Path("id") String id);

    /**
     * ZD-A012: 签到提交-有跳过安全准入检测时使用
     */
    @POST("terminal/lab/checklog/{id}/jump/{code}")
    Observable<CommonResponse> signInJump(@Path("id") String id, @Path("code") String code);

    /**
     * ZD-A013: 签到验证（离开）
     */
    @GET("terminal/lab/onemachine/{subId}/SignOutCheck/{username}")
    Observable<CommonDataResponse<SignInCheckResp>> signOutCheck(@Path("subId") String subId, @Path("username") String username);

    /**
     * ZD-A014: 签到验证（离开）
     */
    @GET("terminal/lab/onemachine/{subId}/SignOutXXpCheck/{userId}")
    Observable<CommonDataResponse<SignInCheckResp>> signOutXXpCheck(@Path("subId") String subId, @Path("userId") String userId);

    /**
     * ZD-A015: 离开提交
     */
    @POST("terminal/lab/onemachine/{code}/SignOut")
    Observable<CommonResponse> signOut(@Path("code") String code);

    /**
     * ZD-A016: 获取实验室一体机可控制设备
     */
    @POST("terminal/iot/onemachine/controller/list")
    Observable<CommonDataResponse<List<LotDeviceVo>>> controllerList(@Body LotDeviceReq param);

    /**
     * ZD-A017: 控制设备
     */
    @POST("terminal/iot/controlDevice/{id}/{command}")
    Observable<CommonResponse> sendControllerCMD(@Path("id") String id, @Path("command") String command);

    /**
     * ZD-A018: 实验室测点功能列表（首页-左侧看板）
     */
    @GET("terminal/iot/onemachine/{subId}/function/list")
    Observable<CommonDataResponse<List<LabBulletinBoardVo>>> functionList(@Path("subId") String subId);

    /**
     * ZD-A019: 实验室预警测点
     */
    @POST("terminal/lab/onemachine/{subId}/noAuthWarn")
    Observable<CommonDataResponse<List<LabWarnVo>>> warnList(@Path("subId") String subId);

    /**
     * ZD-A020: 人脸比对
     */
    @POST("terminal/sys/user/face/compare")
    Observable<CommonResponse> faceCompare(@Body FaceCompareReq param);

    /**
     * ZD-A021: 心跳
     */
    @GET("terminal/iot/monitor")
    Observable<CommonResponse> heartbeat(@Query("deviceNo") String deviceNo);

    /**
     * ZD-A022: 查询实验室安全制度列表
     */
    @POST("terminal/lab/safeBook/queryOptionList")
    Observable<CommonDataResponse<List<SafeBook>>> safeBookList(@Query("type") String type);

    /**
     * ZD-A023: 获取实验室安全制度详细信息
     */
    @GET("terminal/lab/safeBook/info/{id}")
    Observable<CommonDataResponse<SafeBook>> safeBookDetail(@Path("id") String id);

    /**
     * ZD-A024: 一体机查询危化品
     */
    @GET("chemical/aio/msds")
    Observable<CommonDataResponse<RecordsResponse<HazardBook>>> hazardBookList();

    /**
     * ZD-A025: 获取危化品安全技术说明书详细信息
     */
    @GET("chemical/aio/msdsDetails")
    Observable<CommonDataResponse<HazardBook>> hazardBookDetail(@Query("id") String id);

    /**
     * ZD-A026: 查询实验室在线人员
     */
    @POST("terminal/lab/sub/online/user")
    Observable<CommonRowsResponse<LabPersonVo>> onlineUser(@Body OnLineUserReq param);

    /**
     * ZD-A027: 实验室安全整改信息
     */
    @POST("terminal/lab/aioUnify/warningNoticeList")
    Observable<CommonDataResponse<RecordsResponse<CheckMachineVo>>> checkMachineMsgList(@Body SubIdReq param);

    /**
     * ZD-A029: 实验室文化图
     */
    @POST("terminal/lab/aioUnify/rotationList")
    Observable<CommonDataResponse<List<BannerImageBean>>> bannerImages(@Body BannerImageReq param);

    /**
     * ZD-A030: 文字转语音
     */
    @GET("terminal/iot/textParseVoiceUrl")
    Observable<CommonDataResponse<SpeakInfo>> textParseVideo(@Query("speed") String speed, @Query("volume") String volume, @Query("text") String text);

    /**
     * ZD-A031: 物联控制权限验证
     */
    @GET("terminal/lab/{subId}/LotInCheck/{username}")
    Observable<CommonDataResponse<String>> lotInCheck(@Path("subId") String subId, @Path("username") String username);

    /**
     * ZD-A032: 查询实验室配置
     */
    @GET("terminal/lab/getSubjectIdByNum/{deviceNum}")
    Observable<CommonDataResponse<LabConfig>> queryLabConfig(@Path("deviceNum") String deviceNum);

    /**
     * ZD-A033: 查询首页头部信息
     */
    @GET("terminal/lab/topInfo")
    Observable<CommonDataResponse<HomeTopResp>> homeTopInfo(@Query("labId") String labId);

    /**
     * ZD-A034: 查询首页中部信息
     */
    @GET("terminal/lab/middleInfo")
    Observable<CommonDataResponse<HomeMiddleResp>> homeMiddleInfo(@Query("labId") String labId);

    /**
     * ZD-A035: 查询首页右侧人员信息
     */
    @GET("terminal/lab/rightInfo")
    Observable<CommonDataResponse<HomeRightResp>> homeRightInfo(@Query("labId") String labId);

    /**
     * ZD-A036: 实验室介绍
     */
    @GET("terminal/lab/labIntro")
    Observable<CommonDataResponse<String>> labIntro(@Query("labId") String labId);

    /**
     * ZD-A037: 查询值班人员列表
     */
    @GET("terminal/lab/dutyUserList")
    Observable<CommonDataResponse<DutyPersonVo>> dutyUserList(@Query("labId") String labId, @Query("startTime") String startTime);

    /**
     * ZD-A038: 查询实验人员列表
     */
    @GET("terminal/lab/signUserList")
    Observable<CommonDataResponse<List<LabPersonVo>>> signUserList(@Query("labId") String labId);

    /**
     * ZD-A039: 查询准入人员列表
     */
    @GET("terminal/lab/securityUserList")
    Observable<CommonDataResponse<List<LabPersonVo>>> securityUserList(@Query("labId") String labId, @Query("pageNumber") int pageNumber, @Query("pageSize") int pageSize);

    /**
     * ZD-A040: 查询巡查人员列表
     */
    @GET("terminal/lab/inspectUserList")
    Observable<CommonDataResponse<DutyPersonVo>> inspectUserList(@Query("labId") String labId, @Query("startTime") String startTime);

    /**
     * ZD-A041: 视频监控
     */
    @POST("terminal/iot/findByCondition")
    Observable<CommonDataResponse<RecordsResponse<MonitorVo>>> cameraBySubjectId(@Body MonitorReq param);

    /**
     * ZD-A042: 获取准入人员的指纹信息列表
     */
    @GET("terminal/lab/getFingerList")
    Observable<CommonDataResponse<List<UserFingerVo>>> getFingerList(@Query("labId") String labId);

    /**
     * ZD-A043: 根据用户查询指纹列表
     */
    @GET("terminal/lab/getFingerByUserId")
    Observable<CommonDataResponse<List<UserFingerVo>>> getFingerByUserId(@Query("labId") String labId,
                                                                         @Query("userId") String userId);

    /**
     * ZD-A044: 指纹录入
     */
    @POST("terminal/lab/addUserFinger")
    Observable<CommonResponse> addUserFinger(@Body UserFingerVo param);

    /**
     * ZD-A045: 删除指纹
     */
    @GET("terminal/lab/deleteFingerById")
    Observable<CommonResponse> deleteFingerById(@Query("id") String id);

    /**
     * ZD-A046: 获取人像特征值
     */
    @Multipart
    @POST("terminal/sys/faceFeature")
    Observable<CommonDataResponse<String>> faceFeature(@Part MultipartBody.Part filePart);

    /**
     * ZD-A047: 人脸识别
     */
    @POST("terminal/lab/multiFaceDetection")
    Observable<CommonDataResponse<UserVo>> multiFaceDetection(@Body AuthFaceReq param);

    /**
     * ZD-A048: 刷卡验证
     */
    @GET("terminal/lab/cardValidate")
    Observable<CommonDataResponse<UserVo>> cardValidate(@Query("labId") String labId,
                                                        @Query("cardNum") String cardNum);

    /**
     * ZD-A049: 密码验证
     */
    @GET("terminal/lab/pwdValidate")
    Observable<CommonDataResponse<UserVo>> pwdValidate(@Query("num") String num,
                                                       @Query("labId") String labId,
                                                       @Query("userId") String userId,
                                                       @Query("pwd") String pwd);

    /**
     * ZD-A050: 校园卡是否能开启门禁
     */
    @GET("terminal/lab/getCardIsOpen")
    Observable<CommonDataResponse<UserVo>> getCardIsOpen(@Query("labId") String labId,
                                                         @Query("cardNum") String cardNum);

    /**
     * ZD-A051: 巡查签到
     */
    @POST("terminal/lab/XxpInspection/addInspection/signIn")
    Observable<CommonResponse> signInWithPatrol(@Body PatrolSignInReq param);

    /**
     * ZD-A052: 巡查签退
     */
    @FormUrlEncoded
    @POST("terminal/lab/XxpInspection/addInspection/signOut")
    Observable<CommonResponse> signOutWithPatrol(@Field("labId") String labId,
                                                 @Field("userId") String userId);

    /**
     * ZD-A053: 巡查签退/准入签退判断
     * 1-巡查 2-准入
     */
    @FormUrlEncoded
    @POST("terminal/lab/XxpInspection/isSignInType")
    Observable<CommonDataResponse<String>> isSignInType(@Field("labId") String labId,
                                                        @Field("userId") String userId);

    /**
     * ZD-A054: 巡查签到前置校验
     */
    @FormUrlEncoded
    @POST("terminal/lab/XxpInspection/isSignInspection")
    Observable<CommonResponse> signInCheckWithPatrol(@Field("labId") String labId,
                                                     @Field("userId") String userId);

    /**
     * ZD-A055: 滚动消息列表
     */
    @POST("terminal/sys/notice/list")
    Observable<CommonDataResponse<RecordsResponse<NoticeSummary>>> newMsgGroup(@Body NoticeReq param);

    /**
     * 鉴权
     */
    @POST("terminal/authorize")
    Observable<CommonDataResponse<String>> terminalAuth(@Body TerminalAuthReq param);

}
