package com.izouma.jmrh.domain;

import javax.persistence.*;

import com.izouma.jmrh.enums.MessageType;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Entity
@Table(indexes = {@Index(columnList = "sessionId")})
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("对接记录")
public class Message extends BaseEntity {

    private Long userId;

    private Long toUserId;

    @Column(length = 96)
    private String sessionId;

    @Column(columnDefinition = "TEXT")
    private String content;

    @Enumerated(EnumType.STRING)
    private MessageType type;

    @Column(name = "is_read")
    private boolean read;

    private Long commentId;

    private Long postId;
}
