feat: 支持登录、个人信息存储
This commit is contained in:
37
src/modules/auth/entities/user.entity.ts
Normal file
37
src/modules/auth/entities/user.entity.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user