!620 【功能完善】IOT: 产品物模型

Merge pull request !620 from puhui999/feature/iot
This commit is contained in:
芋道源码
2024-12-16 12:44:31 +00:00
committed by Gitee
13 changed files with 1181 additions and 352 deletions

View File

@ -1,17 +1,41 @@
import request from '@/config/axios'
// IoT 产品物模型 VO
export interface ThinkModelFunctionVO {
id: number // 物模型功能编号
identifier: string // 功能标识
name: string // 功能名称
description: string // 功能描述
productId: number // 产品编号
productKey: string // 产品标识
type: number // 功能类型
property: string // 属性
event: string // 事件
service: string // 服务
/**
* IoT 产品物模型
*/
export interface ThingModelData {
id?: number // 物模型功能编号
identifier?: string // 功能标识
name?: string // 功能名称
description?: string // 功能描述
productId?: number // 产品编号
productKey?: string // 产品标识
dataType: string // 数据类型,与 dataSpecs 的 dataType 保持一致
type: ProductFunctionTypeEnum // 功能类型
property: ThingModelProperty // 属性
event?: ThingModelEvent // 事件
service?: ThingModelService // 服务
}
/**
* ThingModelProperty 类型
*/
export interface ThingModelProperty {
[key: string]: any
}
/**
* ThingModelEvent 类型
*/
export interface ThingModelEvent {
[key: string]: any
}
/**
* ThingModelService 类型
*/
export interface ThingModelService {
[key: string]: any
}
// IOT 产品功能(物模型)类型枚举类
@ -30,39 +54,35 @@ export enum ProductFunctionAccessModeEnum {
// IoT 产品物模型 API
export const ThinkModelFunctionApi = {
// 查询产品物模型分页
getThinkModelFunctionPage: async (params: any) => {
return await request.get({ url: `/iot/think-model-function/page`, params })
getProductThingModelPage: async (params: any) => {
return await request.get({ url: `/iot/product-thing-model/page`, params })
},
// 获得产品物模型
getThinkModelFunctionListByProductId: async (params: any) => {
getProductThingModelListByProductId: async (params: any) => {
return await request.get({
url: `/iot/think-model-function/list-by-product-id`,
url: `/iot/product-thing-model/list-by-product-id`,
params
})
},
// 查询产品物模型详情
getThinkModelFunction: async (id: number) => {
return await request.get({ url: `/iot/think-model-function/get?id=` + id })
getProductThingModel: async (id: number) => {
return await request.get({ url: `/iot/product-thing-model/get?id=` + id })
},
// 新增产品物模型
createThinkModelFunction: async (data: ThinkModelFunctionVO) => {
return await request.post({ url: `/iot/think-model-function/create`, data })
createProductThingModel: async (data: ThingModelData) => {
return await request.post({ url: `/iot/product-thing-model/create`, data })
},
// 修改产品物模型
updateThinkModelFunction: async (data: ThinkModelFunctionVO) => {
return await request.put({ url: `/iot/think-model-function/update`, data })
updateProductThingModel: async (data: ThingModelData) => {
return await request.put({ url: `/iot/product-thing-model/update`, data })
},
// 删除产品物模型
deleteThinkModelFunction: async (id: number) => {
return await request.delete({ url: `/iot/think-model-function/delete?id=` + id })
},
// 导出产品物模型 Excel
exportThinkModelFunction: async (params) => {
return await request.download({ url: `/iot/think-model-function/export-excel`, params })
deleteProductThingModel: async (id: number) => {
return await request.delete({ url: `/iot/product-thing-model/delete?id=` + id })
}
}