refactor: replace UserDingMapping with StudentDingMapping entity

This commit is contained in:
2026-07-09 16:53:25 +08:00
parent 1fa336331c
commit ef1b46b9f4
18 changed files with 104 additions and 146 deletions

View File

@@ -0,0 +1,24 @@
import {
Entity, PrimaryGeneratedColumn, Column, CreateDateColumn,
ManyToOne, JoinColumn,
} from 'typeorm';
import { Student } from './student.entity';
@Entity('student_ding_mapping')
export class StudentDingMapping {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'ding_user_id', length: 100, unique: true })
dingUserId: string;
@Column({ name: 'student_id', type: 'integer', unique: true })
studentId: number;
@ManyToOne(() => Student, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'student_id' })
student: Student;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
}