import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
export class LiveMsgData {
  @PrimaryGeneratedColumn('increment')
  id: number;

  @Column({ name: 'from_id', type: 'text', comment: '发送人ID' })
  fromId: string;

  @Column({ name: 'room_id', type: 'text', comment: '房间ID' })
  roomId: string;

  @Column({ type: 'text', comment: '消息类型' })
  type: string;

  @Column({ type: 'text', nullable: true, comment: '消息' })
  msg: string;

  @Column({ type: 'bigint', comment: '发送时间' })
  timestamp: number;

  @Column({
    name: 'total_user',
    comment: '当前房间总人数',
    default: 0,
  })
  totalUser: number;

  @Column({
    type: 'text',
    nullable: true,
    name: 'mag_srt',
    comment: 'string 消息',
  })
  msgStr: string;

  @Column({
    default: 0,
    select: false,
    name: 'del_flag',
    comment: '是否删除：0否/1是',
  })
  delFlag: number;
}
