package com.cooleshow.teacher.api;

import com.common.im.bean.ContactRoomListBean;
import com.cooleshow.base.data.net.BaseResponse;
import com.cooleshow.teacher.bean.HomeLiveAndVideoBean;
import com.cooleshow.teacher.bean.HomeMenuBean;
import com.cooleshow.teacher.bean.LiveListBean;
import com.cooleshow.teacher.bean.LivePlayBackDataBean;
import com.cooleshow.teacher.bean.TeacherPromoteIncomeBean;
import com.cooleshow.teacher.bean.request.AssignHomeWorkEntry;
import com.cooleshow.teacher.bean.request.CommentHomeWorkEntry;
import com.cooleshow.teacher.bean.request.LiveCourseEntry;
import com.cooleshow.teacher.bean.AccountDetailBean;
import com.cooleshow.teacher.bean.AccountTotalBean;
import com.cooleshow.base.bean.AddressBean;
import com.cooleshow.teacher.bean.CountOfUnreadBean;
import com.cooleshow.teacher.bean.CourseCommentListBean;
import com.cooleshow.teacher.bean.CourseTableDataBean;
import com.cooleshow.teacher.bean.HelpCenterContentBean;
import com.cooleshow.teacher.bean.HomeCountBean;
import com.cooleshow.teacher.bean.HomePageSheetMusicListBean;
import com.cooleshow.teacher.bean.HomeworkListBean;
import com.cooleshow.teacher.bean.LiveCourseListBean;
import com.cooleshow.teacher.bean.LiveRoomInfoBean;
import com.cooleshow.teacher.bean.MineLiveCourseListBean;
import com.cooleshow.teacher.bean.MineVideoCourseListBean;
import com.cooleshow.teacher.bean.MusicSheetListBean;
import com.cooleshow.teacher.bean.MusicSheetShareBean;
import com.cooleshow.teacher.bean.PayTestBean;
import com.cooleshow.teacher.bean.PianoRoomCourseCommentBean;
import com.cooleshow.teacher.bean.PianoRoomCourseHomeworkBean;
import com.cooleshow.teacher.bean.PianoRoomCourseInfoBean;
import com.cooleshow.teacher.bean.PianoRoomCourseListBean;
import com.cooleshow.teacher.bean.QuerySubjectBean;
import com.cooleshow.teacher.bean.ReceivedCommentListBean;
import com.cooleshow.teacher.bean.ResponseBankCardBean;
import com.cooleshow.teacher.bean.ResponseBindCardBean;
import com.cooleshow.teacher.bean.ResponseUserBankCardBean;
import com.cooleshow.teacher.bean.SparringCourseCommentBean;
import com.cooleshow.teacher.bean.SparringCourseHomeworkBean;
import com.cooleshow.teacher.bean.SparringCourseListBean;
import com.cooleshow.teacher.bean.SystemMessageBean;
import com.cooleshow.teacher.bean.TeachableInstrumentBean;
import com.cooleshow.teacher.bean.TeacherSelfStyleInfoBean;
import com.cooleshow.teacher.bean.TeacherUserInfo;
import com.cooleshow.teacher.bean.UserAccountBean;
import com.cooleshow.teacher.bean.VideoCourseListBean;
import com.cooleshow.teacher.bean.WithdrawalInfoBean;
import com.cooleshow.teacher.bean.WithdrawalRecordBean;
import com.cooleshow.teacher.bean.request.QueryGroupListEntry;
import com.cooleshow.teacher.bean.request.SheetMusicEntry;
import com.cooleshow.teacher.bean.request.TeacherPracticeCourseEntry;
import com.cooleshow.teacher.bean.request.UnBindCardEntry;
import com.cooleshow.usercenter.bean.SetDetailBean;
import com.cooleshow.usercenter.bean.UserInfo;

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

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

import static com.cooleshow.base.common.BaseConstant.AUTH_GROUP;
import static com.cooleshow.base.common.BaseConstant.CMS_SERVER;
import static com.cooleshow.base.common.BaseConstant.MALL_PORTAL_SERVER;
import static com.cooleshow.base.common.BaseConstant.STUDENT_GROUP;
import static com.cooleshow.base.common.BaseConstant.TEACHER_GROUP;

