package cn.com.ctop.crawler.modules.kuaishoucce.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.util.Date;

/**
 * 快手效果广告信息
 *
 * @author jeecg-boot
 * @version V1.0
 * @date 2020-03-02
 */
@Data
@TableName("kuaishou_effect_ad_info")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "kuaishou_effect_ad_info对象", description = "快手效果广告信息")
public class KuaishouEffectAdInfo {
    @TableId()
    private Long id;
    /**
     * mainMvUrl
     */
    @Excel(name = "mainMvUrl", width = 15)
    @ApiModelProperty(value = "mainMvUrl")
    private String mainMvUrl;
    /**
     * coverThumbnailUrl
     */
    @Excel(name = "coverThumbnailUrl", width = 15)
    @ApiModelProperty(value = "coverThumbnailUrl")
    private String coverThumbnailUrl;
    /**
     * photoId
     */
    @Excel(name = "photoId", width = 15)
    @ApiModelProperty(value = "photoId")
    private Long photoId;
    /**
     * width
     */
    @Excel(name = "width", width = 15)
    @ApiModelProperty(value = "width")
    private Integer width;
    /**
     * height
     */
    @Excel(name = "height", width = 15)
    @ApiModelProperty(value = "height")
    private Integer height;
    /**
     * videoDuration
     */
    @Excel(name = "videoDuration", width = 15)
    @ApiModelProperty(value = "videoDuration")
    private Integer videoDuration;
    /**
     * adminTime
     */
    @Excel(name = "adminTime", width = 15)
    @ApiModelProperty(value = "adminTime")
    private Long adminTime;
    /**
     * likeRatio
     */
    @Excel(name = "likeRatio", width = 15)
    @ApiModelProperty(value = "likeRatio")
    private java.math.BigDecimal likeRatio;
    /**
     * likeCount
     */
    @Excel(name = "likeCount", width = 15)
    @ApiModelProperty(value = "likeCount")
    private Long likeCount;
    /**
     * timeGrowthRatio
     */
    @Excel(name = "timeGrowthRatio", width = 15)
    @ApiModelProperty(value = "timeGrowthRatio")
    private java.math.BigDecimal timeGrowthRatio;
    /**
     * theme
     */
    @Excel(name = "theme", width = 15)
    @ApiModelProperty(value = "theme")
    private String theme;
    /**
     * text
     */
    @Excel(name = "text", width = 15)
    @ApiModelProperty(value = "text")
    private String text;
    /**
     * caption
     */
    @Excel(name = "caption", width = 15)
    @ApiModelProperty(value = "caption")
    private String caption;
    /**
     * source
     */
    @Excel(name = "source", width = 15)
    @ApiModelProperty(value = "source")
    private String source;
    /**
     * bannerUrl
     */
    @Excel(name = "bannerUrl", width = 15)
    @ApiModelProperty(value = "bannerUrl")
    private String bannerUrl;
    /**
     * majorIndustryName
     */
    @Excel(name = "majorIndustryName", width = 15)
    @ApiModelProperty(value = "majorIndustryName")
    private String majorIndustryName;
    /**
     * createTime
     */
    @ApiModelProperty(value = "createTime")
    private Date createTime;
    /**
     * updateTime
     */
    @ApiModelProperty(value = "updateTime")
    private Date updateTime;

    public KuaishouEffectAdInfo() {
    }

    public KuaishouEffectAdInfo(JSONObject data) {
        this.id = data.getLong("contentId");
        this.mainMvUrl = data.getJSONArray("mainMvUrls").getJSONObject(0).getString("url");
        this.coverThumbnailUrl = data.getJSONArray("coverThumbnailUrls").getJSONObject(0).getString("url");
        this.photoId = data.getLong("photoId");
        this.width = data.getInteger("width");
        this.height = data.getInteger("height");
        this.videoDuration = data.getInteger("videoDuration");
        this.adminTime = data.getLong("adminTime");
        this.likeRatio = data.getBigDecimal("likeRatio");
        this.likeCount = data.getLong("likeCount");
        this.timeGrowthRatio = data.getBigDecimal("timeGrowthRatio");
        this.theme = data.getString("theme");
        this.text = data.getString("text");
        this.caption = data.getString("caption");
        this.source = data.getString("source");
        this.bannerUrl = data.getString("bannerUrl");
        this.majorIndustryName = data.getString("majorIndustryName");
        this.createTime = new Date();
        this.updateTime = new Date();
    }
}
