perf: 优化类型问题

This commit is contained in:
richarjiang
2026-04-07 15:35:44 +08:00
parent 3a1b4d22bf
commit 886e70a106
18 changed files with 101 additions and 111 deletions

View File

@@ -10,28 +10,28 @@ import {
@Entity('wx_users')
export class User {
@PrimaryGeneratedColumn('uuid')
id: string;
id!: string;
@Index('idx_user_openid', { unique: true })
@Column({ type: 'varchar', length: 128 })
openid: string;
openid!: string;
@Column({ type: 'varchar', length: 255, name: 'session_key', nullable: true })
sessionKey: string | null;
sessionKey!: string | null;
@Column({ type: 'varchar', length: 100, nullable: true })
nickname: string | null;
nickname!: string | null;
@Column({ type: 'text', name: 'avatar_url', nullable: true })
avatarUrl: string | null;
avatarUrl!: string | null;
/** 积分(默认 10 */
@Column({ type: 'int', default: 10 })
points: number;
points!: number;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
createdAt!: Date;
@UpdateDateColumn({ name: 'updated_at' })
updatedAt: Date;
updatedAt!: Date;
}