import flyio from "../flyio";
import { ApiResponse, ApiResponseList } from "@/types";
import { Career } from "@/types";

/**
 * 获取职业树
 * @param params 
 * @returns 
 */
export function getCareerTree(params: Career.CareerTreeQueryDTO) {
  return flyio.get('/front/vocational/getAllVocation', params) as Promise<ApiResponse<Career.CareerItem[]>>;
}

/**
 * 获取职业概览
 * @param code 职业编码
 * @returns 
 */
export function getCareerOverview(code: string) {
  return flyio.get('/front/vocational/getVocationalOverview', { code }) as Promise<ApiResponse<Career.CareerOverview>>;
}

/**
 * 获取职业岗位
 * @param code 职业编码
 * @returns 
 */
export function getCareerJob(code: string) {
  return flyio.get('/front/vocational/getVocationalPosts', { code }) as Promise<ApiResponse<Career.CareerJob[]>>;
}

/**
 * 获取职业岗位详情
 * @param code 职业编码
 * @returns 
 */
export function getCareerJobDetail(name: string) {
  return flyio.get('/front/vocational/getVocationalPostDetailByPostName', { postName: name }) as Promise<ApiResponse<Career.CareerJobDetail>>;
}