import request from '@/utils/request'

// 查询项目租户关系列表
export function listProject_tenant(query) {
    return request({
        url: '/iot/project_tenant/list',
        method: 'get',
        params: query
    })
}

// 查询项目租户关系详细
export function getProject_tenant(projectId) {
    return request({
        url: '/iot/project_tenant/' + projectId,
        method: 'get'
    })
}

// 新增项目租户关系
export function addProject_tenant(data) {
    return request({
        url: '/iot/project_tenant',
        method: 'post',
        data: data
    })
}

// 修改项目租户关系
export function updateProject_tenant(data) {
    return request({
        url: '/iot/project_tenant',
        method: 'put',
        data: data
    })
}

// 删除项目租户关系
export function delProject_tenant(projectId, tenantId) {
    let reqUrl =  tenantId ? '/' + tenantId : ''
    return request({
        url: '/iot/project_tenant/' + projectId + reqUrl,
        method: 'delete'
    })
}

// 导出项目租户关系
export function exportProject_tenant(query) {
    return request({
        url: '/iot/project_tenant/export',
        method: 'get',
        params: query
    })
}

// 查询没有被绑定的租户
export function listUserdByProjectId(query) {
  return request({
      url: '/iot/project_tenant/not-used',
      method: 'get',
      params: query
  })
}
