customXUpdate method

Future<EasyPacket<CustomX>> customXUpdate({
  1. required int no,
  2. required dynamic id,
  3. required Map<String, dynamic> fields,
  4. bool update = false,
  5. bool body1 = false,
  6. bool body2 = false,
  7. bool body3 = false,
})

更新自定义数据,no为数据集合分类序号,update为true时,会将CustomX.update字段更新为当前时间

body1为false时返回数据不包含CustomX.body1字段,body2为false时返回数据不包含CustomX.body2字段,body3为false时返回数据不包含CustomX.body3字段

Implementation

Future<EasyPacket<CustomX>> customXUpdate({required int no, required ObjectId id, required Map<String, dynamic> fields, bool update = false, bool body1 = false, bool body2 = false, bool body3 = false}) async {
  final response = await _aliveClient.websocketRequest('customXUpdate', data: {'bsid': bsid, 'no': no, 'id': id, 'fields': fields, 'update': update, 'body1': body1, 'body2': body2, 'body3': body3});
  if (response.ok) {
    return response.cloneExtra(
      CustomX.fromJson(response.data!['customx'])
        ..cusmark = response.data!['cusmark'] == null ? null : Cusmark.fromJson(response.data!['cusmark'])
        ..cusstar = response.data!['cusstar'] == null ? null : Cusstar.fromJson(response.data!['cusstar']),
    );
  } else {
    return response.cloneExtra(null);
  }
}