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

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
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
 */
@Data
@ToString
@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;
    }


}
