Răsfoiți Sursa

♻️ refactor(card): 修改card实体的agent关联关系

- 将agent关联从User实体改为Agent实体
- 更新导入语句,引入Agent实体替代User实体
- 调整agent属性类型,从User|null变更为Agent|null
yourname 4 luni în urmă
părinte
comite
22bbfd8421
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      src/server/modules/card/card.entity.ts

+ 3 - 3
src/server/modules/card/card.entity.ts

@@ -1,5 +1,5 @@
 import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
-import { UserEntity as User } from '@/server/modules/users/user.entity';
+import { Agent } from '@/server/modules/agent/agent.entity';
 
 @Entity('card')
 export class Card {
@@ -36,7 +36,7 @@ export class Card {
   @Column({ name: 'updated_by', type: 'int', unsigned: true, nullable: true, comment: '更新用户ID' })
   updatedBy!: number | null;
 
-  @ManyToOne(() => User, { nullable: true })
+  @ManyToOne(() => Agent, { nullable: true })
   @JoinColumn({ name: 'agent_id', referencedColumnName: 'id' })
-  agent!: User | null;
+  agent!: Agent | null;
 }