package org.cmh.backend.NewsManagement.model;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;

import java.time.LocalDateTime;

@Setter
@Getter
@Entity
public class News {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false, unique = true)
    private String title;

    @Column(nullable = false)
    private String summary;

    @Column(nullable = false)
    private String content;

    private String imagePath;

    @Column(nullable = false)
    private String author;

    @CreationTimestamp
    private LocalDateTime createdAt;
    // TODO:添加外键绑定
    private String tenant;
}
