import request from '@/utils/request';
//新增租户套餐
export function addTenantPackage(param) {
  return request({
    url: '/system/tenant/package',
    method: 'POST',
    data: param
  });
}
//修改租户套餐
export function saveTenantPackage(param) {
  return request({
    url: '/system/tenant/package/',
    method: 'PUT',
    data: param
  });
}
//获取租户套餐
export function detailTenantPackage(packageId) {
  return request({
    url: '/system/tenant/package/' + packageId,
    method: 'get',
  });
}
//删除租户套餐
export function deleteTenantPackage(packageId) {
  return request({
    url: '/system/tenant/package/' + packageId,
    method: 'DELETE',
  });
}
//租户套餐列表
export function getTenantPackage(param) {
  return request({
    url: '/system/tenant/package/list',
    method: 'get',
    params: param
  });
}
//同步企业方案
export function syncTenantPackage(param) {
  return request({
    url: '/system/tenant/syncTenantPackage',
    method: 'get',
    params: param
  });
}

//租户列表
export function getTenantList(param) {
  return request({
    url: '/system/tenant/list',
    method: 'get',
    params: param
  });
}

//获取租户详情
export function getTenant(id) {
  return request({
    url: '/system/tenant/' + id,
    method: 'get',
  });
}

//修改租户
export function editTenant(data) {
  return request({
    url: '/system/tenant/',
    method: 'PUT',
    data: data,
  });
}
//新增租户
export function saveTenant(data) {
  return request({
    url: '/system/tenant/',
    method: 'POST',
    data: data,
  });
}
//删除租户
export function deleteTenant(ids) {
  return request({
    url: '/system/tenant/' + ids,
    method: 'Delete',
  });
}
//租户请求企业套餐下拉
export function selectTenant(ids) {
  return request({
    url: '/system/tenant/package/selectList',
    method: 'Get',
  });
}

/**
 * 企业管理新增账号
 * @param {object} data 
 * @returns 
 */
export const enterpriseAddAccountApi = (data) => request({
  url: "/system/tenant/addTenantAdmin",
  method: "post",
  data
});

/**
 * 租户ID查询大司空超管or租户管理员为其创建的企业管理员和管理员账号数量
 * @param {*} tenantId 
 * @returns 
 */
export const getEnterpriseAddAccountCountApi = (tenantId) => request({
  url: `/system/user/queryTenantAdminNumCreatedByDSK/${tenantId}`,
  method: "get"
})



