setDeviceFrequency static method

Future<String> setDeviceFrequency(
  1. String frequency
)

获取绑定设备信息 userId app用户id

Implementation

static Future<String> setDeviceFrequency(String frequency) async {
  Map<String,String> headers = {
    'tenantId': '1845f6e58516a7f96058cfb1d2031cf8',
  };
  int timestamp = DateTime.now().millisecondsSinceEpoch;
  String randomStr = CipherUtil.generateRandomString(6);
  Map<String,dynamic> params = {
    'timestamp': timestamp,
    'nonceStr': randomStr,
    'appKey': BaseHttpConstant.APP_DEVICE_STATE_KEY,
    'data': jsonDecode(frequency),
  };
  String sign = CipherUtil.generateSignature2(params, ["data"], BaseHttpConstant.APP_DEVICE_STATE_SECRET);
  params['sign'] = sign;
  Options options = Options(
    headers: headers,
    contentType: Headers.jsonContentType,
  );
  var result = await HttpUtils.post(false,Api.PATH_SET_DEVICE_FREQUENCY,
      data: params,
      options: options);
  return ApiCm005.formatResponse(result);
}