/*
 * @Date: 2025-11-12
 * @Description: 职业路径相关接口
 */
import request from '@/utilsRc/request'

// 根据职业名称获取路径列表
export function getJobPathPage(params) {
  return request({
    url: '/jobPath/getJobPathPage',
    method: 'get',
    params,
    baseUrlType: 'zytp'
  })
}

// 根据职业路径ID获取详情
export function getJobPathDetail(params) {
    const {startJobId, endJobId} = params;
  const requestParams = {};
  if (startJobId !== undefined && startJobId !== null && startJobId !== '') {
    requestParams.startJobId = startJobId;
  }
  if (endJobId !== undefined && endJobId !== null && endJobId !== '') {
    requestParams.endJobId = endJobId;
  }

  if (!startJobId || !endJobId) {
    return Promise.reject('缺少必需的 startJobId 和 endJobId 参数');
  }

  return request({
    url: '/jobPath/getJobPathById',
    method: 'get',
    params: requestParams,
    baseUrlType: 'zytp'
  })
}

// 获取职业路径数量
export function getJobPathNum() {
  return request({
    url: '/jobPath/getJobPathNum',
    method: 'get',
    baseUrlType: 'zytp'
  })
}

