package com.ruoyi.novel.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

// AdLog.java
@Data
@TableName("novel_ad_log")
public class AdLog {
    @TableId(type = IdType.AUTO)
    private Long id;

    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @NotNull(message = "章节ID不能为空")
    private Long chapterId;

    @NotBlank(message = "广告平台不能为空")
    @Size(max = 50, message = "广告平台标识过长")
    private String adPlatform;

    @TableField(fill = FieldFill.INSERT)
    private Date viewTime;

    private String deviceInfo;

    // 状态字段：0-未同步 1-已同步
    private Integer syncStatus;

    // 确保有默认构造方法
    public AdLog() {}

    public String deviceId;
}
