index.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import request from '@/config/axios'
  2. /** IoT 统计数据类型 */
  3. export interface IotStatisticsSummaryRespVO {
  4. productCategoryCount: number
  5. productCount: number
  6. deviceCount: number
  7. deviceMessageCount: number
  8. productCategoryTodayCount: number
  9. productTodayCount: number
  10. deviceTodayCount: number
  11. deviceMessageTodayCount: number
  12. deviceOnlineCount: number
  13. deviceOfflineCount: number
  14. deviceInactiveCount: number
  15. productCategoryDeviceCounts: Record<string, number>
  16. }
  17. /** IoT 消息统计数据类型 */
  18. export interface IotStatisticsDeviceMessageSummaryRespVO {
  19. upstreamCounts: Record<number, number>
  20. downstreamCounts: Record<number, number>
  21. }
  22. // IoT 数据统计 API
  23. export const ProductCategoryApi = {
  24. // 查询基础的数据统计
  25. getIotStatisticsSummary: async () => {
  26. return await request.get<IotStatisticsSummaryRespVO>({
  27. url: `/iot/statistics/get-summary`
  28. })
  29. },
  30. // 查询设备上下行消息的数据统计
  31. getIotStatisticsDeviceMessageSummary: async (params: { startTime: number; endTime: number }) => {
  32. return await request.get<IotStatisticsDeviceMessageSummaryRespVO>({
  33. url: `/iot/statistics/get-log-summary`,
  34. params
  35. })
  36. }
  37. }