import request from '@/utils/request'

// 查询短信接口列表
export function listSmsApi(query) {
  return request({
    url: '/admin/smsApi/list',
    method: 'get',
    params: query
  })
}

// 查询短信接口详情
export function getSmsApi(apiId) {
  return request({
    url: '/admin/smsApi/' + apiId,
    method: 'get'
  })
}

// 新增短信接口
export function addSmsApi(data) {
  return request({
    url: '/admin/smsApi',
    method: 'post',
    data: data
  })
}

// 修改短信接口
export function updateSmsApi(data) {
  return request({
    url: '/admin/smsApi',
    method: 'put',
    data: data
  })
}

// 删除短信接口
export function delSmsApi(apiId) {
  return request({
    url: '/admin/smsApi/' + apiId,
    method: 'delete'
  })
}

// 查询租户绑定列表
export function listSmsApiTenant(query) {
  return request({
    url: '/admin/smsApiTenant/list',
    method: 'get',
    params: query
  })
}

// 查询租户绑定详情
export function getSmsApiTenant(id) {
  return request({
    url: '/admin/smsApiTenant/' + id,
    method: 'get'
  })
}

// 查询租户已绑定的接口
export function getSmsApiTenantByCompany(companyId) {
  return request({
    url: '/admin/smsApiTenant/byCompany/' + companyId,
    method: 'get'
  })
}

// 新增租户绑定
export function addSmsApiTenant(data) {
  return request({
    url: '/admin/smsApiTenant',
    method: 'post',
    data: data
  })
}

// 修改租户绑定
export function updateSmsApiTenant(data) {
  return request({
    url: '/admin/smsApiTenant',
    method: 'put',
    data: data
  })
}

// 解除租户绑定
export function delSmsApiTenant(id) {
  return request({
    url: '/admin/smsApiTenant/' + id,
    method: 'delete'
  })
}
