package com.gic.haoban.manage.web.vo.content;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.io.Serializable;

public class ContentMaterialDataVO implements Serializable {

    /**
     * 素材id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long contentMaterialId;

    /**
     * 点赞数
     */
    private Integer likeCount = 0;

    /**
     * 是否已点赞 1是0否
     */
    private Integer likeFlag = 0;

    /**
     * 评论次数
     */
    private Integer cmtCnt = 0;

    /**
     * 阅读次数
     */
    private Integer readCnt = 0;

    public Long getContentMaterialId() {
        return contentMaterialId;
    }

    public void setContentMaterialId(Long contentMaterialId) {
        this.contentMaterialId = contentMaterialId;
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    public Integer getLikeFlag() {
        return likeFlag;
    }

    public void setLikeFlag(Integer likeFlag) {
        this.likeFlag = likeFlag;
    }

    public Integer getCmtCnt() {
        return cmtCnt;
    }

    public void setCmtCnt(Integer cmtCnt) {
        this.cmtCnt = cmtCnt;
    }

    public Integer getReadCnt() {
        return readCnt;
    }

    public void setReadCnt(Integer readCnt) {
        this.readCnt = readCnt;
    }

    public void setDataVO(ContentMaterialDataVO dataVO) {
        if (dataVO == null) {
            this.setLikeCount(0);
            this.setCmtCnt(0);
            this.setReadCnt(0);
            return;
        }
        this.setLikeCount(dataVO.getLikeCount());
        this.setCmtCnt(dataVO.getCmtCnt());
        this.setReadCnt(dataVO.getReadCnt());
    }
}
