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

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