/**
 * Author by pq, Date on 2022/4/21.
 */
public interface APIService {
    /**
     * 根据月份获取老师该月有课的日期
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseSchedule/queryCourseSchedule")
    Observable<BaseResponse<List<String>>> getCourseScheduleDateByMonth(@Body RequestBody body);

    /**
     * 根据日期获取老师当日排课
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseSchedule/queryCourseUser")
    Observable<BaseResponse<CourseTableDataBean>> getCourseSchedulesWithDate(@Body RequestBody body);

    /**
     * 调课(陪练课调整时间)
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseSchedule/courseAdjust")
    Observable<BaseResponse<Object>> updateCourseDate(@Body RequestBody body);


    /**
     * 查询陪练课
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseSchedule/queryTeacherPracticeCourse")
    Observable<BaseResponse<SparringCourseListBean>> getSparringCourses(@Body TeacherPracticeCourseEntry body);

    /**
     * 获取声部搜索下拉框
     *
     * @return
     */
    @POST(TEACHER_GROUP + "teacher/querySubjectItem")
    Observable<BaseResponse<List<QuerySubjectBean>>> querySubjectItem();

    /**
     * 查询琴房课列表
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseSchedule/selectCourseList")
    Observable<BaseResponse<PianoRoomCourseListBean>> getPianoRoomCourseList(@Body RequestBody body);

    /**
     * 获取直播课信息
     *
     * @return
     */
    @GET(TEACHER_GROUP + "courseSchedule/queryLiveAndVideo")
    Observable<BaseResponse<HomeLiveAndVideoBean>> queryLiveAndVideo();

    /**
     * 查询陪练课作业信息
     *
     * @param
     * @return
     */
    @GET(TEACHER_GROUP + "homework/detail/{courseId}/{studentId}")
    Observable<BaseResponse<SparringCourseHomeworkBean>> getSparringCourseHomework(@Path("courseId") String courseId, @Path("studentId") String studentId);

    /**
     * 查询琴房课作业信息
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "homework/detail/list")
    Observable<BaseResponse<PianoRoomCourseInfoBean>> getPianoRoomCourseHomework(@Body RequestBody body);


    /**
     * 查询琴房课作业信息
     *
     * @param
     * @return
     */
    @GET(TEACHER_GROUP + "homework/detail/{courseId}/{studentId}")
    Observable<BaseResponse<PianoRoomCourseHomeworkBean>> getPianoRoomCourseHomework(@Path("courseId") String courseId, @Path("studentId") String studentId);

    /**
     * 查询课程评价信息
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseReplied/selectReplied")
    Observable<BaseResponse<SparringCourseCommentBean>> getSparringCourseComment(@Body RequestBody body);


    /**
     * 查询琴房课评价信息
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseReplied/selectReplied")
    Observable<BaseResponse<PianoRoomCourseCommentBean>> getPianoRoomCourseComment(@Body RequestBody body);

    /**
     * 提交琴房课老师布置作业
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "homework/decorate")
    Observable<BaseResponse<Object>> submitPianoRoomCourseHomework(@Body RequestBody body);


    /**
     * 提交琴房课老师作业点评
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "homework/review")
    Observable<BaseResponse<Object>> submitPianoRoomCourseHomeworkComment(@Body RequestBody body);

    /**
     * 提交陪练课老师评价
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseReplied/replied")
    Observable<BaseResponse<Object>> submitSparringCourseComment(@Body RequestBody body);

    /**
     * 提交陪练课老师布置作业
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "homework/decorate")
    Observable<BaseResponse<Object>> submitSparringCourseHomework(@Body AssignHomeWorkEntry body);

    /**
     * 提交陪练课老师作业点评
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "homework/review")
    Observable<BaseResponse<Object>> submitSparringCourseHomeworkComment(@Body CommentHomeWorkEntry body);

    /**
     * 查询直播课
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseSchedule/queryTeacherLiveCourse")
    Observable<BaseResponse<LiveCourseListBean>> getLiveCourses(@Body RequestBody body);


    /**
     * 查询视频课
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "videoLessonGroup/page")
    Observable<BaseResponse<VideoCourseListBean>> getVideoCourses(@Body RequestBody body);

    /**
     * 查询个人信息
     *
     * @param
     * @return
     */
    @GET(AUTH_GROUP + "api/queryUserInfo")
    Observable<BaseResponse<UserInfo>> getUserInfo();

