package com.slodon.b2b2c.vo.video;

import com.slodon.b2b2c.core.util.FileUrlUtil;
import com.slodon.b2b2c.video.pojo.Author;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 *
 * 封装关注或粉丝对象VO对象
 * @author wuxy
 */
@Data
public class FollowVO implements Serializable {

    private static final long serialVersionUID = 2752456329770837816L;
    @ApiModelProperty("作者id")
    private Integer authorId;

    @ApiModelProperty("会员名称")
    private String memberName;

    @ApiModelProperty("会员昵称")
    private String memberNickname;

    @ApiModelProperty("会员头像")
    private String memberAvatar;

    @ApiModelProperty("简介")
    private String introduction;

    @ApiModelProperty("是否关注")
    private Boolean isFollow = false;

    public FollowVO(Author author) {
        this.authorId = author.getAuthorId();
        this.memberName = author.getMemberName();
        this.memberNickname = author.getMemberNickname();
        this.memberAvatar = author.getMemberAvatar().startsWith("http") ? author.getMemberAvatar() : FileUrlUtil.getFileUrl(author.getMemberAvatar(), null);
        this.introduction = author.getIntroduction();
    }
}
