package cn.reghao.tnb.content.app.vod.model.po;

import cn.reghao.jutil.jdk.db.BaseObject;
import cn.reghao.tnb.common.auth.UserContext;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author reghao
 * @date 2022-03-21 13:19:49
 */
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
public class SearchRecord extends BaseObject<Integer> {
    private String keyword;
    private Long searchBy;
    private LocalDateTime searchAt;

    public SearchRecord(String keyword) {
        this.keyword = keyword;
        this.searchBy = UserContext.getUserId();
        this.searchAt = LocalDateTime.now();
    }
}
