feat: ✨ 前端:玩家服务平台和运营管理系统后台初始化及框架搭建,后端:完成基础功能搭建。
This commit is contained in:
34
backend/src/entities/admin-user.entity.ts
Normal file
34
backend/src/entities/admin-user.entity.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, Index } from 'typeorm';
|
||||
|
||||
export enum AdminRole {
|
||||
SUPER_ADMIN = 'super_admin',
|
||||
OPERATOR = 'operator',
|
||||
VIEWER = 'viewer',
|
||||
}
|
||||
|
||||
@Entity('admin_users')
|
||||
export class AdminUser {
|
||||
@PrimaryGeneratedColumn({ type: 'bigint', comment: '用户ID' })
|
||||
id: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 50, unique: true, comment: '用户名' })
|
||||
@Index()
|
||||
username: string;
|
||||
|
||||
@Column({ type: 'char', length: 60, comment: '密码哈希(bcrypt)' })
|
||||
passwordHash: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: AdminRole,
|
||||
default: AdminRole.VIEWER,
|
||||
comment: '角色:super_admin-超级管理员, operator-操作员, viewer-查看者',
|
||||
})
|
||||
role: AdminRole;
|
||||
|
||||
@CreateDateColumn({ type: 'datetime', comment: '创建时间' })
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn({ type: 'datetime', comment: '更新时间' })
|
||||
updatedAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user