import { Column, Entity } from 'typeorm';
import { BaseModel } from '../../frame/BaseModel';

class toModel {
  user: string; // 用户id
  user_nick_name: string; //用户名称
  user_type: string; //用户类型(管理员admin/站内用户user)
  is_read: string; // 是否阅读: 0否;1是
}

@Entity('message')
export class Message extends BaseModel {
  @Column({ type: 'text', nullable: true, comment: '消息内容' })
  content: string;
  @Column({ type: 'jsonb', default: [], comment: '发送对象' })
  to: Array<toModel>;
  @Column({ type: 'character varying', nullable: true, comment: '消息类型' })
  type: string; // 审核消息, 通知消息, 业务消息
}
