package com.rf.psychological.miniapp.comment.model;

import com.rf.psychological.base.model.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @Description:用户评论实体
 * @Author: mimang
 * @Date: 2023/5/16
 */
@Entity
@Data
@EqualsAndHashCode(callSuper=false)
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_comment_info")
@org.hibernate.annotations.Table(appliesTo = "t_comment_info", comment = "用户评论实体")
public class CommentEntity extends BaseEntity {

    @Column(name = "user_id", columnDefinition = "varchar(36) not null comment '用户id'")
    private String userId;

    @Column(name = "flag", columnDefinition = "varchar(36) not null comment '量表或认知任务flag'")
    private String flag;

    @Column(name = "type", columnDefinition = "varchar(10) not null comment '类型0量表1认知任务'")
    private String type;

    @Column(name = "status", columnDefinition = "varchar(10) not null comment '状态0无效1有效'")
    private String status;

    @Column(name = "comment_content", columnDefinition = "text comment '评论内容'")
    private String commentContent;

    @Column(name = "create_time", columnDefinition = "varchar(30) not null comment '创建时间'")
    private String createTime;

    @Column(name = "update_time", columnDefinition = "varchar(30) not null comment '更新时间'")
    private String updateTime;

    @Transient
    private String userName;//用户名称

    @Transient
    private String avatarUrl;//用户头像地址

}
