import httpService from "./httpService"; import type { ApiResponse } from "./httpService"; export interface AnswerResItem { question_id: number; answer_index: number; question_title: string; selected_option: string; score: number; } export type AnswerItem = Pick; export interface Answers { answers: AnswerItem[]; test_duration: number; } export interface QuestionItem { id: number; question_title: string; question_content: string; options: string[]; scores: number[]; } export interface SubmitAnswerRes { record_id: number; total_score: number; ntrp_level: string; level_description: string; answers: AnswerResItem[]; } // 发布球局类 class EvaluateService { async getEvaluateQuestions(): Promise> { return httpService.post("/ntrp/questions", { showLoading: true, }); } async submitEvaluateAnswers({ answers, }: Answers): Promise> { return httpService.post( "/ntrp/submit", { answers }, { showLoading: true, }, ); } async getHistoryNtrp(): Promise> { return httpService.post("/ntrp/history", { showLoading: true, }); } async getNtrpDetail(record_id: number): Promise> { return httpService.post( "/ntrp/detail", { record_id }, { showLoading: true, }, ); } } // 导出认证服务实例 export default new EvaluateService();