fromJsonZhipuAI static method

MessageZhipuAI fromJsonZhipuAI(
  1. dynamic json
)

Implementation

static MessageZhipuAI fromJsonZhipuAI(dynamic json) {
  //
  MessageZhipuAI messageZhipuAI = MessageZhipuAI(
    mid: json['mid'],
    content: json['content'],
    imageUrl: json['imageUrl'],
    voiceUrl: json['voiceUrl'],
    fileUrl: json['fileUrl'],
    videoUrl: json['videoOrShortUrl'],
    nickname: json['user']['nickname'],
    avatar: json['user']['avatar'],
    type: json['type'],
    timestamp: json['createdAt'],
    client: json['client'],
    isSend: 0,
    currentUid: SpUtil.getString(BytedeskConstants.uid),
    thread: ThreadZhipuAI.fromVisitorJson(json['thread']),
    user: User.fromJson(json['user']),
  );
  if (messageZhipuAI.currentUid == messageZhipuAI.user!.uid) {
    messageZhipuAI.isSend = 1;
  }
  return messageZhipuAI;
}