import flyio from "../flyio";
import {ApiResponse, ApiResponseList} from "@/types";
import {HollandEntity, HollandRecord, MbtiEntity, MbtiRecommendMajorCategory, MbtiRecord, HollandTestQuestion, TestStep, MbtiTestQuestion} from "@/types/test-center";

//  职业兴趣测评 01 测试步骤
export function hollSteps() {
    return flyio.get('/front/syzy/holland/steps', {}) as Promise<ApiResponse<TestStep[]>>
}

//  职业兴趣测评 02 步骤题目
export function hollStepsQuestions(stepId: number) {
    return flyio.get('/front/syzy/holland/questions', { stepId }) as Promise<ApiResponseList<HollandTestQuestion>>
}

//  职业兴趣测评 03 保存测试
export function hollSaveHolland(data: any) {
    return flyio.post('/front/syzy/holland/save', data) as Promise<ApiResponse<string>>
}

//  职业兴趣测评 04 测评记录
export function hollRecord(params: any) {
    return flyio.get('/front/syzy/holland/record', params) as Promise<ApiResponseList<HollandRecord>>
}

//  职业兴趣测评 05 测评详情
export function hollDetail(params: any) {
    return flyio.get('/front/syzy/holland/record/detail', params) as Promise<ApiResponse<HollandEntity>>
}

//  职业性格测评 01 测试步骤
export function mbtiSteps() {
    return flyio.get('/front/syzy/mbti/steps', {}) as Promise<ApiResponse<TestStep[]>>
}

//  职业性格测评 02 步骤题目
export function mbtiStepsQuestions(stepId: number) {
    return flyio.get('/front/syzy/mbti/questions', { stepId }) as Promise<ApiResponseList<MbtiTestQuestion>>
}

//  职业性格测评 03 保存测试
export function mbtiSave(data: any) {
    return flyio.post('/front/syzy/mbti/save', data) as Promise<ApiResponse<string>>
}

//  职业性格测评 04 测评记录
export function mbtiRecord(params: any) {
    return flyio.get('/front/syzy/mbti/record', params) as Promise<ApiResponseList<MbtiRecord>>
}

//  职业性格测评 05 测评详情
export function mbtiDetail(params: any) {
    return flyio.get('/front/syzy/mbti/record/detail', params) as Promise<ApiResponse<MbtiEntity>>
}

// 推荐专业
export function mbtiRecommendMajors(params: any) {
    return flyio.get('/front/syzy/mbti/majors', params) as Promise<ApiResponse<MbtiRecommendMajorCategory[]>>
}