toJson method
Implementation
Map<String, dynamic> toJson() => {
'id': id,
'content': content,
'createdAt': createdAt,
'ownerName': ownerName,
//数据库存储不支持复合类型
'ownerType': ownerType.toString(),
'avatar': avatar
};