package com.fs.qw.vo;

import com.fs.qw.domain.QwContact;
import com.fs.qw.domain.QwMessage;
import com.fs.qw.domain.QwUser;
import lombok.Data;

@Data
public class QwMessageListVO {
    private String id;
    private String status;
    private String type;
    private Long sendTime;
    private String content;
    private String url;
    private Long fileSize;
    private String fileName;
    private Integer fileShowType;
    private String imageUrl;
    private Integer duration; //时长
    private String toContactId;
    private QWFromUser fromUser;

    //获取fromUser
    public  QWFromUser getQwFromUser(Long senderId,QwUser qwUser,QwContact qwContact){
        QWFromUser fromUser=new QWFromUser();
        fromUser.setId(senderId);
        if(qwUser!=null){
            fromUser.setAvatar(qwUser.getAvatar());
            fromUser.setDisplayName(qwUser.getNickName());
        }else{
            fromUser.setAvatar(qwContact.getAvatar());
            fromUser.setDisplayName(qwContact.getNickName());
        }
        return fromUser;
    }

}






