package com.rc.httpcore.client.retrofit;

import com.rc.httpcore.apk.AppInfo;
import com.rc.httpcore.pojo.AccessRecordBeanList;
import com.rc.httpcore.pojo.BannerImageBeanList;
import com.rc.httpcore.pojo.CategoryTreeList;
import com.rc.httpcore.pojo.CertVoList;
import com.rc.httpcore.pojo.ExamCourseVoList;
import com.rc.httpcore.pojo.ExamTopicList;
import com.rc.httpcore.pojo.LearnRecordVoList;
import com.rc.httpcore.pojo.MockLists;
import com.rc.httpcore.pojo.MockTestVoList;
import com.rc.httpcore.pojo.TopicClassifyVoList;
import com.rc.httpcore.vo.CommonDataResponse;
import com.rc.httpcore.vo.CommonListResponse;
import com.rc.httpcore.vo.CommonResponse;
import com.rc.httpcore.vo.request.AccessTokenReq;
import com.rc.httpcore.vo.request.AssessRecordReq;
import com.rc.httpcore.vo.request.ExamAnswerReq;
import com.rc.httpcore.vo.request.ExamLearnReq;
import com.rc.httpcore.vo.request.ExamScoreReq;
import com.rc.httpcore.vo.request.FaceCompareReq;
import com.rc.httpcore.vo.request.HandPaperReq;
import com.rc.httpcore.vo.request.HandPractiseReq;
import com.rc.httpcore.vo.request.LearnLoginReq;
import com.rc.httpcore.vo.request.LearnRecordReq;
import com.rc.httpcore.vo.request.MockAnswerReq;
import com.rc.httpcore.vo.request.PaperQuReq;
import com.rc.httpcore.vo.response.AccessRecordBean;
import com.rc.httpcore.vo.response.AccessTokenResp;
import com.rc.httpcore.vo.response.ApkInfoResp;
import com.rc.httpcore.vo.response.BannerImageBean;
import com.rc.httpcore.vo.response.CategoryTree;
import com.rc.httpcore.vo.response.CertVo;
import com.rc.httpcore.vo.response.ExamCourseVo;
import com.rc.httpcore.vo.response.ExamTopic;
import com.rc.httpcore.vo.response.ExamVerify;
import com.rc.httpcore.vo.response.HandPaperBean;
import com.rc.httpcore.vo.response.HandPractiseBean;
import com.rc.httpcore.vo.response.LearnBonusBean;
import com.rc.httpcore.vo.response.LearnLoginVo;
import com.rc.httpcore.vo.response.LearnRecordVo;
import com.rc.httpcore.vo.response.MockTestVo;
import com.rc.httpcore.vo.response.TopicClassifyVo;
import com.rc.httpcore.vo.response.UserInfo;
import com.rc.httpcore.vo.response.ViolationBean;

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

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface ApiService {

    /**
     * 登录获取token
     */
    @POST("auth/one/login")
    Observable<CommonDataResponse<AccessTokenResp>> authOneLogin(@Body AccessTokenReq param);

    //上报信息 获取当前设备基础信息  不返回token  只用于绑定终端  必须在调用登录api
    @GET("iot/aio/report")
    Observable<CommonDataResponse<AppInfo>> getCheck(@Query("deviceNo") String deviceNum, @Query("code") String type, @Query("version") double version);

    //上报在线 离线
    @GET("iot/aio/monitor")
    Observable<CommonResponse> monitor(@Query("deviceNo") String deviceNo);
    /**
     * 查询APK版本
     */
    @GET("laboratory/apkfile/onepcApkDetail/{id}")
    Observable<CommonDataResponse<ApkInfoResp>> apkVersion(@Path("id") String id);

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

    /**
     * 查询轮播图
     */
//    @GET("laboratory/onemachine/rotation/chart")
    @GET("system/rotationChart/selectList")
//    Observable<CommonDataResponse<BannerImageBeanList>> bannerImages(@Query("hardwareNum") String hardwareNum);
    Observable<CommonListResponse<BannerImageBean>> bannerImages(@Query("hardwareNum") String hardwareNum,@Query("pcType") int pcType);

    /**
     * 人脸比对
     */
    @POST("algorithm/faceApi/compare")
    Observable<CommonDataResponse<String>> faceCompare(@Body FaceCompareReq param);

    /**
     * 人脸比对
     */
    @POST("system/user/face/compare")
    Observable<CommonDataResponse<String>> compare(@Body FaceCompareReq param);


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

    //根据卡号登录
    @GET("auth/cardNum")
    Observable<CommonDataResponse<LearnLoginVo>> cardNum(@Query("cardNum") String cardNum);

    /**
     * 学习一体机 用户端登录
     */
    @POST("auth/learn/getToken")
    Observable<CommonDataResponse<LearnLoginVo>> loginToken(@Body LearnLoginReq param);

    /**
     * 安全学习-学习分类
     */
    @GET("exam/api/category/treeList/{id}")
    Observable<CommonDataResponse<CategoryTreeList>> categoryTreeList(@Path("id") String id);

    /**
     * 安全学习-查询学习资源列表
     */
    @GET("exam/api/course/list")
//    Observable<CommonListResponse<ExamCourseVo>> examCourseList(@QueryMap Map<String, Object> filters);
    Observable<CommonDataResponse<ExamCourseVoList>> examCourseList(@QueryMap Map<String, Object> filters);

    /**
     * 安全学习-获取学习资源详细信息
     */
    @GET("exam/api/course/{id}")
    Observable<CommonDataResponse<ExamCourseVo>> examCourseDetail(@Path("id") String id);

    /**
     * 安全学习-开始学习
     */
    @POST("exam/api/course/learn/start")
    Observable<CommonResponse> examLearnStart(@Body ExamLearnReq param);

    /**
     * 安全学习-完成学习
     */
    @POST("exam/api/course/learn/finish")
    Observable<CommonDataResponse<LearnBonusBean>> examLearnFinish(@Body ExamLearnReq param);

    /**
     * 安全学习-个人学习记录
     */
    @POST("exam/api/course/learn/list")
//    Observable<CommonDataResponse<LearnRecordVo>> examLearnRecord(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Body LearnRecordReq param);
    Observable<CommonDataResponse<LearnRecordVoList>> examLearnRecord(@Body LearnRecordReq param);

    /**
     * 查询题目类型下拉框
     */
    @POST("exam/api/classify/queryOption")
    Observable<CommonDataResponse<TopicClassifyVoList>> classifyQueryOption(@Body Object obj);

    /**
     * 查询模拟列表
     */
    @GET("exam/api/exam/onlineList")
//    Observable<CommonListResponse<MockTestVo>> onlineList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Query("classifyIds") String classifyIds);
//    Observable<CommonListResponse<MockTestVoList>> onlineList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Query("classifyIds") String classifyIds);
    Observable<CommonDataResponse<MockLists>> onlineList(@Query("page") int pageNum, @Query("pageSize") int pageSize, @Query("classifyIds") String classifyIds);

    /**
     * 开始-查询考试前后否需要人脸验证
     *
     * @param examId 非模拟考试模式下都传-1
     */
    @GET("exam/api/exam/start/verify/{type}")
    Observable<CommonDataResponse<ExamVerify>> examStartVerify(@Path("type") String type, @Query("examId") String examId);

    /**
     * 开始考试-创建考卷
     *
     * @param examId 非模拟考试模式下都传-1
     */
    @GET("exam/api/exam/start/{type}")
    Observable<CommonDataResponse<ExamTopic>> examStart(@Path("type") String type, @Query("examId") String examId);

    /**
     * 考试 保存用户答案 一题一交
     */
    @POST("exam/api/exam/fillAnswer")
    Observable<CommonResponse> examFillAnswer(@Body ExamAnswerReq param);

    /**
     * 交卷- 完成考试
     */
    @POST("exam/api/exam/handPaper")
    Observable<CommonDataResponse<HandPaperBean>> examHandPaper(@Body HandPaperReq param);

    /**
     * 个人考试成绩列表查询
     */
    @POST("exam/api/paper/myList")
//    Observable<CommonDataResponse<ExamTopicList>> paperMyList(@Query("page") int pageNum, @Query("pageSize") int pageSize, @Body ExamScoreReq param);
    Observable<CommonDataResponse<ExamTopicList>> paperMyList( @Body ExamScoreReq param);

    /**
     * 个人考试成绩详情查询
     */
    @GET("exam/api/paper/{id}")
    Observable<CommonDataResponse<ExamTopic>> paperDetail(@Path("id") String id);

    /**
     * 考试 查询问题和选项 - 一题一查
     */
    @POST("exam/api/exam/paperDetail")
    Observable<CommonDataResponse<ExamTopic.ElPaperQu>> paperExamQuDetail(@Body PaperQuReq param);

    /**
     * 查询我的证书列表
     */
    @POST("exam/api/queryMyCert")
    Observable<CommonDataResponse<CertVoList>> queryMyCert(@Query("page") int pageNum, @Query("pageSize") int pageSize, @Body Object obj);

    /**
     * 模拟练习-开始练习
     */
    @GET("exam/api/practise/start/{ids}")
    Observable<CommonDataResponse<ExamTopic>> mockTestStart(@Path("ids") String ids);

    /**
     * 练习 查询问题和选项 - 一题一查
     */
    @POST("exam/api/practise/paperDetail")
    Observable<CommonDataResponse<ExamTopic.ElPaperQu>> paperMockQuDetail(@Body PaperQuReq param);

    /**
     * 练习 保存用户答案 - 一题一交
     */
    @POST("exam/api/practise/fillAnswer")
    Observable<CommonResponse> mockAnswer(@Body MockAnswerReq param);

    /**
     * 结束练习
     */
    @POST("exam/api/practise/handPractise")
    Observable<CommonDataResponse<HandPractiseBean>> handPractise(@Body HandPractiseReq param);

    /**
     * 个人中心-用户信息
     */
//    @GET("laboratory/violation/userInfo")
    @GET("exam/api/myViolation")
    Observable<CommonDataResponse<UserInfo>> queryUserInfo();

    /**
     * 个人中心-违规信息
     */
//    @GET("laboratory/violation/historyList")
    @GET("exam/api/violation/historyList")
//    Observable<CommonListResponse<ViolationBean>> queryViolationList(
    Observable<CommonDataResponse<ViolationBean>> queryViolationList(
            @Query("page") int pageNum, @Query("pageSize") int pageSize,
            @Query("statTime") String statTime, @Query("endTime") String endTime,
            @Query("overStatus") String overStatus);

    /**
     * 是否有待处理的违规
     */
//    @GET("laboratory/violation/exist")
    @GET("exam/api/myViolation")
    Observable<CommonDataResponse<UserInfo>> existTodoViolation();

    /**
     * 开始考核-生成考核考卷
     *
     * @param id 章节ID
     */
    @POST("exam/api/assess/start/{id}")
    Observable<CommonDataResponse<ExamTopic>> classTestStart(@Path("id") String id);

    /**
     * 结束考核
     *
     * @param id 考核ID(试卷ID)
     */
    @POST("exam/api/assess/finish/{id}")
    Observable<CommonDataResponse<HandPractiseBean>> handAssess(@Path("id") String id);

    /**
     * 考核记录列表
     *
     */
    @POST("exam/api/assess/list/{id}")
//    Observable<CommonDataResponse<AccessRecordBeanList>> classTestRecord(@Path("id") String id, @Query("page") int pageNum, @Query("pageSize") int pageSize);
    Observable<CommonDataResponse<AccessRecordBeanList>> classTestRecord(@Body AssessRecordReq param);

    /**
     * 考核详情
     *
     * @param id 考核ID(试卷ID)
     */
    @POST("exam/api/assess/detail/{id}")
    Observable<CommonDataResponse<ExamTopic>> classTestDetail(@Path("id") String id);

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

}
