Randcode constructor

Randcode({
  1. dynamic id,
  2. dynamic bsid,
  3. int? time,
  4. DbJsonWraper? extra,
  5. List? trans,
  6. String? phone,
  7. String? code,
  8. bool? expired,
  9. int? timeout,
  10. int? testcnt,
})

Implementation

Randcode({
  ObjectId? id,
  ObjectId? bsid,
  int? time,
  DbJsonWraper? extra,
  List<ObjectId>? trans,
  String? phone,
  String? code,
  bool? expired,
  int? timeout,
  int? testcnt,
})  : _id = id ?? ObjectId(),
      _bsid = bsid ?? ObjectId.fromHexString('000000000000000000000000'),
      _time = time ?? DateTime.now().millisecondsSinceEpoch,
      _extra = extra ?? DbJsonWraper(),
      _trans = trans ?? [],
      phone = phone ?? '',
      code = code ?? '',
      expired = expired ?? false,
      timeout = timeout ?? 0,
      testcnt = testcnt ?? 0;