import request from '../utils/request'

export function tenants (data) {
  return request({
    url: '/tenant/query/tenants', // 查询租户
    method: 'get',
    params: data
  })
}
export function create (data) {
  return request({
    url: '/tenant/api/create', // 新增租户
    method: 'post',
    data: data
  })
}
export function changeInfo (data) {
  return request({
    url: '/operator/api/changeInfo', // 编辑账户
    method: 'post',
    data: data
  })
}
export function tenantChangeInfo (data) {
  return request({
    url: '/tenant/api/changeInfo', // 编辑租户
    method: 'post',
    data: data
  })
}
export function tenantChangeshipNumber (data) {
  return request({
    url: '/tenant/api/change', // 编辑税
    method: 'post',
    data: data
  })
}
export function plugins (data) {
  return request({
    url: '/operationTenantPlugin/query/pluginDetails', // 获取租户插件列表
    method: 'get',
    params: data
  })
}
export function activablePlugins (params) {
  return request({
    url: '/operationPlugin/query/findPlugin', // 获取可开通插件列表
    method: 'get',
    params
  })
}
export function activate (data) {
  return request({
    url: '/operationTenantService/api/productActivate', // 开通服务
    method: 'post',
    data
  })
}
export function enable (data) {
  return request({
    url: '/tenant/api/enable', // 启用租户
    method: 'post',
    data: data
  })
}
export function disable (data) {
  return request({
    url: '/tenant/api/disable', // 禁用租户
    method: 'post',
    data: data
  })
}
export function operators (data) {
  return request({
    url: '/operator/query/operators', // 查询账户
    method: 'get',
    params: data
  })
}
export function tenantDetail (data) {
  return request({
    url: '/tenant/query/tenantDetail', // 获取租户详情
    method: 'get',
    params: data
  })
}
export function tenantcompIpm (data) {
  return request({
    url: '/tenant/query/getCompIpm', // 获取租户税
    method: 'get',
    params: data
  })
}
export function importFile (data) {
  return request({
    url: '/crewImport/api/import', // 批量导入
    method: 'post',
    data
  })
}
export function coverSeafarers (data) {
  return request({
    url: '/crewImport/api/coverSeafarers', // 批量导入覆盖
    method: 'post',
    data
  })
}
export function createSeafarers (data) {
  return request({
    url: '/crewImport/api/createSeafarers', // 批量导入新增
    method: 'post',
    data
  })
}


//新增接口-------试用租户
export function getTrialList (data) {
  return request({
    url: '/trialTenant/query/getTrialList', // 后台试用租户一览页面
    method: 'get',
    params: data
  })
}
export function getTrialDetail (data) {
  return request({
    url: '/trialTenant/query/tenantDetail', // 试用租户详细页面
    method: 'get',
    params: data
  })
}

// TODO: 提交接口需要确认 / 禁用接口
export function postSubmit (data) {
  return request({
    url: '/trialTenant/api/changeTrialInfo', // 试用租户提交
    method: 'post',
    data
  })
}

export function getTrialHistory (data) {
  return request({
    url: '/tenantOperateHis/query/getOperateHis', // 试用租户详细页面
    method: 'get',
    params: data
  })
}

export function saveAccountData (data) {
  return request({
    url: '/experienceAccount/api/saveAccountData', // 备份账号数据
    method: 'post',
    data
  })
}

export function recoveryAccountData (data) {
  return request({
    url: '/experienceAccount/api/recoveryAccountData', // 还原账号数据
    method: 'post',
    data
  })
}
