2023-02-11 00:44:00 +08:00
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
export interface TenantVO {
|
|
|
|
id: number
|
|
|
|
name: string
|
|
|
|
contactName: string
|
|
|
|
contactMobile: string
|
|
|
|
status: number
|
|
|
|
domain: string
|
|
|
|
packageId: number
|
|
|
|
username: string
|
|
|
|
password: string
|
|
|
|
expireTime: Date
|
|
|
|
accountCount: number
|
|
|
|
createTime: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TenantPageReqVO extends PageParam {
|
|
|
|
name?: string
|
|
|
|
contactName?: string
|
|
|
|
contactMobile?: string
|
|
|
|
status?: number
|
|
|
|
createTime?: Date[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TenantExportReqVO {
|
|
|
|
name?: string
|
|
|
|
contactName?: string
|
|
|
|
contactMobile?: string
|
|
|
|
status?: number
|
|
|
|
createTime?: Date[]
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询租户列表
|
2023-03-23 09:42:53 +08:00
|
|
|
export const getTenantPage = (params: TenantPageReqVO) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return request.get({ url: '/system/tenant/page', params })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询租户详情
|
2023-03-23 09:42:53 +08:00
|
|
|
export const getTenant = (id: number) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return request.get({ url: '/system/tenant/get?id=' + id })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 新增租户
|
2023-03-23 09:42:53 +08:00
|
|
|
export const createTenant = (data: TenantVO) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return request.post({ url: '/system/tenant/create', data })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 修改租户
|
2023-03-23 09:42:53 +08:00
|
|
|
export const updateTenant = (data: TenantVO) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return request.put({ url: '/system/tenant/update', data })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除租户
|
2023-03-23 09:42:53 +08:00
|
|
|
export const deleteTenant = (id: number) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return request.delete({ url: '/system/tenant/delete?id=' + id })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 导出租户
|
2023-03-23 09:42:53 +08:00
|
|
|
export const exportTenant = (params: TenantExportReqVO) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return request.download({ url: '/system/tenant/export-excel', params })
|
|
|
|
}
|