package ctop.bytedance.ad.advertise.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.util.DateUtils;

import java.util.Date;
import java.util.UUID;

/**
 * 视频创建创意记录信息
 * @author jeecg-boot
 * @date   2021-05-19
 * @version V1.0
 */
@Data
@TableName("ctop_bytedance_ai_video_creative_log")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class BytedanceAiVideoCreativeLog {
    
	/**id*/
	@TableId(type = IdType.AUTO)
	private Long id;
	private Long accountId;
	/**videoCode*/
	private String videoCode;
	private Long campaignId;
	private Long adId;
	/**creativeUuid*/
	private String creativeUuid;
	/**strategyId*/
	private Long strategyId;
	/**stateDate*/
	private String stateDate;
	/**status*/
	private Integer status;
	/**createTime*/
	private Date createTime;
	/**updateTime*/
	private Date updateTime;

	public BytedanceAiVideoCreativeLog(AiBytedanceAdvertiserStrategy strategy, Long adId, Long campaignId, ByteDanceVideoInfo video) {
		this.accountId = strategy.getAccountId();
		this.strategyId = strategy.getId();
		this.adId = adId;
		this.campaignId = campaignId;
		this.videoCode = video.getSignature();
		this.creativeUuid = UUID.randomUUID().toString();
		this.stateDate = DateUtils.formatDate();
		this.createTime = new Date();
		this.updateTime = new Date();
		this.status = 1;
	}
}
