Marking.Client.Moblie/marking_app/lib/utils/request/rest_client.dart

251 lines
13 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @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/config/request_config.dart';
import 'package:marking_app/common/model/common/base_page_data.dart';
import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/common/upload_img_secret_key.dart';
import 'package:marking_app/common/model/job/job_collect_params.dart';
import 'package:marking_app/common/model/job/job_concerned_with_student.dart';
import 'package:marking_app/common/model/job/job_concerned_with_student_params.dart';
import 'package:marking_app/common/model/job/job_note_taking_trajectory.dart';
import 'package:marking_app/common/model/job/job_page_tab.dart';
import 'package:marking_app/common/model/job/job_review_submission.dart';
import 'package:marking_app/common/model/job/job_task_item.dart';
import 'package:marking_app/common/model/job/marking_text_question_job.dart';
import 'package:marking_app/common/model/job/marking_text_question_job_params.dart';
import 'package:marking_app/common/model/job/marking_text_question_job_tab_params.dart';
import 'package:marking_app/common/model/job/review_again_list_params.dart';
import 'package:marking_app/common/model/job/upload_file_interface_config.dart';
import 'package:marking_app/common/model/job/upload_file_interface_config_params.dart';
import 'package:marking_app/common/model/marking/marking_abnormal_res.dart';
import 'package:marking_app/common/model/marking/marking_item.dart';
import 'package:marking_app/common/model/marking/marking_list_params.dart';
import 'package:marking_app/common/model/marking/marking_statistics.dart';
import 'package:marking_app/common/model/marking/marking_tag_single_params.dart';
import 'package:marking_app/common/model/marking/marking_text_question.dart';
import 'package:marking_app/common/model/marking/marking_text_question_params.dart';
import 'package:marking_app/common/model/marking/marking_text_question_tab.dart';
import 'package:marking_app/common/model/marking/marking_text_question_tab_params.dart';
import 'package:marking_app/common/model/marking/marking_text_question_tab_step_size.dart';
import 'package:marking_app/common/model/marking/rating_progress_model.dart';
import 'package:marking_app/common/model/marking/review_records_item.dart';
import 'package:marking_app/common/model/marking/review_records_params.dart';
import 'package:marking_app/common/model/marking/submit_exam_abnormal_params.dart';
import 'package:marking_app/common/model/marking/submit_exam_params.dart';
import 'package:marking_app/common/model/progress/progress_item.dart';
import 'package:marking_app/common/model/progress/progress_page_params.dart';
import 'package:marking_app/common/model/progress/progress_statistics.dart';
import 'package:marking_app/common/model/review/review_item.dart';
import 'package:marking_app/common/model/review/review_page_params.dart';
import 'package:marking_app/common/model/review/review_tab.dart';
import 'package:marking_app/common/model/sys/system_version.dart';
import 'package:marking_app/common/model/user/user_info.dart';
import 'package:retrofit/retrofit.dart' as the_retrofit;
import 'package:marking_app/common/model/user/user_login_params.dart';
part 'rest_client.g.dart';
@the_retrofit.RestApi()
@the_retrofit.Headers(<String, dynamic>{"Content-Type": "application/json"})
abstract class RestClient {
factory RestClient(Dio dio, {String baseUrl}) = _RestClient;
// 最新版本
@the_retrofit.GET("/api/version/latest?mobileTypeEnum={mobileTypeEnum}")
Future<BaseStructureResult<SystemVersion>> getLatestVersion(
@the_retrofit.Path("mobileTypeEnum") int mobileTypeEnum); // 1 安卓 2 ios
// 用户登录 /auth/login/exam-marking/user-mobile
@the_retrofit.POST("/auth/login/exam-marking/user")
Future<BaseStructureResult<dynamic>> toLogin(@the_retrofit.Body() UserLoginParams params);
//获取图片上传秘钥
@the_retrofit.GET("/api/img-svr/minio-cfg")
Future<BaseStructureResult<UploadImgSecretKey>> getImageUploadKey();
// 获取用户信息
@the_retrofit.GET("/auth/info/cur-user")
Future<BaseStructureResult<UserInfo>> getUserInfo(@the_retrofit.Header("Authorization") String token);
// 阅卷列表 => 分页获取
@the_retrofit.GET("/api/marking/list")
Future<BaseStructureResult<BasePageData<MarkingItem>>> getMarkingsByPage(
@the_retrofit.Queries() MarkingListParams params);
// /api/marking/list
// 进度 => 进度详情 分页获取
@the_retrofit.GET("/api/marking/teacher-overview")
Future<BaseStructureResult<BasePageData<ProgressItem>>> getProgressByPage(
@the_retrofit.Path("markingId") String id, @the_retrofit.Queries() ProgressPageParams params);
// 进度 => 进度详情 统计数据
@the_retrofit.GET("/api/marking/{examSubjectId}/overview")
Future<BaseStructureResult<ProgressStatistics>> getProgressStatistics(@the_retrofit.Path("examSubjectId") String id);
// 回评 => 获取tab
@the_retrofit.GET("/api/marking/{markingUserId}/review/tab")
Future<BaseStructureResult<List<ReviewTab>>> getReviewTab(
@the_retrofit.Path("markingUserId") String id, @the_retrofit.Query("markingUserId") int markingUserId);
// 回评 => 获取tab 下分页
@the_retrofit.GET("/api/marking/{markingUserId}/review/paged")
Future<BaseStructureResult<BasePageData<ReviewItem>>> getReviewPage(
@the_retrofit.Path("markingUserId") String id, @the_retrofit.Queries() ReviewPageParams params);
// 阅卷 => 获取考试试题
@the_retrofit.GET("/api/marking/question")
Future<BaseStructureResult<MarkingTextQuestion>> getTestQuestionsOfExam(
@the_retrofit.Queries() MarkingTextQuestionParams params);
// 阅卷 => 获取考试tab试题批次
@the_retrofit.GET("/api/marking/{markingUserId}/tab")
Future<BaseStructureResult<List<MarkingTextQuestionTab>>> getTestQuestionsOfTab(
@the_retrofit.Path("markingUserId") int markingUserId);
// 阅卷 => 单个试题Tag阅卷详情
@the_retrofit.GET("/api/marking/{markingUserId}/progress")
Future<BaseStructureResult<MarkingTextQuestionTab>> getMarkingTagSingleDetails(
@the_retrofit.Path("markingUserId") int markingUserId, @the_retrofit.Queries() MarkingTagSingleParams params);
// 阅卷 => 获取考试tabs 下所有步长
@the_retrofit.GET("/api/marking/q/interval")
Future<BaseStructureResult<List<MarkingTextQuestionTabStepSize>>> getTestQuestionsOfTabStepSize(
@the_retrofit.Query("examSubjectId") int examSubjectId);
// 阅卷 => 获取考试tab下某次试题
@the_retrofit.GET("/api/marking/{markingUserId}/detail")
Future<BaseStructureResult<MarkingTextQuestion>> getTabOfExam(@the_retrofit.Path("markingUserId") int markingUserId,
@the_retrofit.Queries() MarkingTextQuestionTabParams params);
// 阅卷 => 提交考试试题
@the_retrofit.PUT("/api/marking")
Future<BaseStructureResult<bool>> submitTestQuestionsOfExam(@the_retrofit.Body() SubmitExamParams params);
@the_retrofit.PUT("/api/marking/error")
Future<BaseStructureResult<bool>> submitTestQuestionsOfExamAbnormal(
@the_retrofit.Body() SubmitExamAbnormalParams params);
// 阅卷 => 提交考试试题
@the_retrofit.PUT("/api/marking/review")
Future<BaseStructureResult<bool>> submitTestQuestionsOfExamReview(@the_retrofit.Body() SubmitExamParams params);
// 阅卷 => 结束阅卷
@the_retrofit.PUT("/api/marking/{markingUserId}/end")
Future<BaseStructureResult<bool?>> endMarkingTask(@the_retrofit.Path("markingUserId") String markingUserId);
// 阅卷 => 结束阅卷
@the_retrofit.GET("/api/marking/original-paper")
Future<BaseStructureResult<List<String>>> getViewOriginalVolume(
@the_retrofit.Query("markingUserDetailId") String markingUserDetailId);
// 阅卷 => 查看答案
@the_retrofit.GET("/api/marking/answer")
Future<BaseStructureResult<String>> getStandardAnswer(
@the_retrofit.Query("examSubjectId") int examSubjectId, @the_retrofit.Query("questionNum") String questionNum);
// 阅卷 => 获取任务列表种类统计信息
@the_retrofit.GET("/api/marking/list/count")
Future<BaseStructureResult<List<MarkingStatistics>>> getMarkingStatistics();
// 阅卷 => 获取异常类型集合
@the_retrofit.GET("/api/marking/errortypes")
Future<BaseStructureResult<MarkingAbnormalRes>> getAbnormalTypes();
// 阅卷 => 获取异常类型集合
@the_retrofit.GET("/api/marking/{markingUserId}/exit")
Future<BaseStructureResult> exitMarking(@the_retrofit.Path("markingUserId") int markingUserId);
// 阅卷 => 获取异常类型集合
@the_retrofit.GET("/api/marking/{markingUserId}/records")
Future<BaseStructureResult<BasePageData<ReviewRecordsItem>>> getMarkingRecords(
@the_retrofit.Path("markingUserId") String markingUserId, @the_retrofit.Queries() ReviewRecordsParams params);
// 阅卷 => 获取异常详细信息
@the_retrofit.GET("/api/marking/error-info")
Future<BaseStructureResult<ExceptionInfo>> getMarkingQuestionsErrorInfo(
@the_retrofit.Query("markingUserDetailId") int id);
// 阅卷 => 获取仲裁详细信息
@the_retrofit.GET("/api/marking/history-score")
Future<BaseStructureResult<List<HistoricalScoring>>> getArbitrateOfHistoryScore(
@the_retrofit.Query("markingUserDetailId") int id);
// 阅卷 => 获取仲裁详细信息
@the_retrofit.GET("/api/marking/rating-info")
Future<BaseStructureResult<List<RatingProgressModel>>> getMarkingRatingInfo(
@the_retrofit.Query("markingUserId") int id);
// ------------------------------------------ 作业 ------------------------------------------
// 作业 => 作业列表
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Task")
Future<BaseStructureResult<BasePageData<JobTaskItem>>> getJobsByPage(
@the_retrofit.Queries() MarkingListParams params);
// 作业 => 批改获取tabs
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Task/tabs")
Future<BaseStructureResult<List<JobPageTab>>> getJobOfTabs(@the_retrofit.Query("taskId") int taskId);
// 作业 => 批改获取tabs
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Marking/students")
Future<BaseStructureResult<List<JobConcernedWithStudent>>> getJobWithStudents(
@the_retrofit.Queries() JobConcernedWithStudentParams params);
// 作业 => 获取考试tab下某次试题
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Task/detail")
Future<BaseStructureResult<MarkingTextQuestionJob>> getJobTabOfExam(
@the_retrofit.Queries() MarkingTextQuestionJobTabParams params);
// 作业 => 提交
@the_retrofit.POST("${RequestConfig.hwProxyKeywords}/api/Task")
Future<BaseStructureResult> toSubmitMarking(@the_retrofit.Body() JobReviewSubmission params);
// 作业 => 结束作业任务
@the_retrofit.PUT("${RequestConfig.hwProxyKeywords}/api/Task/end")
Future<BaseStructureResult> toEndReviewJob(@the_retrofit.Query("taskIds") List<int> taskIds);
// 作业 => 获取考试tab下某次试题
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Task/questions")
Future<BaseStructureResult<BasePageData<ReviewItem>>> toGoreviewAgainPage(
@the_retrofit.Queries() ReviewAgainListParams params);
// 作业 => 获取参考答案
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Task/answer")
Future<BaseStructureResult<String>> getAnswer(
@the_retrofit.Query("taskId") int taskId,
@the_retrofit.Query("questionNum") String questionNum,
);
// 作业 => 上传图片请求参数
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Upload")
Future<BaseStructureResult<UploadFileInterfaceConfig>> getUploadFile(
@the_retrofit.Queries() UploadFileInterfaceConfigParams params);
// 作业 => 获取参考答案
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Dpc/studentAnswerHandwriting")
Future<BaseStructureResult<JobNoteTakingTrajectory>> getNoteTakingTrajectory(
@the_retrofit.Query("paperId") int paperId, @the_retrofit.Query("questionNo") String questionNo);
// 作业 => 查询作业是否收藏
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Dpc/collect")
Future<BaseStructureResult<bool>> getJobCollect(
@the_retrofit.Query("taskId") int taskId, @the_retrofit.Query("studentId") int studentId);
// 作业 => 查询作业是否收藏
@the_retrofit.POST("${RequestConfig.hwProxyKeywords}/api/Dpc/collect")
Future<BaseStructureResult<bool>> toJobFavoriteCancel(@the_retrofit.Body() JobCollectParams params);
// 作业 => 一键批阅
@the_retrofit.POST("${RequestConfig.hwProxyKeywords}/api/Marking/auto")
Future<BaseStructureResult<bool>> toJobOneClickReview(@the_retrofit.Field() int taskId);
}