feat: 支持登录、个人信息存储

This commit is contained in:
richarjiang
2026-04-05 13:38:12 +08:00
parent 46368b8c89
commit 9ab78555cb
24 changed files with 3560 additions and 20 deletions

View File

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