selectBindServer static method

Future<String> selectBindServer(
  1. String userId,
  2. String deviceId,
  3. int selectStatus
)

APP选中/取消选中默认设备 userId app用户id deviceId 绑定的设备id selectStatus 状态,0-未选中;1-选中

Implementation

static Future<String> selectBindServer(String userId,String deviceId, int selectStatus) async {
  Map<String,String> headers = {
    'tenantId': '10002',
    'token': SpUtil().getString(SpUtil.SP_KEY_ACCESS_TOKEN) ?? '',
    'appSource': 'Maxims',
    'reqSource': '1',
  };
  int timestamp = DateTime.now().millisecondsSinceEpoch;

  Map<String,dynamic> params = {
    'userId': userId,
    'deviceId': deviceId,
    'status': selectStatus,
    'timestamp': timestamp,
    'appKey': BaseHttpConstant.APP_BIND_SERVER_KEY,
  };
  String sign = CipherUtil.generateSignature2(params, [], BaseHttpConstant.APP_BIND_SERVER_SECRET);
  params['sign'] = sign;
  Options options = Options(
    headers: headers,
    contentType: Headers.multipartFormDataContentType,
  );
  var result = await HttpUtils.post(true, Api.PATH_APP_BIND_SERVER,
      data: FormData.fromMap(params),
      options: options);
  return formatResponse(result);
}