57 lines
1023 B
TypeScript
57 lines
1023 B
TypeScript
import {Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn} from 'typeorm'
|
|
|
|
@Entity({name:'account'})
|
|
export class Account {
|
|
|
|
@PrimaryGeneratedColumn('uuid')
|
|
@Column({
|
|
type:'varchar',
|
|
length:255,
|
|
primary:true,
|
|
readonly:true,
|
|
update:false,
|
|
comment:'AdminID'
|
|
})
|
|
aid!:string
|
|
|
|
@Column({
|
|
type:'varchar',
|
|
length:255,
|
|
comment:'登录账号名'
|
|
})
|
|
readonly username!:string
|
|
|
|
@Column({
|
|
type:'varchar',
|
|
length:255,
|
|
comment:'登录密码'
|
|
})
|
|
readonly password!:string
|
|
|
|
@Column({
|
|
default:true,
|
|
comment:'是否可用'
|
|
})
|
|
readonly isActive!:boolean
|
|
|
|
@CreateDateColumn({
|
|
type:'timestamp',
|
|
comment:'账号创建时间'
|
|
|
|
})
|
|
readonly created_time!:string
|
|
|
|
@UpdateDateColumn({
|
|
type:'timestamp',
|
|
comment:'账号更新时间'
|
|
})
|
|
readonly update_time!:string
|
|
|
|
@Column({
|
|
type:'timestamp',
|
|
comment:'最后登录时间',
|
|
default:()=>'CURRENT_TIMESTAMP'
|
|
})
|
|
readonly lastlogin_time!:string
|
|
|
|
} |