searchBehavior.entity.ts 916 B

123456789101112131415161718
  1. import { Column, Entity } from 'typeorm';
  2. import * as dayjs from 'dayjs';
  3. import { BaseModel } from '../frame/BaseModel';
  4. @Entity('searchBehavior', { comment: '检索行为日志' })
  5. export class SearchBehavior extends BaseModel {
  6. @Column({ type: 'integer', nullable: true, comment: '操作人id' })
  7. operator_id: number;
  8. @Column({ type: 'character varying', nullable: true, comment: '操作人名称' })
  9. operator_name: string;
  10. @Column({ type: 'character varying', nullable: true, comment: 'ip' })
  11. ip: string;
  12. @Column({ type: 'character varying', nullable: true, comment: '设备' })
  13. device: string;
  14. @Column({ type: 'timestamp without time zone', nullable: true, comment: '时间', transformer: { from: value => (value ? dayjs(value).format('YYYY-MM-DD HH:mm:ss') : value), to: value => value } })
  15. time: Date;
  16. @Column({ type: 'character varying', comment: '检索内容' })
  17. keyword: string;
  18. }