/// records : [{"id":"","dynamicId":"","userAvatar":"","userNickname":"","userSex":0,"userId":"","toUserId":"","toUserNickname":"","content":"","likeStrQuantity":"","createTime":0,"like":false,"rootCommentId":0}]
/// total : 0
/// size : 0
/// current : 0

class SCCommentListRes {
  SCCommentListRes({
    List<CommentListRecords>? records,
    num? total,
    num? size,
    num? current,
  }) {
    _records = records;
    _total = total;
    _size = size;
    _current = current;
  }

  SCCommentListRes.fromJson(dynamic json) {
    if (json['records'] != null) {
      _records = [];
      json['records'].forEach((v) {
        _records?.add(CommentListRecords.fromJson(v));
      });
    }
    _total = json['total'];
    _size = json['size'];
    _current = json['current'];
  }

  List<CommentListRecords>? _records;
  num? _total;
  num? _size;
  num? _current;

  List<CommentListRecords>? get records => _records;

  num? get total => _total;

  num? get size => _size;

  num? get current => _current;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (_records != null) {
      map['records'] = _records?.map((v) => v.toJson()).toList();
    }
    map['total'] = _total;
    map['size'] = _size;
    map['current'] = _current;
    return map;
  }
}

/// id : ""
/// dynamicId : ""
/// userAvatar : ""
/// userNickname : ""
/// userSex : 0
/// userId : ""
/// toUserId : ""
/// toUserNickname : ""
/// content : ""
/// likeStrQuantity : ""
/// createTime : 0
/// like : false
/// rootCommentId : 0

class CommentListRecords {
  CommentListRecords({
    String? id,
    String? dynamicId,
    String? userAvatar,
    String? userNickname,
    num? userSex,
    String? userId,
    String? toUserId,
    String? toUserNickname,
    String? content,
    String? likeStrQuantity,
    String? commentStrQuantity,
    int? createTime,
    bool? like,
    num? rootCommentId,
    num? replyCommentId,
    num? childCommentCount,
  }) {
    _id = id;
    _dynamicId = dynamicId;
    _userAvatar = userAvatar;
    _userNickname = userNickname;
    _userSex = userSex;
    _userId = userId;
    _toUserId = toUserId;
    _toUserNickname = toUserNickname;
    _content = content;
    _likeStrQuantity = likeStrQuantity;
    _commentStrQuantity = commentStrQuantity;
    _createTime = createTime;
    _like = like;
    _rootCommentId = rootCommentId;
    _replyCommentId = replyCommentId;
    _childCommentCount = childCommentCount;
  }

  CommentListRecords.fromJson(dynamic json) {
    _id = json['id'];
    _dynamicId = json['dynamicId'];
    _userAvatar = json['userAvatar'];
    _userNickname = json['userNickname'];
    _userSex = json['userSex'];
    _userId = json['userId'];
    _toUserId = json['toUserId'];
    _toUserNickname = json['toUserNickname'];
    _content = json['content'];
    _likeStrQuantity = json['likeStrQuantity'];
    _commentStrQuantity = json['commentStrQuantity'];
    _createTime = json['createTime'];
    _like = json['like'];
    _rootCommentId = json['rootCommentId'];
    _replyCommentId = json['replyCommentId'];
    _childCommentCount = json['childCommentCount'];
  }

  String? _id;
  String? _dynamicId;
  String? _userAvatar;
  String? _userNickname;
  num? _userSex;
  String? _userId;
  String? _toUserId;
  String? _toUserNickname;
  String? _content;
  String? _likeStrQuantity;
  String? _commentStrQuantity;
  int? _createTime;
  bool? _like;
  num? _rootCommentId;
  num? _replyCommentId;
  num? _childCommentCount;

  String? get id => _id;

  String? get dynamicId => _dynamicId;

  String? get userAvatar => _userAvatar;

  String? get userNickname => _userNickname;

  num? get userSex => _userSex;

  String? get userId => _userId;

  String? get toUserId => _toUserId;

  String? get toUserNickname => _toUserNickname;

  String? get content => _content;

  String? get likeStrQuantity => _likeStrQuantity;

  String? get commentStrQuantity => _commentStrQuantity;

  int? get createTime => _createTime;

  bool? get like => _like;

  num? get rootCommentId => _rootCommentId;

  num? get replyCommentId => _replyCommentId;

  num? get childCommentCount => _childCommentCount;

  setChildCommentCount(num count) {
    _childCommentCount = count;
  }

  setLike(bool like) {
    _like = like;
  }

  setLikeStrQuantity(String likeStrQuantity) {
    _likeStrQuantity = likeStrQuantity;
  }

  setUserNickname(String name) {
    _userNickname = name;
  }

  setUserAvatar(String avatar) {
    _userAvatar = avatar;
  }

  setUserSex(num sex) {
    _userSex = sex;
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['dynamicId'] = _dynamicId;
    map['userAvatar'] = _userAvatar;
    map['userNickname'] = _userNickname;
    map['userSex'] = _userSex;
    map['userId'] = _userId;
    map['toUserId'] = _toUserId;
    map['toUserNickname'] = _toUserNickname;
    map['content'] = _content;
    map['likeStrQuantity'] = _likeStrQuantity;
    map['commentStrQuantity'] = _commentStrQuantity;
    map['createTime'] = _createTime;
    map['like'] = _like;
    map['rootCommentId'] = _rootCommentId;
    map['childCommentCount'] = _childCommentCount;
    return map;
  }
}