    /**
     * 查询老师个人信息
     *
     * @param
     * @return
     */
    @GET(TEACHER_GROUP + "teacher/queryUserInfo")
    Observable<BaseResponse<TeacherUserInfo>> getTeacherUserInfo();

     /**
     * 查询老师个人信息
     *
     * @param
     * @return
     */
    @GET(TEACHER_GROUP + "userAccount/detail")
    Observable<BaseResponse<TeacherPromoteIncomeBean>> getTeacherPromoteIncome();

    /**
     * 查询老师个人风采
     *
     * @param
     * @return
     */
    @GET(TEACHER_GROUP + "teacher/queryTeacherStyle")
    Observable<BaseResponse<TeacherSelfStyleInfoBean>> getTeacherSelfStyle();

    /**
     * 群列表-老师
     *
     * @return
     */
    @POST(TEACHER_GROUP + "imGroup/queryAll")
    Observable<BaseResponse<List<ContactRoomListBean>>> queryTeaGroupList(@Body QueryGroupListEntry requestBody);

    /**
     * 查询我收到的评价
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseReplied/myReplied")
    Observable<BaseResponse<ReceivedCommentListBean>> getReceivedComment(@Body RequestBody body);


    /**
     * 查询课后评价
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "courseSchedule/queryTeacherPracticeCourse")
    Observable<BaseResponse<CourseCommentListBean>> getCourseCommentList(@Body RequestBody body);

    /**
     * 查询课后评价
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "music/sheet/list")
    Observable<BaseResponse<HomePageSheetMusicListBean>> getSheetMusicList(@Body SheetMusicEntry body);

    /**
     * 乐器列表查询
     *
     * @return
     */
    @GET(TEACHER_GROUP + "subject/subjectSelect")
    Observable<BaseResponse<List<TeachableInstrumentBean>>> subjectSelect();

    /**
     * 我的-个人风采保存
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "teacher/saveTeacherStyle")
    Observable<BaseResponse<TeacherSelfStyleInfoBean>> saveTeacherStyle(@Body RequestBody body);

    /**
     * 获取设置详情
     *
     * @return
     */
    @GET(AUTH_GROUP + "user/getSetDetail")
    Observable<BaseResponse<SetDetailBean>> getSetDetail();

    /**
     * 修改设置信息
     *
     * @param body
     * @return
     */
    @POST(AUTH_GROUP + "user/submitSetDetail")
    Observable<BaseResponse<SetDetailBean>> submitSetDetail(@Body RequestBody body);

    /**
     * 校验用户手机号和密码
     *
     * @param phone
     * @param password
     * @return
     */
    @GET(AUTH_GROUP + "user/checkUser")
    Observable<BaseResponse<Object>> checkUser(@Query("phone") String phone, @Query("password") String password);

    /**
     * 修改手机号
     *
     * @param authCode
     * @param newPhone
     * @param oldPhone
     * @return
     */
    @POST(AUTH_GROUP + "user/updatePhone")
    Observable<BaseResponse<Object>> updatePhone(@Query("authCode") String authCode, @Query("newPhone") String newPhone, @Query("oldPhone") String oldPhone);

    /**
     * 手机验证码修改密码
     *
     * @return
     */
    @FormUrlEncoded
    @POST(AUTH_GROUP + "user/updatePassword")
    Observable<BaseResponse<Object>> updatePassword(@FieldMap Map<String, String> params);

    /**
     * 发送登录短信验证码
     *
     * @param body mobile 手机号
     *             type:类型（PASSWD:修改密码，LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号）
     * @return
     */
    @FormUrlEncoded
    @POST(TEACHER_GROUP + "code/sendSmsCode")
    Observable<BaseResponse<Object>> sendSmsCode(@FieldMap Map<String,String> map);

    /**
     * 校验图片验证码
     *
     *             type:类型（PASSWD:修改密码，LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号）
     * @return
     */
    @FormUrlEncoded
    @POST(TEACHER_GROUP + "code/verifyImageCode")
    Observable<BaseResponse<Object>> verifyImgCode(@FieldMap Map<String, String> map);

