
package com.tmerclub.cloud.user.bo.mongo;

import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serial;
import java.io.Serializable;

/**
 * 弹窗记录mongodb
 * @author TRACK
 */
@Document("popup_user_log")
@CompoundIndexes({
        @CompoundIndex(name = "idx_user_popup", def = "{'popupId':1, 'userId':1}"),
        @CompoundIndex(name = "idx_uuid_popup", def = "{'popupId':1, 'uuid':1}"),
        @CompoundIndex(name = "idx_user_time_popup", def = "{'popupId':1, 'userId':1, 'createTime':1}"),
        @CompoundIndex(name = "idx_uuid_time_popup", def = "{'popupId':1, 'uuid':1, 'createTime':1}")
})
public class MongoPopupUserLogBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "弹窗id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long popupId;

    @Schema(description = "弹窗时间 yyMMdd", requiredMode = Schema.RequiredMode.REQUIRED)
    private String createTime;

    @Schema(description = "用户id")
    private Long userId;

    @Schema(description = "游客uuid")
    private Long uuid;

    public MongoPopupUserLogBO() {
    }

    public MongoPopupUserLogBO(Long popupId, Long userId, Long uuid) {
        this.popupId = popupId;
        this.userId = userId;
        this.uuid = uuid;
    }

    public Long getPopupId() {
        return popupId;
    }

    public void setPopupId(Long popupId) {
        this.popupId = popupId;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUuid() {
        return uuid;
    }

    public void setUuid(Long uuid) {
        this.uuid = uuid;
    }

    @Override
    public String toString() {
        return "MongoPopupUserLogBO{" +
                "popupId=" + popupId +
                ", createTime=" + createTime +
                ", userId=" + userId +
                ", uuid='" + uuid + '\'' +
                '}';
    }
}
