package com.chushang.common.mongo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.FieldType;
import org.springframework.data.mongodb.core.mapping.MongoId;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author by zhaowenyuan create 2022/7/18 12:27
 */
@Data
@Document("garbage")
@AllArgsConstructor
@NoArgsConstructor
public class Garbage<E> implements Serializable {
    private static final long serialVersionUID = 1L;

    @MongoId(FieldType.OBJECT_ID)
    private String id;

    private String type;

    private E data;

    @Indexed
    private LocalDateTime collectedTime;

}
