智能小程序开发 —— meature API 汇总(一)

getStatisticsConfig

获取统计配置,获取开通智能计量的 dp 点及配置。

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID

返回值

复制代码
Array<{
  algorithmType: 'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';
  dpId: number;
  productId: string;
  statisticInterval: number;
  storageDuration: number;
}>
参数 数据类型 说明
algorithmType string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum
dpId number dp id
productId string 产品 id
statisticInterval number 统计间隔,数据保存天数,1(天)、2(小时)、4(月)、16(15 分钟)
storageDuration number 数据保存天数

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsConfig } from '@ray-js/ray';
 
getStatisticsConfig({
  devId: 'vdevo166789063330437',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = [
  {
    storageDuration: 365,
    productId: 'lcrxzqjqojafatrv',
    dpId: 18,
    statisticInterval: 1,
    algorithmType: 'avg',
  },
  {
    storageDuration: 365,
    productId: 'lcrxzqjqojafatrv',
    dpId: 1,
    statisticInterval: 1,
    algorithmType: 'count',
  },
  {
    storageDuration: 7,
    productId: 'lcrxzqjqojafatrv',
    dpId: 1,
    statisticInterval: 2,
    algorithmType: 'count',
  },
];

👉 立即开发

getStatisticsRang15min

15min 为时间间隔,获取设备日期区间的统计数据。

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
date string 要查询的日期,yyyyMMdd 格式
type string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsRang15min } from '@ray-js/ray';
 
getStatisticsRang15min({
  devId: 'vdevo161733425146241',
  dpId: '18',
  date: '20230511',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = {
  202105260000: '1312.02',
  202105260015: '1249.49',
  202105262345: '#',
  '...': '...',
};

getStatisticsRangHour

小时 为时间间隔,获取设备日期区间的统计数据。

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
date string 要查询的日期,yyyyMMdd 格式
type string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsRangHour } from '@ray-js/ray';
 
getStatisticsRangHour({
  devId: 'vdevo161733425146241',
  dpId: '18',
  date: '20230511',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = {
  2023051117: '0.00',
  2023051118: '24.00',
  2023051119: '0.00',
  '...': '...',
};

getStatisticsRangDay

天 为时间间隔,获取设备日期区间的统计数据。

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
startDay string 开始日期,yyyyMMdd 格式
endDay string 结束日期, yyyyMMdd 格式
type string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsRangDay } from '@ray-js/ray';
 
getStatisticsRangDay({
  devId: 'vdevo161733425146241',
  dpId: '18',
  startDay: '20230510',
  endDay: '20230511',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = {
  20230501: '0',
  20230502: '0',
  20230503: '0',
  20230504: '0',
  20230505: '0',
  20230506: '0',
  20230507: '0',
  20230508: '0',
  20230509: '0',
  20230510: '26.00',
  20230511: '24.00',
};

getStatisticsRangMonth

月 为时间间隔,获取设备日期区间的统计数据。

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
startMonth string 开始月份,yyyyMMdd 格式
endMonth string 结束月份, yyyyMMdd 格式
type string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsRangMonth } from '@ray-js/ray';
 
getStatisticsRangMonth({
  devId: 'vdevo161733425146241',
  dpId: '18',
  startMonth: '202304',
  endMonth: '202305',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = {
  202304: '0',
  202305: '24.00',
};

👉 立即开发

相关推荐
励志要当大牛的小白菜13 分钟前
ART配对软件使用
开发语言·c++·qt·算法
灵感__idea1 小时前
JavaScript高级程序设计(第5版):好的编程就是掌控感
前端·javascript·程序员
烛阴2 小时前
Mix
前端·webgl
爱装代码的小瓶子2 小时前
数据结构之队列(C语言)
c语言·开发语言·数据结构
代码续发3 小时前
前端组件梳理
前端
试图让你心动3 小时前
原生input添加删除图标类似vue里面移入显示删除[jquery]
前端·vue.js·jquery
_Kayo_3 小时前
VUE2 学习笔记6 vue数据监测原理
vue.js·笔记·学习
陈不知代码4 小时前
uniapp创建vue3+ts+pinia+sass项目
前端·uni-app·sass
小王码农记4 小时前
sass中@mixin与 @include
前端·sass
说私域4 小时前
公域流量向私域流量转化策略研究——基于开源AI智能客服、AI智能名片与S2B2C商城小程序的融合应用
人工智能·小程序