import request from '@/router/axios';

export const getList =
  (current, size, params) => {
    return request({
      url: '/api/jobslink-api/tenant/station/list',
      method: 'get',
      params: {
        ...params,
        current,
        size,
      }
    })
  }

export const getDetail =
  (id) => {
    return request({
      url: '/api/jobslink-api/tenant/station/detail',
      method: 'get',
      params: {id}
    })
  }

export const add =
  (row) => {
    return request(
      {url: '/api/jobslink-api/tenant/station/save', method: 'post', data: row})
  }

export const update =
  (row) => {
    return request({
      url: '/api/jobslink-api/tenant/station/update',
      method: 'post',
      data: row
    })
  }
export const getStation = () => {
  return request({
    url: '/api/jobslink-api/tenant/station/find',
    method: 'get',
  })
}

export const getStationDic = () => {
  return '/api/jobslink-api/tenant/station/find'
}

export const StationDic =
  () => {
    return request({
      url: '/api/jobslink-api/tenant/station/find',
      method: 'get'
    })
  }
// 工作站下拉
export const StationFind =
  () => {
    return request({
      url: '/api/jobslink-api/tenant/company/station/dropDown',
      method: 'get'
    })
  }

// 新增工作站
export const StationSave =
  (params) => {
    return request({
      url: '/api/jobslink-api/tenant/station/save',
      method: 'post',
      data: params
    })
  }
// 新增工作站账号
export const stationSubmit =
  (params) => {
    return request({
      url: '/api/jobslink-api/system/tuser/station/manage/submit',
      method: 'post',
      data: params
    })
  }

// 查看工作站账号
export const tuserDetail =
  (params) => {
    return request({
      url: '/api/jobslink-api/system/tuser/detail',
      method: 'get',
      params: params
    })
  }

// 修改站点信息
export const stationModify =
  (params) => {
    return request({
      url: '/api/jobslink-api/tenant/station/submit',
      method: 'post',
      data: params
    })
  }

export const getEnterpriseList = (params) => request({
  url: '/api/jobslink-api/tenant/company/allInviteCompany',
  method: 'get',
  params
})

export const saveEnterpriseItem = (params) => request({
  url: '/api/jobslink-api/tenant/invite/save',
  method: 'post',
  data: params
})
export const getInvitationCodeList = (params) => request({
  url: '/api/jobslink-api/tenant/invite/list',
  method: 'get',
  params
})

export const getInvitationStatusUpdate = (params) => request({
  url: '/api/jobslink-api/tenant/invite/update',
  method: 'post',
  data: params
})
export const getInviteApproval = (params) => request({
  url: '/api/jobslink-api/tenant/invite/approval',
  method: 'post',
  data: params
})
