From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目

---
 src/api/iot/product/product/index.ts |   86 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/src/api/iot/product/product/index.ts b/src/api/iot/product/product/index.ts
new file mode 100644
index 0000000..c9f273e
--- /dev/null
+++ b/src/api/iot/product/product/index.ts
@@ -0,0 +1,86 @@
+import request from '@/config/axios'
+
+// IoT 浜у搧 VO
+export interface ProductVO {
+  id: number // 浜у搧缂栧彿
+  name: string // 浜у搧鍚嶇О
+  productKey: string // 浜у搧鏍囪瘑
+  protocolId: number // 鍗忚缂栧彿
+  categoryId: number // 浜у搧鎵�灞炲搧绫绘爣璇嗙
+  categoryName?: string // 浜у搧鎵�灞炲搧绫诲悕绉�
+  icon: string // 浜у搧鍥炬爣
+  picUrl: string // 浜у搧鍥剧墖
+  description: string // 浜у搧鎻忚堪
+  status: number // 浜у搧鐘舵��
+  deviceType: number // 璁惧绫诲瀷
+  locationType: number // 璁惧绫诲瀷
+  netType: number // 鑱旂綉鏂瑰紡
+  codecType: string // 鏁版嵁鏍煎紡锛堢紪瑙g爜鍣ㄧ被鍨嬶級
+  deviceCount: number // 璁惧鏁伴噺
+  createTime: Date // 鍒涘缓鏃堕棿
+}
+
+// IOT 浜у搧璁惧绫诲瀷鏋氫妇绫� 0: 鐩磋繛璁惧, 1: 缃戝叧瀛愯澶�, 2: 缃戝叧璁惧
+export enum DeviceTypeEnum {
+  DEVICE = 0, // 鐩磋繛璁惧
+  GATEWAY_SUB = 1, // 缃戝叧瀛愯澶�
+  GATEWAY = 2 // 缃戝叧璁惧
+}
+// IOT 浜у搧瀹氫綅绫诲瀷鏋氫妇绫� 0: 鎵嬪姩瀹氫綅, 1: IP 瀹氫綅, 2: 瀹氫綅妯″潡瀹氫綅
+export enum LocationTypeEnum {
+  IP = 1, // IP 瀹氫綅
+  MODULE = 2, // 璁惧瀹氫綅
+  MANUAL = 3 // 鎵嬪姩瀹氫綅
+}
+// IOT 鏁版嵁鏍煎紡锛堢紪瑙g爜鍣ㄧ被鍨嬶級鏋氫妇绫�
+export enum CodecTypeEnum {
+  ALINK = 'Alink' // 闃块噷浜� Alink 鍗忚
+}
+
+// IoT 浜у搧 API
+export const ProductApi = {
+  // 鏌ヨ浜у搧鍒嗛〉
+  getProductPage: async (params: any) => {
+    return await request.get({ url: `/iot/product/page`, params })
+  },
+
+  // 鏌ヨ浜у搧璇︽儏
+  getProduct: async (id: number) => {
+    return await request.get({ url: `/iot/product/get?id=` + id })
+  },
+
+  // 鏂板浜у搧
+  createProduct: async (data: ProductVO) => {
+    return await request.post({ url: `/iot/product/create`, data })
+  },
+
+  // 淇敼浜у搧
+  updateProduct: async (data: ProductVO) => {
+    return await request.put({ url: `/iot/product/update`, data })
+  },
+
+  // 鍒犻櫎浜у搧
+  deleteProduct: async (id: number) => {
+    return await request.delete({ url: `/iot/product/delete?id=` + id })
+  },
+
+  // 瀵煎嚭浜у搧 Excel
+  exportProduct: async (params) => {
+    return await request.download({ url: `/iot/product/export-excel`, params })
+  },
+
+  // 鏇存柊浜у搧鐘舵��
+  updateProductStatus: async (id: number, status: number) => {
+    return await request.put({ url: `/iot/product/update-status?id=` + id + `&status=` + status })
+  },
+
+  // 鏌ヨ浜у搧锛堢簿绠�锛夊垪琛�
+  getSimpleProductList() {
+    return request.get({ url: '/iot/product/simple-list' })
+  },
+
+  // 鏍规嵁 ProductKey 鑾峰彇浜у搧淇℃伅
+  getProductByKey: async (productKey: string) => {
+    return await request.get({ url: `/iot/product/get-by-key`, params: { productKey } })
+  }
+}

--
Gitblit v1.8.0