import { HcApi } from '../../request/index'

export default {
    async page(form) {
        return HcApi({
            url: '/api/blade-system/tenant/list',
            method: 'get',
            params: form,
        })
    },
    //菜单详情
    async detail(id) {
        return HcApi({
            url: '/api/blade-system/tenant/detail',
            method: 'get',
            params: { id },
        })
    },
    async submit(form) {
        return HcApi({
            url: '/api/blade-system/tenant/submit',
            method: 'post',
            data: form,
        })
    },
    async del(ids) {
        return HcApi({
            url: '/api/blade-system/tenant/remove',
            method: 'post',
            params: { ids },
        })
    },
    async setting(form) {
        return HcApi({
            url: '/api/blade-system/tenant/setting',
            method: 'post',
            params: form,
        })
    },
    async datasource(tenantId, datasourceId) {
        return HcApi({
            url: '/api/blade-system/tenant/datasource',
            method: 'post',
            params: { tenantId, datasourceId },
        })
    },
    async info(domain) {
        return HcApi({
            url: '/api/blade-system/tenant/info',
            method: 'get',
            params: { domain },
        })
    },
    async packageInfo(tenantId) {
        return HcApi({
            url: '/api/blade-system/tenant/package-detail',
            method: 'get',
            params: { tenantId },
        })
    },
    async packageSetting(tenantId, packageId) {
        return HcApi({
            url: '/api/blade-system/tenant/package-setting',
            method: 'post',
            params: { tenantId, packageId },
        })
    },
    async getSelect() {
        return HcApi({
            url: '/api/blade-system/tenant/select',
            method: 'get',
            params: {},
        })
    },
}
