package com.dtok.entity;

import javax.persistence.*;
import java.io.Serializable;

import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @Description
 * @Author C.J
 * @Date 2024-03-09
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "common_item")
public class CommonItem implements Serializable {

    private static final long serialVersionUID = 7644588109681057010L;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "app")
    private String app;

    @Column(name = "type")
    private String type;

    @Column(name = "content")
    private String content;

    /**
     * 0,1
     */
    @Column(name = "is_default")
    private Boolean isDefault;

    @Column(name = "created_time")
    private Date createdTime;


    @OneToOne
    @JoinColumn(name = "app", referencedColumnName = "package_name", insertable = false, updatable = false)
    private AppInfo appInfo;

    @OneToOne
    @JoinColumn(name = "created_at", referencedColumnName = "id", insertable = false, updatable = false)
    private Account createdUser;

    /**
     * 创建
     */
    @Column(name = "created_at")
    private Long createdAt;

}
