package com.wisewoods.base.net;


import com.wisewoods.base.bean.AreaBean;
import com.wisewoods.base.bean.BankCardBean;
import com.wisewoods.base.bean.BaseInfo;
import com.wisewoods.base.bean.BaseList;
import com.wisewoods.base.bean.Camera;
import com.wisewoods.base.bean.ClassInfo;
import com.wisewoods.base.bean.CosInfo;
import com.wisewoods.base.bean.HotelList;
import com.wisewoods.base.bean.IDCardBean;
import com.wisewoods.base.bean.IMToken;
import com.wisewoods.base.bean.LocationInfo;
import com.wisewoods.base.bean.LoginUser;
import com.wisewoods.base.bean.MettingInfo;
import com.wisewoods.base.bean.MsgCount;
import com.wisewoods.base.bean.MsgList;
import com.wisewoods.base.bean.NationBean;
import com.wisewoods.base.bean.ProjectList;
import com.wisewoods.base.bean.RedisList;
import com.wisewoods.base.bean.ResList;
import com.wisewoods.base.bean.Results;
import com.wisewoods.base.bean.Room;
import com.wisewoods.base.bean.RoomInfo;
import com.wisewoods.base.bean.RoomLiveBean;
import com.wisewoods.base.bean.RoomState;
import com.wisewoods.base.bean.ScheduleData;
import com.wisewoods.base.bean.ScheduleInfo;
import com.wisewoods.base.bean.SleepInfo;
import com.wisewoods.base.bean.StudentList;
import com.wisewoods.base.bean.SysUser;
import com.wisewoods.base.bean.SysUserList;
import com.wisewoods.base.bean.TaskBean;
import com.wisewoods.base.bean.TaskList;
import com.wisewoods.base.bean.TeacherCourseList;
import com.wisewoods.base.bean.TeacherInfo;
import com.wisewoods.base.bean.TencentHostInfo;
import com.wisewoods.base.bean.TreePeopleBean;
import com.wisewoods.base.bean.UnitInfo;
import com.wisewoods.base.bean.UserToken;
import com.wisewoods.base.bean.VersionInfo;
import com.wisewoods.base.bean.VoteInfo;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiService {

    String SERVER = "https://edu.jlccta.com/";  //正式环境
//        String SERVER = "https://edutest.jlccta.com/";  //测试环境
//        String SERVER = "http://10.16.4.8/";  //测试环境
    String PROJECT = "prod-api/";
//        String PROJECT = "dev-api/";
    String APPID = "2";

    String HELP_ADDRESS = SERVER + "wx_html/appInfoList.html?" + APPID;
    String KEYNOTE_ADDRESS = SERVER + "wx_html/hostSpeech.html?";

    //   登录
    @POST("auth/manage/login")
    Call<UserToken> login(@Body RequestBody requestBody);


    //   登录获取TRTC用户签名
    @GET("video/sign/genUserSig")
    Call<IMToken> genUserSig(@Query("userId") String userId);

    // 获取教室
    @GET("video/room/{id}")
    Call<Room> getRoom(@Path("id") String id);

    // 获取摄像头详细信息
    @GET("video/camera/{id}")
    Call<Camera> getCamera(@Path("id") String id);


    // 开始录制
    @GET("education/schedulePerformance/startRecord")
    Call<Results> startRecord(@Query("scheduleIdStr") String scheduleIdStr);

    // 获取摄像头token
    @GET("video/camera/takeToken")
    Call<UserToken> getCameraToken();

    // 获取摄像头指令开始
    @GET("video/camera/deviceStart")
    Call<Results> deviceStart(@Query("token") String token,
                              @Query("cameraCode") String cameraCode,
                              @Query("direction") String direction);

    // 获取摄像头指令结束
    @GET("video/camera/deviceStop")
    Call<Results> deviceStop(@Query("token") String token,
                             @Query("cameraCode") String cameraCode,
                             @Query("direction") String direction);

    // 获取人名
    @GET("system/user/{id}")
    Call<SysUser> getUser(@Path("id") String id);

    //   登录获取COS签名
    @GET("video/upload/getCosInfo")
    Call<CosInfo> getCosInfo();

    //   登录当前用户信息
    @GET("system/user/getInfo")
    Call<LoginUser> getInfo();

    //修改密码
    @PUT("system/user/selfPwd")
    Call<Results> resetPwd(@Query("oldPwd") String oldpwd, @Query("newPwd") String newpwd);

    //修改个人信息
    @POST("system/user/selfUpdate")
    Call<Results> selfUpdate(@Query("avatar") String avatar, @Query("nickName") String nickName);

    //获取app版本信息
    @GET("education/manage/app/appInfo/{id}")
    Call<VersionInfo> getAppInfo(@Path("id") String id);

    //通知
    @GET("management/manage/app/messageLog/list")
    Call<MsgList> getMessageLog(@Query("pageNum") long pageNum,
                                @Query("pageSize") long pageSize);


    //查看 待办数/全部待办数/通知数
    @GET("management/manage/app/messageLog/queryMessageCount")
    Call<MsgCount> queryMessageCount();

    //查看 教师当前课程数/全部课程数
    @GET("education/manage/app/schedulePerformance/selectSchedulePerformanceListByTeacherId")
    Call<MsgCount> queryTeacherInfoCount(@Query("teacherId") String teacherId);

    //查看宿舍占用情况
    @GET("education/manage/app/hotelArrange/queryEmptyRoom")
    Call<RoomState> queryEmptyRoom(@Query("hotelId") String hotelId,
                                   @Query("startDate") String startDate,
                                   @Query("endDate") String endDate
    );

    //待办
    @GET("management/manage/app/agencyTask/queryAppAgencyTasks")
    Call<TaskList> queryAppAgencyTasks(
            @Query("startDate") String startDate,
            @Query("endDate") String endDate,
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );

    //已完成
    @GET("management/manage/app/agencyTask/queryCompleteTasks")
    Call<TaskList> queryCompleteTasks(
            @Query("startDate") String startDate,
            @Query("endDate") String endDate,
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );


    //获取腾讯会议列表 未开始和进行中
//    @GET("management/manage/app/tencentMeetings/list")
    @GET("management/manage/app/tencentMeetings/selectMeetingsStartedList")
    Call<MettingInfo> selectMeetingsStartedList(
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );

    // 获取历史会议
    @GET("management/manage/app/tencentMeetings/selectMeetingsEndList")
    Call<MettingInfo> selectMeetingsEndList(
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );

    // 创建会议
    @PUT("management/manage/app/tencentMeetings/add")
    Call<Results> addMeeting(@Body RequestBody requestBody);


    //待办任务 提交
    @PUT("management/manage/app/agencyTask")
    Call<Results> handleTask(@Body RequestBody requestBody);

    //任务安排详情
    @GET("management/manage/app/agencyTask/{id}")
    Call<TaskBean> getTask(@Path("id") String id);

    //查看当前老师的师资审核
    @GET("resource/manage/app/teacher/{id}")
    Call<TeacherInfo> getTeacher(@Path("id") String id);

    //提交师资审核
    @POST("resource/manage/app/teacher")
    Call<Results> putTeacher(@Body RequestBody requestBody);

    //消息已读
    @PUT("management/manage/app/messageLog")
    Call<Results> messageLog(@Body RequestBody requestBody);

    //获取项目信息
    @GET("education/manage/app/item/selOrganizerItemList/{status}")
    //0主办  1承办
    Call<ProjectList> getProject1(@Path("status") String status,
                                  @Query("pageNum") long pageNum,
                                  @Query("pageSize") long pageSize);

    //教务部门
    @GET("education/manage/app/item/lists")
    Call<ProjectList> getProject2(@Query("pageNum") long pageNum,
                                  @Query("pageSize") long pageSize);

    //教务部门
    @GET("education/manage/app/item/selDirectorTeamList")
    Call<ProjectList> getProject3(@Query("pageNum") long pageNum,
                                  @Query("pageSize") long pageSize);


    //获取宿舍楼栋
    @GET("resource/manage/app/dormitoryHotel/list")
    Call<HotelList> getHotel(@Query("ids") String ids);


    //根据用户查询他名下所有基地
    @GET("resource/manage/app/library/selectBaseLibraryListByStuId")
    Call<BaseList> selectBaseLibraryListByStuId();

    //基地详情
    @GET("resource/manage/app/library/{id}")
    Call<BaseInfo> getBaseInfo(@Path("id") String id);

    //修改基地
    @PUT("resource/manage/app/library")
    Call<Results> changeBaseInfo(@Body RequestBody requestBody);


    //地区 四级
    @GET("system/manage/app/home/region/list")
    Call<AreaBean> getLocation(@Query("parentId") String parentId);

//    //地区 第一级
//    @GET("system/manage/app/home/region/list")
//    Call<LocationInfo> getLocation();

    //地区 最后一级
    @GET("system/manage/app/home/unit/list")
    Call<AreaBean> getUnit(@Query("parentId") String parentId);

    //获取资源归档目录
    @GET("education/manage/app/studentFiling/list")
    Call<ResList> getResInfo(@Query("teamId") String teamId, @Query("pid") String pid);

    //新增 文件或者目录
    @POST("education/manage/app/studentFiling")
    Call<Results> addFileOrDir(@Body RequestBody requestBody);

    //删除文件或者目录
    @DELETE("education/manage/app/studentFiling/{id}")
    Call<Results> deleteFileOrDir(@Path("id") String id);

    //学员请假
    @POST("education/manager/app/leave/add")
    Call<Results> studentLeave(@Body RequestBody requestBody);


    //教室统计
    @GET("education/manage/app/courseSchedule/roomList")
    Call<RoomInfo> getRoomList(@Query("courseStart") String courseStart);


    //获取系统用户 院内参会人员
    @GET("system/manage/app/user/list")
    Call<SysUserList> getSystemUser(
//            @Query("pageNum") long pageNum,
//            @Query("pageSize") long pageSize
    );

    //获取树形人员
    @GET("system/dept/treeDeptUser")
    Call<TreePeopleBean> getSystemTreeUser(
//            @Query("pageNum") long pageNum,
//            @Query("pageSize") long pageSize
    );

    //获取主持人列表
    @GET("management/manage/app/tencentHost/list")
    Call<TencentHostInfo> getTencentHost();

    //获取投票结果
    @GET("management/manage/app/meetingVote/list")
    Call<VoteInfo> getVote(@Query("meetingId") String meetingId);

    //取消会议
    @GET("management/manage/app/tencentMeetings/meetingCanceled/{id}")
    Call<Results> cancelMetting(@Path("id") String id);

    //班级列表
    @GET("education/manage/app/item/selTeamListById")
    Call<ClassInfo> getClassList(@Query("id") String id,
                                 @Query("pageNum") long pageNum,
                                 @Query("pageSize") long pageSize

    );

    //班级列表
    @GET("video/app/record/list")
    Call<RoomLiveBean> getRoomLiveList(@Query("liveStatus") int liveStatus,
                                       @Query("pageNum") long pageNum,
                                       @Query("pageSize") long pageSize

    );

    //学员列表
    @GET("education/manager/app/student/list")
    Call<StudentList> getStudentList(@Query("teamId") String teamId,
                                     @Query("name") String name,
                                     @Query("isReport") String isReport,
                                     @Query("pageNum") long pageNum,
                                     @Query("pageSize") long pageSize);

    //住宿列表
    @GET("education/manage/app/hotelArrange/queryArrangeRoom")
    Call<SleepInfo> queryArrangeRoom(@Query("userId") String userId,
                                     @Query("pageNum") long pageNum,
                                     @Query("pageSize") long pageSize);


    //查询老师课表
    @GET("education/manage/app/schedulePerformance/selectSchedulePerformanceListByNowOrHistory")
    Call<Results> getCourseByTeacher(@Query("userId") String userId,
                                     @Query("pageNum") long pageNum,
                                     @Query("pageSize") long pageSize);


    //老师提交的课程审核列表
    @GET("resource/manage/app/course/list")
    Call<TeacherCourseList> getTeacherCourseList(
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );

    @POST("resource/manage/app/course")
    Call<Results> addCourse(@Body RequestBody requestBody);

    @PUT("education/manage/app/team/edit")
    Call<Results> openTeam(@Body RequestBody requestBody);

    //字典
    @GET("system/dict/data/type/{type}")
    Call<NationBean> getDict(@Path("type") String type);

    //日程列表
    @GET("education/manage/app/schedulePerformance/list")
    Call<ScheduleInfo> getScheduleList(@Query("teamId") String teamId,
                                       @Query("courseStart") String courseStart,
                                       @Query("pageNum") long pageNum,
                                       @Query("pageSize") long pageSize
    );

    //上下课
    @GET("education/manage/app/schedulePerformance/updateCourseStartEnd")
    Call<Results> updateCourseStartEnd(@Query("scheduleId") String scheduleId,
                                       @Query("courseStatus") String courseStatus
    );

    //老师当前课程列表
    @GET("education/manage/app/schedulePerformance/selectSchedulePerformanceListByNowOrHistory")
    Call<ScheduleInfo> getTeacherScheduleList(@Query("notCourseStatus") String notCourseStatus,
                                              @Query("dateNow") String dateNow,
                                              @Query("pageNum") long pageNum,
                                              @Query("pageSize") long pageSize
    );

    //老师历史课程列表
    @GET("education/manage/app/schedulePerformance/selectSchedulePerformanceListByNowOrHistory")
    Call<ScheduleInfo> getTeacherHistoryScheduleList(@Query("courseStatus") String courseStatus,
                                                     @Query("dateNow") String dateNow,
                                                     @Query("pageNum") long pageNum,
                                                     @Query("pageSize") long pageSize
    );

    //课程详情
    @GET("education/manage/app/schedulePerformance/selectCourseDetailsByScheduleId")
    Call<ScheduleData> getScheduleInfo(@Query("scheduleId") String scheduleId);

    //课程下的学员列表
    @GET("education/manage/app/schedulePerformance/selectStuListByScheduleId")
    Call<StudentList> getScheduleStudent(
            @Query("scheduleId") String scheduleId,
            @Query("studentName") String studentName,
            @Query("signInStatus") String signInStatus,
            @Query("isOnline") String isOnline,
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );


    //直播列表
    @GET("education/manage/app/schedulePerformance/selectLiveCourseList")
    Call<ScheduleInfo> selectLiveCourseList(
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );

    //开始 结束直播
    @GET("education/schedulePerformance/updateLiveStartEnd")
    Call<Results> updateLiveStartEnd(
            @Query("scheduleIdStr") String scheduleIdStr,
            @Query("liveStatus") int liveStatus
    );

    //获取成员列表
    // listKey：
    //teacherMap 教师Map
    //studentMap 学员Map
    //guestMap 游客Map
    @GET("video/AVChatRoom/getRedisCacheList")
    Call<RedisList> getRedisCacheList(
            @Query("scheduleIdStr") String scheduleIdStr,
            @Query("listKey") String listKey,
            @Query("pageNum") long pageNum,
            @Query("pageSize") long pageSize
    );

    //禁言 86400
    @GET("video/AVChatRoom/modifyGroupMemberInfo")
    Call<RedisList> modifyGroupMemberInfo(
            @Query("groupId") String groupId,
            @Query("userId") String userId,
            @Query("ShutUpTime") long ShutUpTime
    );

    //全体禁言 speechSwitch='On' speechSwitch='Off';
    @GET("video/AVChatRoom/modifyGroupBaseInfo")
    Call<RedisList> modifyGroupBaseInfo(
            @Query("groupId") String groupId,
            @Query("speechSwitch") String speechSwitch
    );

    // 识别身份证
    @Multipart
    @POST("video/TencentOCR/idCard")
    Call<IDCardBean> idCardOCR(@Part MultipartBody.Part body);


    // 识别银行卡
    @Multipart
    @POST("video/TencentOCR/bankCard")
    Call<BankCardBean> bankCardOCR(@Part MultipartBody.Part body);


}
