import request from '@/config/axios'

// 人才地图 API
export const TalentMap = {
  // 简历解析
  resumeParse: async (params: any) => {
    return await request.get({ url: `/menduner/system/online/resume/parser`, params })
  },

  // 获得人才地图-人才详情
  getTalentMapDetail: async (userId: string) => {
    return await request.get({ url: `/menduner/system/person-info/detail?userId=` + userId })
  },

  // 获得人才地图-人才基本信息分页
  getTalentMapInfoPage: async (params: any) => {
    return await request.get({ url: `/menduner/system/talent-map-info/page`, params })
  },

  // 创建人才地图-新增人才的信息
  createTalentMapInfo: async (data: any) => {
    return await request.post({ url: `/menduner/system/talent-map-info/add`, data })
  },

  // 删除人才地图-人才基本信息
  deleteTalentMap: async (id: number) => {
    return await request.delete({ url: `/menduner/system/talent-map-info/delete?id=` + id })
  },

  // 获得人才地图-人才基本信息
  getTalentMapDetails: async (id: number) => {
    return await request.get({ url: `/menduner/system/talent-map-info/get?id=` + id })
  },

  // 更新人才地图-人才基本信息
  updateTalentMapInfo: async (data: any) => {
    return await request.put({ url: `/menduner/system/talent-map-info/update`, data })
  },

  // 创建人才地图-人才教育经历
  createTalentMapEdu: async (data: any) => {
    return await request.post({ url: `/menduner/system/talent-map-edu-exp/create`, data })
  },

  // 更新人才地图-人才教育经历
  updateTalentMapEdu: async (data: any) => {
    return await request.put({ url: `/menduner/system/talent-map-edu-exp/update`, data })
  },

  // 删除人才地图-人才教育经历
  deleteTalentMapEdu: async (id: number) => {
    return await request.delete({ url: `/menduner/system/talent-map-edu-exp/delete?id=` + id })
  },

  // 创建人才地图-人才工作经历
  createTalentMapExp: async (data: any) => {
    return await request.post({ url: `/menduner/system/talent-map-work-exp/create`, data })
  },

  // 更新人才地图-人才工作经历
  updateTalentMapExp: async (data: any) => {
    return await request.put({ url: `/menduner/system/talent-map-work-exp/update`, data })
  },

  // 删除人才地图-人才工作经历
  deleteTalentMapExp: async (id: number) => {
    return await request.delete({ url: `/menduner/system/talent-map-work-exp/delete?id=` + id })
  },

  // 创建人才地图-人才培训经历
  createTalentMapTrain: async (data: any) => {
    return await request.post({ url: `/menduner/system/talent-map-train-exp/create`, data })
  },

  // 更新人才地图-人才培训经历
  updateTalentMapTrain: async (data: any) => {
    return await request.put({ url: `/menduner/system/talent-map-train-exp/update`, data })
  },

  // 删除人才地图-人才培训经历
  deleteTalentMapTrain: async (id: number) => {
    return await request.delete({ url: `/menduner/system/talent-map-train-exp/delete?id=` + id })
  }
}


export const pyTalentMap = {
  // 查找人才
  searchTalent: async (params: any) => {
    return await request.get({ url: `/menduner/system/person-info/person-map/page`, params })
  },
  // 人才标签推荐
  getTalentLabel: async (params: any) => {
    return await request.get({ url: `/menduner/system/python-graph/rocket/label/list`, params })
  }
}