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