package com.reading.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 通知实体
 */
@Data
@TableName("t_notification")
@Schema(description = "系统通知")
public class Notification {

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID", accessMode = Schema.AccessMode.READ_ONLY)
    private String id;

    @Schema(description = "租户 ID")
    private String tenantId;

    @Schema(description = "通知标题")
    private String title;

    @Schema(description = "通知内容")
    private String content;

    @Schema(description = "通知类型")
    private String type;

    @Schema(description = "发送人 ID")
    private String senderId;

    @Schema(description = "发送人角色")
    private String senderRole;

    @Schema(description = "接收者类型")
    private String recipientType;

    @Schema(description = "接收者 ID")
    private String recipientId;

    @Schema(description = "是否已读", example = "0")
    private Integer isRead;

    @Schema(description = "阅读时间")
    private LocalDateTime readAt;

    @Schema(description = "创建人用户名", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @Schema(description = "是否删除", accessMode = Schema.AccessMode.READ_ONLY)
    @TableLogic
    private Integer deleted;

}
