package com.ssj.service.conch.teacher.service;

import com.ssj.bean.sys.wallet.domain.Bank;
import com.ssj.framework.core.security.exception.CommonException;
import com.ssj.framework.core.util.ResponseEntity;
import com.ssj.service.conch.parents.dto.CorrectDetailDto2;
import com.ssj.service.conch.parents.v1.request.VersionV1Req;
import com.ssj.service.conch.teacher.app.dto.ErrorWarnDTO;
import com.ssj.service.conch.teacher.app.dto.SystemMessageDTO;
import com.ssj.service.conch.teacher.app.request.*;
import com.ssj.service.conch.teacher.dto.HomeworkDTO;
import com.ssj.service.conch.teacher.request.PerfectInfoReq;
import com.ssj.service.conch.teacher.request.teacherorg.AnswerFilterBooksRequest;
import com.ssj.service.conch.teacher.request.teacherorg.AnswerFilterConditionReq;
import com.ssj.service.kmt.dto.CompositionCommentLevelDto;
import com.ssj.service.kmt.dto.CompositionCommentTypeDto;
import com.ssj.service.kmt.request.*;
import com.ssj.service.sys.homework.request.CorrectionsRequest;
import com.ssj.service.sys.homework.vo.HomeworkExerciseUnitDto;
import com.ssj.service.sys.homework.vo.KnowledgeHowDto;
import com.ssj.service.sys.picturepredeal.request.RecognitionResultReq;
import com.ssj.service.weixin.library.dto.SchoolManagerDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;

/**
 * @author yrf
 * @date 2019/6/6 16:42
 */
public interface TeacherAppService {

    Page<HomeworkDTO> findByTeacherIdAndType(String teacherId, Integer type, String beginDateTimeStr, String endDateTimeStr, Pageable pageable);

    ResponseEntity rectifyCourseName(String homeworkPictureId, String courseName);

    ResponseEntity sendVagueImgRemind(String homeworkPictureId,Integer markType, String userId);

    ResponseEntity homeworkToSmarttimePicture(String homeworkPictureId);

    ResponseEntity getAnswerFilterCondition(AnswerFilterConditionReq request);

    Map<String, Object> findAnswerList(AnswerSearchV2Request request);

    ResponseEntity correct(CorrectionsRequest request, String teacherId) throws CommonException;

    CorrectDetailDto2 correctDetail(CorrectDetailReq req) throws CommonException;

    ResponseEntity wxLogin(WxLoginReq wxLoginReq);

    ResponseEntity getUserStatus(String userId);

    ResponseEntity getUserStatusNew(String userId);

    ResponseEntity register(String userId, RegisterReq registerReq);

    /**
     * 分页查询校区管理员
     */
    Page<SchoolManagerDTO> findSchoolManagerPage(Pageable pageable, String subject);

    ResponseEntity updateInfo(String teacherId, RegisterReq registerReq) throws InvocationTargetException, IllegalAccessException;

    /**
     * 查询资料，1为个人资料   2为申请资料
     * @param teacherId 老师的id
     */
    ResponseEntity findMyInfo(String teacherId, InfoReq infoReq);

    ResponseEntity logout(String accessToken);

    List<KnowledgeHowDto> findKnowledgeDetails(KnowledgeListReq request) throws CommonException;

    /**
     * 查询最版本信息
     * @return
     */
    ResponseEntity getVersion(VersionV1Req req);

    /**
     * 开始作业图片批改时间
     */
    ResponseEntity beginPictureCorrection(StudentHomeworkPictureRequest request, String userId);

    /**
     * 查询3天内的系统消息列表
     * @param teacherId 消息是推送给此老师的
     * @return
     */
    List<SystemMessageDTO> findSystemMessageList(String teacherId);

    /**
     * 分页查询报错提醒
     * @param teacherId 查询此老师的报错提醒
     * @param pageable 分页信息
     * @return
     */
    Page<ErrorWarnDTO> findErrorWarnNoticeList(String teacherId, Pageable pageable);

