package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

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

/**
 * @author baoxy
 * @date 2023-07-17
 */
@Entity
@Table(name = "ycq_message_notice")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = {"noticeId"})
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
@ApiModel(description = "消息通知表")
public class YcqMessageNotice implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "idGenerator")
    @Column(name = "notice_id")
    @ApiModelProperty(value = "主键id")
    private Long noticeId;

    @Column(name = "title")
    @ApiModelProperty(value = "标题")
    private String title;

    @Column(name = "content")
    @ApiModelProperty(value = "消息内容")
    private String content;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @Column(name = "type")
    @ApiModelProperty(value = "类别(1:公共消息,2:用户私人消息)")
    private Integer type;

    @Column(name = "business_code")
    @ApiModelProperty(value = "业务编码")
    private String businessCode;

    @Column(name = "state")
    @ApiModelProperty(value = "状态 1:有效 0:无效")
    private Integer state;

    @Column(name = "worker_id")
    @ApiModelProperty(value = "用户id")
    private Integer workerId;
}
