import { request } from "@umijs/max";

export interface TenantPackageVO {
  id: number;
  name: string;
  status: number;
  remark: string;
  creator: string;
  updater: string;
  updateTime: string;
  menuIds: number[];
  createTime: Date;
}


export interface TenantPackagePageReqVO extends PageParam {
  name?: string;
  contactName?: string;
  contactMobile?: string;
  status?: number;
  createTime?: Date[];
}

// 查询租户套餐列表
// export const getTenantPackagePage = (params: PageParam) => {
//   return request.get({ url: '/system/tenant-package/page', params })
// }

export async function getTenantPackagePage(params: TenantPackagePageReqVO) {
  return request("/system/tenant-package/page", {
    method: "GET",
    params,
  });
}

// 获得租户
// export const getTenantPackage = (id: number) => {
//   return request.get({ url: '/system/tenant-package/get?id=' + id })
// }
export async function getTenantPackage(id: number) {
  return request("/system/tenant-package", {
    method: "GET",
    params: { id },
  });
}
// 新增租户套餐
// export const createTenantPackage = (data: TenantPackageVO) => {
//   return request.post({ url: '/system/tenant-package/create', data })
// }
export async function createTenantPackage(data: TenantPackageVO) {
  return request("/system/tenant-package/create", {
    method: "POST",
    data,
  });
}
// 修改租户套餐
// export const updateTenantPackage = (data: TenantPackageVO) => {
//   return request.put({ url: "/system/tenant-package/update", data });
// };
export async function updateTenantPackage(data: TenantPackageVO) {
  return request("/system/tenant-package/update", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data,
  });
}
// 删除租户套餐
// export const deleteTenantPackage = (id: number) => {
//   return request.delete({ url: '/system/tenant-package/delete?id=' + id })
// }
export async function deleteTenantPackage(id: number) {
  return request("/system/tenant-package/delete", {
    method: "DELETE",
    params: {
      id,
    },
  });
}

// 获取租户套餐精简信息列表
// export const getTenantPackageList = () => {
//   return request.get({ url: '/system/tenant-package/simple-list' })
// }

export async function getTenantPackageList() {
  return request("/system/tenant-package/simple-list", {
    method: "GET",
  });
}
