import request from '@/utils/request'

// 重新生成认证和签署链接
export function refreshAuthLink(params) {
  return request({
    url: '/platform/flushUrl',
    method: 'get',
    params
  })
}

// 刷新认证状态
export function platformFlush(params) {
  return request({
    url: '/platform/flush',
    method: 'get',
    params
  })
}

// 开票信息维护详情
export function editInvoice(params) {
  return request({
    url: '/platform/editInvoice',
    method: 'get',
    params
  })
}

// 开票信息维护提交
export function onSubmit(data) {
  return request({
    url: '/platform/doEditInvoice',
    method: 'post',
    data
  })
}

// 根据关键字获取企业全称
export const getCompanyNameFormKey = (params) => (
  request({
    url: '/customer/doFindEnterpriseBySop',
    method: 'get',
    params
  })
)

// 添加平台提交
export function platformAdd(data) {
  return request({
    url: '/platform/add',
    method: 'post',
    data
  })
}

// 电子签-个人-获取列表
export const getESignPersonalList = (data) => (
  request({
    url: '/electronic/signature/personal/findByName',
    method: 'post',
    data
  })
)
// 电子签-个人-获取详情
export const getESignPersonalDetails = (params) => (
  request({
    url: '/electronic/signature/personal/get',
    method: 'get',
    params
  })
)

// 电子签-个人-获取详情
export const addESignPersonal = (data) => (
  request({
    url: '/electronic/signature/personal/addInfo',
    method: 'post',
    data
  })
)

export const updateESignPersonal = (data) => (
  request({
    url: '/electronic/signature/personal/update',
    method: 'post',
    data
  })
)

// 电子签-企业-获取列表
export const getESignCompanyList = (data) => (
  request({
    url: '/electronic/signature/company/search',
    method: 'post',
    data
  })
)

// 电子签-企业-新增公司
export const addCompany = (data) => (
  request({
    url: '/electronic/signature/company/add',
    method: 'post',
    data
  })
)

// 电子签-企业-认证信息

export const getAuthInfo = (params) => (
  request({
    url: '/electronic/signature/company/getAuthInfo',
    method: 'get',
    params
  })
)
