From 03a2fb8dfb857a281a2f75bf20ed619796dbd6a4 Mon Sep 17 00:00:00 2001 From: snowgitea Date: Wed, 1 Jul 2026 17:57:09 +0800 Subject: [PATCH] chore: src/modules/recycle/entity/data.ts --- src/modules/recycle/entity/data.ts | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/modules/recycle/entity/data.ts diff --git a/src/modules/recycle/entity/data.ts b/src/modules/recycle/entity/data.ts new file mode 100644 index 0000000..e86c008 --- /dev/null +++ b/src/modules/recycle/entity/data.ts @@ -0,0 +1,41 @@ +import { BaseEntity, transformerJson } from '../../base/entity/base'; +import { Entity, Column, Index } from 'typeorm'; + +/** + * 数据回收站 软删除的时候数据会回收到该表 + */ +@Entity('recycle_data') +export class RecycleDataEntity extends BaseEntity { + @Column({ comment: '表', type: 'json', transformer: transformerJson }) + entityInfo: { + // 数据源名称 + dataSourceName: string; + // entity + entity: string; + }; + + @Index() + @Column({ comment: '操作人', nullable: true }) + userId: number; + + @Column({ + comment: '被删除的数据', + type: 'json', + transformer: transformerJson, + }) + data: object[]; + + @Column({ comment: '请求的接口', nullable: true }) + url: string; + + @Column({ + comment: '请求参数', + nullable: true, + type: 'json', + transformer: transformerJson, + }) + params: string; + + @Column({ comment: '删除数据条数', default: 1 }) + count: number; +}