package com.yida.data.common.core.entity.user;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 用户人脸图像 Entity
 *
 * @author zhanghaijun
 * @date 2021-06-16 14:14:52
 */
@Data
public class EduUserFace {

    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     *
     */
    @TableField(value = "create_date", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createDate;

    /**
     *
     */
    @TableField(value = "create_id", fill = FieldFill.INSERT)
    private Long createId;

    /**
     *
     */
    @TableField(value = "update_date", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateDate;

    /**
     *
     */
    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private Long updateId;

    /**
     *
     */
    @TableField("user_id")
    private Long userId;

    private String name;

    /**
     * 用户类型，0-学生，1-职工
     */
    @TableField("user_type")
    private Integer userType;

    /**
     * 图像url
     */
    @TableField("pic_path")
    private String picPath;

    /**
     * 人脸组id
     */
    private transient Long faceGroupUserId;

    /**
     * 学生对应卡号
     */
    private transient String rfidCard;

    /**
     * 是否为会员 1=是，0=否（针对学生，教师全是会员）
     */
    private transient Integer notes;
    /**
     * 会员开始时间
     */
    private transient String cardValidBegin;
    /**
     * 会员结束时间
     */
    private transient String cardValidEnd;

    /**
     * 下发的设备名称
     */
    private transient String deviceName;
}