/*
 * @Author: wangyang 1147192855@qq.com
 * @Date: 2022-07-13 11:29:05
 * @LastEditors: wangyang 1147192855@qq.com
 * @LastEditTime: 2022-09-27 17:51:16
 * @FilePath: \marking_app\lib\config\RequestClient.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import 'package:dio/dio.dart';
import 'package:marking_app/common/model/common/base_page_data_report.dart';
import 'package:marking_app/common/model/common/base_structure_result_report.dart';
import 'package:marking_app/common/model/report/detail_base_info.dart';
import 'package:marking_app/common/model/report/exam_records.dart';
import 'package:marking_app/common/model/report/exam_records_all.dart';
import 'package:marking_app/common/model/report/exam_records_params.dart';
import 'package:marking_app/common/model/report/marked_item.dart';
import 'package:marking_app/common/model/report/marked_item_params.dart';
import 'package:marking_app/common/model/report/question_know_point.dart';
import 'package:marking_app/common/model/report/report_card.dart';
import 'package:marking_app/common/model/report/report_card_params.dart';
import 'package:marking_app/common/model/report/report_for_class_teacher_model.dart';
import 'package:marking_app/common/model/report/report_for_class_teacher_params.dart';
import 'package:marking_app/common/model/report/report_for_marking_pagerdetail_model.dart';
import 'package:marking_app/common/model/report/report_for_marking_pagerdetail_params.dart';
import 'package:marking_app/common/model/report/report_for_subject_student_model.dart';
import 'package:marking_app/common/model/report/report_for_subject_student_params.dart';
import 'package:marking_app/common/model/report/report_for_subject_teacher_model.dart';
import 'package:marking_app/common/model/report/report_for_subject_teacher_params.dart';
import 'package:marking_app/common/model/report/report_home_model.dart';
import 'package:marking_app/common/model/report/report_marking_detail.dart';
import 'package:marking_app/common/model/report/report_marking_detail_params.dart';
import 'package:marking_app/common/model/report/small_question.dart';
import 'package:marking_app/common/model/user/user_info_report.dart';
import 'package:retrofit/retrofit.dart' as the_retrofit;

part 'rest_client_report.g.dart';

@the_retrofit.RestApi()
@the_retrofit.Headers(<String, dynamic>{"Content-Type": "application/json"})
abstract class RestClientReport {
  factory RestClientReport(Dio dio, {String baseUrl}) = _RestClientReport;

  // 报告 => 获取用户信息
  @the_retrofit.GET("/api/user/users/getuserinfo")
  Future<BaseStructureResultReport<UserInfoReport>> getReportSysUserinfo();

  // 报告 => 用户相关考试列表集合
  @the_retrofit.GET("/api/user/exam/getexamsbyuser")
  Future<BaseStructureResultReport<BasePageDataReport<MarkedItem>>> getexamsbyuser(
      @the_retrofit.Queries() MarkedItemParams params);

  // 报告 => 用户相关考试列表集合
  @the_retrofit.GET("/api/user/exam/gethomedata")
  Future<BaseStructureResultReport<ReportHomeModel>> getReportHomeData(@the_retrofit.Query("examId") int? examId);

  // 报告 => 用户相关考试列表集合
  @the_retrofit.POST("/api/user/users/switchposition")
  Future<BaseStructureResultReport<bool>> switchposition(@the_retrofit.Query('positionId') int positionId);

  // 报告 => 学科老师报告
  @the_retrofit.GET("/api/user/template/getreportteacher")
  Future<BaseStructureResultReport<ReportForSubjectTeacherModel>> getreportsForSubjectTeacher(
      @the_retrofit.Queries() ReportForSubjectTeacherParams params);

  // 报告 => 学科老师报告
  @the_retrofit.POST("/api/user/template/class/testteport")
  Future<BaseStructureResultReport<ReportForClassTeacherModel>> getreportsForClassTeacher(
      @the_retrofit.Body() ReportForClassTeacherParams params);

  // 报告 => 学生个人报告
  @the_retrofit.POST("/api/user/template/student/stubjecttestteport")
  Future<BaseStructureResultReport<ReportForSubjectStudentModel>> getReportSubjectStudent(
      @the_retrofit.Body() ReportForSubjectStudentParams params);

  // 报告 => 查看原卷
  @the_retrofit.POST("/api/user/template/getmarkingpagerdetails")
  Future<BaseStructureResultReport<ReportForMarkingPagerdetailModel>> getMarkingPagerDetails(
      @the_retrofit.Body() ReportForMarkingPagerdetailParams params);

  /*  // 报告 => 获取考试类别
  @the_retrofit.GET("/api/user/exam/getexamtypecombo")
  Future<BaseStructureResultReport<ExamType>> getExamType();*/

  // 报告 => 获取年级
  @the_retrofit.GET("/api/public/enum/GradeEnum")
  Future<BaseStructureResultReport<List<ComboData>>> getGradeEnum();

  // 报告 => 首页列表
  @the_retrofit.GET("/api/user/exam/examrecords")
  Future<BaseStructureResultReport<BasePageDataReport<ExamRecords>>> getExamrecords(
      @the_retrofit.Queries() ExamRecordsParams params
      );

  // 报告 => 获取考试类别、年级
  @the_retrofit.GET("/api/user/exam/mobilehomecombo")
  Future<BaseStructureResultReport<ExamRecordsAll>> getHomeCombo();

  // 报告 => 首页详情
  @the_retrofit.GET("/api/exam/report/master_mobile")
  Future<BaseStructureResultReport<DetailBaseInfo>> getReportDetail(
      @the_retrofit.Query("examId") int examId, @the_retrofit.Query("classId") int classId
      );

  // 报告 => 考试学科
  @the_retrofit.GET("/api/user/exam/examsubject")
  Future<BaseStructureResultReport<List<ComboData>>> getExamsubject(
      @the_retrofit.Query("examId") int examId
      );

  // 报告 => 可选下拉考试类型（是否有年级模块的报告权限）
  @the_retrofit.GET("/api/user/exam/positionlevel")
  Future<BaseStructureResultReport> getPositionlevel(
      @the_retrofit.Query("grade") String grade
      );

  // 报告 => 可选班级
  @the_retrofit.GET("/api/exam/report/classList")
  Future<BaseStructureResultReport<List<ComboData>>> getClassList(
      @the_retrofit.Query("examId") int examId
      );
  // 报告 => 可选班级
  @the_retrofit.GET("/api/exam/report/master_mobilesubject")
  Future<BaseStructureResultReport<QuestionKnowPoint>> getKnowPoint(
      @the_retrofit.Query("examId") int examId,
      @the_retrofit.Query("classId") int classId,
      @the_retrofit.Query("subject") int subject
      );

  // 报告 =>成绩单
  @the_retrofit.POST("/api/user/exam/reportcard")
  Future<BaseStructureResultReport<ReportCard>> getReportCard(
      @the_retrofit.Body() ReportCardParams params);

  // 报告 =>阅卷详情
  @the_retrofit.POST("/api/exam/report/getmarkingpagerdetails")
  Future<BaseStructureResultReport<ReportMarkingDetail>> getMarkingDetail(
      @the_retrofit.Body() ReportMarkingDetailParams params
      );

  // 报告 => 小题得分
  @the_retrofit.POST("/api/exam/report/master_usersmalltopicasync")
  Future<BaseStructureResultReport<SmallQuestion>> getQuestion(
      @the_retrofit.Body() ReportCardParams params
      );
}
