aslan-flutter/lib/chatvibe_domain/models/res/at_room_emoji_res.dart
2026-07-01 18:25:58 +08:00

146 lines
3.3 KiB
Dart

/// id : 0
/// sysOrigin : ""
/// groupCode : ""
/// groupName : ""
/// cover : ""
/// have : false
/// amount : 0.0
/// emojis : [{"sourceUrl":"","sourceType":0,"coverUrl":"","type":""}]
class ATRoomEmojiRes {
ATRoomEmojiRes({
String? id,
String? sysOrigin,
String? groupCode,
String? groupName,
String? cover,
bool? have,
num? amount,
List<Emojis>? emojis,}){
_id = id;
_sysOrigin = sysOrigin;
_groupCode = groupCode;
_groupName = groupName;
_cover = cover;
_have = have;
_amount = amount;
_emojis = emojis;
}
ATRoomEmojiRes.fromJson(dynamic json) {
_id = json['id'];
_sysOrigin = json['sysOrigin'];
_groupCode = json['groupCode'];
_groupName = json['groupName'];
_cover = json['cover'];
_have = json['have'];
_amount = json['amount'];
if (json['emojis'] != null) {
_emojis = [];
json['emojis'].forEach((v) {
_emojis?.add(Emojis.fromJson(v));
});
}
}
String? _id;
String? _sysOrigin;
String? _groupCode;
String? _groupName;
String? _cover;
bool? _have;
num? _amount;
List<Emojis>? _emojis;
ATRoomEmojiRes copyWith({ String? id,
String? sysOrigin,
String? groupCode,
String? groupName,
String? cover,
bool? have,
num? amount,
List<Emojis>? emojis,
}) => ATRoomEmojiRes( id: id ?? _id,
sysOrigin: sysOrigin ?? _sysOrigin,
groupCode: groupCode ?? _groupCode,
groupName: groupName ?? _groupName,
cover: cover ?? _cover,
have: have ?? _have,
amount: amount ?? _amount,
emojis: emojis ?? _emojis,
);
String? get id => _id;
String? get sysOrigin => _sysOrigin;
String? get groupCode => _groupCode;
String? get groupName => _groupName;
String? get cover => _cover;
bool? get have => _have;
num? get amount => _amount;
List<Emojis>? get emojis => _emojis;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['sysOrigin'] = _sysOrigin;
map['groupCode'] = _groupCode;
map['groupName'] = _groupName;
map['cover'] = _cover;
map['have'] = _have;
map['amount'] = _amount;
if (_emojis != null) {
map['emojis'] = _emojis?.map((v) => v.toJson()).toList();
}
return map;
}
}
/// sourceUrl : ""
/// sourceType : 0
/// coverUrl : ""
/// type : ""
class Emojis {
Emojis({
String? sourceUrl,
num? sourceType,
String? coverUrl,
String? type,}){
_sourceUrl = sourceUrl;
_sourceType = sourceType;
_coverUrl = coverUrl;
_type = type;
}
Emojis.fromJson(dynamic json) {
_sourceUrl = json['sourceUrl'];
_sourceType = json['sourceType'];
_coverUrl = json['coverUrl'];
_type = json['type'];
}
String? _sourceUrl;
num? _sourceType;
String? _coverUrl;
String? _type;
Emojis copyWith({ String? sourceUrl,
num? sourceType,
String? coverUrl,
String? type,
}) => Emojis( sourceUrl: sourceUrl ?? _sourceUrl,
sourceType: sourceType ?? _sourceType,
coverUrl: coverUrl ?? _coverUrl,
type: type ?? _type,
);
String? get sourceUrl => _sourceUrl;
num? get sourceType => _sourceType;
String? get coverUrl => _coverUrl;
String? get type => _type;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['sourceUrl'] = _sourceUrl;
map['sourceType'] = _sourceType;
map['coverUrl'] = _coverUrl;
map['type'] = _type;
return map;
}
}