import request from '@/router/axios';
/*获取人才列表*/
export const getList =
    (current, size, params, groupId) => {
      return request({
        url: '/api/jobslink-api/label/list',
        method: 'get',
        params: {...params, current, size, groupId}
      })
    }

/*新增人才*/
export const add =
    (row) => {
      return request(
          {url: '/api/jobslink-api/label/save', method: 'post', data: row})
    }

/*编辑人才*/
export const update =
    (row) => {
      return request({
        url: '/api/jobslink-api/label/update',
        method: 'post',
        data: row
      })
    }

/*删除人才*/
export const remove =
    (ids) => {
      return request({
        url: '/api/jobslink-api/label/remove',
        method: 'post',
        params: {ids}
      })
    }

/*人才详情*/
export const detail =
    (id) => {
      return request({
        url: '/api/jobslink-api/label/detail',
        method: 'get',
        params: {id}
      })
    }


/*获取分组*/
export const getDept =
    () => {
      return request({
        url: '/api/jobslink-api/label/group/listAll',
        method: 'get',
        params: {}
      })
    }

/*新建分组*/
export const addDept =
    (row) => {
      return request({
        url: '/api/jobslink-api/label/group/save',
        method: 'post',
        data: row
      })
    }


/*编辑分组*/
export const updateDept =
    (row) => {
      return request({
        url: '/api/jobslink-api/label/group/update',
        method: 'post',
        data: row
      })
    }


/*删除分组*/
export const removeDept =
    (ids) => {
      return request({
        url: '/api/jobslink-api/label/group/remove',
        method: 'post',
        params: {ids}
      })
    }


/*转移分组*/
export const transferDept =
    (groupIds, ids) => {
      return request({
        url: '/api/jobslink-api/label/updateAllGroup',
        method: 'post',
        params: {groupIds, ids}
      })
    }

/*导入人才库*/
export const upload = () => {
  return `/api/jobslink-api/label/group/import?isCovered=1`
}
