import request from "@/utils/request";

// 查询型号列表
export function listModel(query) {
  return request({
    url: "/iot/model/list",
    method: "get",
    params: query
  });
}

// 查询型号详细
export function getModel(modelId) {
  return request({
    url: "/iot/model/" + modelId,
    method: "get"
  });
}

// 新增型号
export function addModel(data) {
  return request({
    url: "/iot/model",
    method: "post",
    data: data
  });
}

// 修改型号
export function updateModel(data) {
  return request({
    url: "/iot/model",
    method: "put",
    data: data
  });
}

// 删除型号
export function delModel(modelId) {
  return request({
    url: "/iot/model/" + modelId,
    method: "delete"
  });
}

// 导出型号
export function exportModel(query) {
  return request({
    url: "/iot/model/export",
    method: "get",
    params: query
  });
}

// 获取平台产品列表
export function listProductList(query) {
  return request({
    url: "/iot/model/prod-list",
    method: "get",
    params: query
  });
}

// 协议类型
export function listModelType() {
  return request({
    url: "/iot/model/type-list",
    method: "get"
  });
}
