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/statistics/index.ts |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/src/api/iot/statistics/index.ts b/src/api/iot/statistics/index.ts
new file mode 100644
index 0000000..cdcb94d
--- /dev/null
+++ b/src/api/iot/statistics/index.ts
@@ -0,0 +1,60 @@
+import request from '@/config/axios'
+
+/** IoT 缁熻鏁版嵁绫诲瀷 */
+export interface IotStatisticsSummaryRespVO {
+  productCategoryCount: number
+  productCount: number
+  deviceCount: number
+  deviceMessageCount: number
+  productCategoryTodayCount: number
+  productTodayCount: number
+  deviceTodayCount: number
+  deviceMessageTodayCount: number
+  deviceOnlineCount: number
+  deviceOfflineCount: number
+  deviceInactiveCount: number
+  productCategoryDeviceCounts: Record<string, number>
+}
+
+/** 鏃堕棿鎴�-鏁板�肩殑閿�煎绫诲瀷 */
+interface TimeValueItem {
+  [key: string]: number
+}
+
+/** IoT 娑堟伅缁熻鏁版嵁绫诲瀷 */
+export interface IotStatisticsDeviceMessageSummaryRespVO {
+  statType: number
+  upstreamCounts: TimeValueItem[]
+  downstreamCounts: TimeValueItem[]
+}
+
+/** 鏂扮殑娑堟伅缁熻鏁版嵁椤� */
+export interface IotStatisticsDeviceMessageSummaryByDateRespVO {
+  time: string
+  upstreamCount: number
+  downstreamCount: number
+}
+
+/** 鏂扮殑娑堟伅缁熻鎺ュ彛鍙傛暟 */
+export interface IotStatisticsDeviceMessageReqVO {
+  interval: number
+  times?: string[]
+}
+
+// IoT 鏁版嵁缁熻 API
+export const StatisticsApi = {
+  // 鏌ヨ鍏ㄥ眬鐨勬暟鎹粺璁�
+  getStatisticsSummary: async () => {
+    return await request.get<IotStatisticsSummaryRespVO>({
+      url: `/iot/statistics/get-summary`
+    })
+  },
+
+  // 鑾峰彇璁惧娑堟伅鐨勬暟鎹粺璁�
+  getDeviceMessageSummaryByDate: async (params: IotStatisticsDeviceMessageReqVO) => {
+    return await request.get<IotStatisticsDeviceMessageSummaryByDateRespVO[]>({
+      url: `/iot/statistics/get-device-message-summary-by-date`,
+      params
+    })
+  }
+}

--
Gitblit v1.8.0