import request from '@/utils/request'

// 查询平台下拉树结构
export function treeselect() {
  return request({
    url: '/tuya/sitesinfo/treeselect',
    method: 'get'
  })
}

// 查询平台下拉列表
export function selectlist() {
  return request({
    url: '/tuya/sitesinfo/selectlist',
    method: 'get'
  })
}

// 查询模块信息列表
export function listChannelinfo(query) {
  return request({
    url: '/tuya/channelinfo/list',
    method: 'get',
    params: query
  })
}

// 查询模块信息详细
export function getChannelinfo(channelId) {
  return request({
    url: '/tuya/channelinfo/' + channelId,
    method: 'get'
  })
}

// 新增模块信息
export function addChannelinfo(data) {
  return request({
    url: '/tuya/channelinfo',
    method: 'post',
    data: data
  })
}

// 修改模块信息
export function updateChannelinfo(data) {
  return request({
    url: '/tuya/channelinfo',
    method: 'put',
    data: data
  })
}

// 删除模块信息
export function delChannelinfo(channelId) {
  return request({
    url: '/tuya/channelinfo/' + channelId,
    method: 'delete'
  })
}