    /**
     * @param 
     * @return 
     * 方法说明:在馆，在线，机构老师端APP微信授权登录
     * 创建时间:2019/7/23 15:45
     * @author yangcan
     */
    ResponseEntity appLogin(WxLoginReq wxLoginReq);
    ResponseEntity appPasswordLogin(PasswordLoginReq passwordLoginReq);
    ResponseEntity phoneRegister(PhoneAndPasswordReq phoneAndPasswordReq);
    

    /**
     * @param 
     * @return 
     * 方法说明:切换身份获取accessToken信息
     * 创建时间:2019/7/23 17:12
     * @author yangcan
     */
    ResponseEntity changeRole(ChangeRoleReq req);

    /**
     * @param
     * @return
     * 方法说明:通过老师userId获取老师身份
     * 创建时间:2019/8/7 18:06
     * @author yangcan
     */
    ResponseEntity getRole(String userId);

    /**
     * @param
     * @return
     * 方法说明:切换身份退出清除token,如果是在线老师则下线并分配作业给其他在线老师
     * 创建时间:2019/7/23 17:36
     * @author yangcan
     */
    void roleLogout(String accessToken,String roleType);

    /**
     * 查询批改老师在线离线状态
     * @param userId
     * @return
     */
    int getIsOnline(String userId);

    /**
     * 设置在线离线
     * @param userId
     * @param isOnline
     */
    public void settingIsOnline(String userId,int isOnline);

    /**
     * 查询银行列表
     */
    List<Bank> findBankList();

    void getVerificationCode(String userId, String phone);

    ResponseEntity bindTelPhone(String userId, VcodeSubmitReq req);

    ResponseEntity registerV2(String teacherId, RegisterV2Req registerReq);

    /**
     * 查询作业图片的练习册识别结果
     * @return
     */
    ResponseEntity findRecognitionResult(RecognitionResultReq req);

    /**
     * 查询作文评语模板
     */
    List<CompositionCommentTypeDto> findCommentTemplateGroup(BookFilterRequest req);

    /**
     * 查询作文评语模板维度
     */
    List<CompositionCommentTypeDto> findCompositionContentModule(CompositionModuleRequest req);

    /**
     * 查询作文评语模板详情
     */
    List<CompositionCommentLevelDto> findCompositionContentDetail(CompositionDetailRequest req);

    /**
     * 注册批改老师
     * @param userId 注册人用户id
     * @param registerReq 注册资料
     */
    ResponseEntity registerV3(String userId, RegisterV3Req registerReq);

    ResponseEntity getTeacherInfo(String teacherId);

    /**
     * 查询机构自批改老师的资料
     * @param teacherId 老师id
     * @return 老师资料
     */
    ResponseEntity findOrgMyInfo(String teacherId);

    /**
     * 查询批改老师的信息
     * @param teacherId 老师id
     * @return 老师资料
     */
    ResponseEntity getCorrectTeacherInfo(String teacherId);

    ResponseEntity appLoginNew(WxLoginReqNew wxLoginReq);

    ResponseEntity appPasswordLoginNew(PasswordLoginReq passwordLoginReq);

    ResponseEntity changeRoleNew(String accessToken, ChangeRoleReqNew req);

    /**
     * 分页查询筛选答案的练习册
     * @param request
     * @return
     */
    Map<String, Object> findAnswerFilterBooks (AnswerFilterBooksRequest request);

    /**
     * 查询练习册的单元课时列表
     * @return
     */
    List<HomeworkExerciseUnitDto> findAnswerFilterBookDetail (String bookId);

    ResponseEntity setIsRemind(String userId,int isRemind);

    /**
     * 校区老师完善资料
     *
     * @param userId
     * @param req
     * @return
     */
    ResponseEntity perfectInfo(String userId, PerfectInfoReq req);

    /**
     * 校区老师查看审核资料
     *
     * @param userId
     * @return
     */
    ResponseEntity findLibTeacherAuditInfo(String userId);

    /**
     * 查询名人名言
     *
     * @return 响应实体
     */
    ResponseEntity findFamousSaying();
}