    /**
     * 校验短信验证码
     *
     * @param body mobile 手机号
     *             type:类型（PASSWD:修改密码，LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号）
     * @return
     */
    @POST(TEACHER_GROUP + "code/verifySmsCode")
    Observable<BaseResponse<Object>> verifySmsCode(@Body RequestBody body);

    /**
     * 实名认证
     *
     * @param body
     * @return
     */
    @POST(AUTH_GROUP + "user/realNameAuth")
    Observable<BaseResponse<Object>> realNameAuth(@Body RequestBody body);

    /**
     * 意见反馈
     *
     * @param body
     * @return
     */
    @FormUrlEncoded
    @POST(TEACHER_GROUP + "sysSuggestion/add")
    Observable<BaseResponse<Object>> addSuggestion(@FieldMap Map<String, String> params);

    /**
     * 银行卡查询
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "userBankCard/page")
    Observable<BaseResponse<ResponseBankCardBean>> queryUserBankCard(@Body RequestBody body);

    /**
     * 用户绑卡
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "userBankCard/bankCard")
    Observable<BaseResponse<ResponseBindCardBean>> bindBankCard(@Body RequestBody body);

    /**
     * 用户解绑银行卡
     *
     * @param entry
     * @return
     */
    @POST(TEACHER_GROUP + "userBankCard/unBind")
    Observable<BaseResponse<ResponseBindCardBean>> unbindBankCard(@Body UnBindCardEntry entry);


    /**
     * 查询银行
     *
     * @return
     */
    @POST(TEACHER_GROUP + "userBankCard/bankList")
    Observable<BaseResponse<List<ResponseUserBankCardBean>>> userBankCard();

    /**
     * 分页查询直播课课程组列表
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "courseGroup/queryPageCourseGroup")
    Observable<BaseResponse<MineLiveCourseListBean>> queryPageCourseGroup(@Body LiveCourseEntry body);

    /**
     * 查询视频课
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "videoLesson/page")
    Observable<BaseResponse<MineVideoCourseListBean>> queryVideoCourseGroup(@Body RequestBody body);

    /**
     * 分页查询分页查询
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "music/sheet/list")
    Observable<BaseResponse<MusicSheetListBean>> queryMusicList(@Body RequestBody body);

    /**
     * 乐谱分享
     *
     * @return
     */
    @GET(TEACHER_GROUP + "music/sheet/share")
    Observable<BaseResponse<MusicSheetShareBean>> musicSheetShare();

    /**
     * 课后作业
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "homework/list")
    Observable<BaseResponse<HomeworkListBean>> queryHomeworkList(@Body RequestBody body);

    /**
     * 我的收入
     *
     * @return
     */
    @GET(TEACHER_GROUP + "userAccount/detail")
    Observable<BaseResponse<AccountDetailBean>> getUserAccountDetail();

    /**
     * 收入列表
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "userAccount/page")
    Observable<BaseResponse<UserAccountBean>> userAccountPage(@Body RequestBody body);

    /**
     * 查询结算页面信息
     *
     * @return
     */
    @POST(TEACHER_GROUP + "userWithdrawal/getWithdrawalInfo")
    Observable<BaseResponse<WithdrawalInfoBean>> getWithdrawalInfo();

    /**
     * 判断用户是否签署协议
     *
     * @return
     */
    @GET(TEACHER_GROUP + "sysUserContractRecord/checkContractSign")
    Observable<BaseResponse<Boolean>> checkContractSign(@Query("contractType") String contractType);

    /**
     * 发起结算
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "userWithdrawal/withdrawal")
    Observable<BaseResponse<Object>> doWithdrawal(@Body RequestBody body);

    /**
     * 结算记录
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "userWithdrawal/withdrawalPage")
    Observable<BaseResponse<WithdrawalRecordBean>> getWithdrawalPage(@Body RequestBody body);

    /**
     * 获取所有消息列表
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "sysMessage/list")
    Observable<BaseResponse<SystemMessageBean>> sysMessageList(@Body RequestBody body);

    /**
     * 一键已读
     *
     * @return
     */
    @POST(TEACHER_GROUP + "sysMessage/batchSetRead")
    Observable<BaseResponse<Object>> batchSetRead();

    /**
     * 设置已读
     *
     * @return
     */
    @POST(TEACHER_GROUP + "sysMessage/setRead/{id}")
    Observable<BaseResponse<Object>> setCurrentRead(@Path("id") long id);

    /**
     * 查询用户未读消息条数
     *
     * @return
     */
    @GET(TEACHER_GROUP + "sysMessage/queryCountOfUnread")
    Observable<BaseResponse<List<CountOfUnreadBean>>> queryCountOfUnread();

    /**
     * 首页统计数据
     *
     * @return
     */
    @GET(TEACHER_GROUP + "home/count")
    Observable<BaseResponse<HomeCountBean>> getHomeCount();

    /**
     * 测试订单支付
     *
     * @return
     */
    @POST(STUDENT_GROUP + "userOrder/orderPay")
    Observable<BaseResponse<PayTestBean>> orderPay(@Body RequestBody body);

    /**
     * 首页统计数据
     *
     * @return
     */
    @POST(CMS_SERVER + "helpCenterContent/list")
    Observable<BaseResponse<HelpCenterContentBean>> helpCenterContentList(@Body RequestBody body);

    /**
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "userAccount/accountTotal")
    Observable<BaseResponse<AccountTotalBean>> accountTotal(@Body RequestBody body);

    /**
     * 创建临时直播间
     *
     * @return
     */
    @POST(TEACHER_GROUP + "liveRoom/createTempLiveRoom")
    Observable<BaseResponse<String>> createLiveRoom(@Body RequestBody body);


    /**
     * 获取直播间列表信息
     *
     * @return
     */
    @POST(TEACHER_GROUP + "liveRoom/queryPageRoom")
    Observable<BaseResponse<LiveListBean>> getLiveListData(@Body RequestBody body);

    /**
     * 获取直播间列表信息
     *
     * @return
     */
    @GET(TEACHER_GROUP + "liveRoomVideo/queryVideo")
    Observable<BaseResponse<ArrayList<LivePlayBackDataBean>>> getLivePlaybackData(@Query("roomUid") String  roomUid);


    /**
     * 查询直播房间信息
     *
     * @return
     */
    @GET(TEACHER_GROUP + "liveRoom/speakerCheckRoomInfo")
    Observable<BaseResponse<LiveRoomInfoBean>> getLiveRoomInfo(@Query("roomUid") String roomUid);

    /**
     * 文件下载
     *
     * @return
     */
    @Streaming
    @GET
    @Headers("User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4)")
    Observable<ResponseBody> downloadFileWithFixedUrl(@Url String url);


    /**
     * 通知加入直播房间成功
     *
     * @return
     */
    @GET(TEACHER_GROUP + "liveRoom/speakerJoinRoom")
    Observable<BaseResponse<Object>> notifyJoinRoomAction(@Query("roomUid") String roomUid, @Query("userId") String userId);

    /**
     * 通知离开直播房间
     *
     * @return
     */
    @POST(TEACHER_GROUP + "liveRoom/syncUserStatus")
    Observable<BaseResponse<Object>> notifyLeaveRoomAction(@Body RequestBody body);

    /**
     * 通知(关闭/开启)直播录像
     *
     * @return type 1:开始直播-开始录像 2:关闭直播关闭录像
     */
    @GET(TEACHER_GROUP + "imLiveBroadcastRoom/opsLiveVideo")
    Observable<BaseResponse<Object>> notifyOpenOpsLiveVideoAction(@Query("roomUid") String roomUid, @Query("type") String type, @Query("userId") String userId, @Query("videoResolution") String videoResolution);

    /**
     * 关闭直播间
     *
     * @return
     */
    @GET(TEACHER_GROUP + "liveRoom/destroyLiveRoom")
    Observable<BaseResponse<Object>> notifyCloseLiveRoomAction(@Query("roomUid") String roomUid);

    /**
     * 同步点赞数量
     *
     * @return
     */
    @GET(TEACHER_GROUP + "liveRoom/syncLike")
    Observable<BaseResponse<Object>> syncAddLikeNum(@Query("likeNum") String likeNum, @Query("roomUid") String roomUid);

    /**
     * app首页banner、按钮、资讯
     *
     * @return
     */
    @POST(CMS_SERVER + "news/app/home")
    Observable<BaseResponse<HomeMenuBean>> appHome(@Body RequestBody body);
}
