UNPKG

@tomei/sso

Version:
64 lines (55 loc) 1.12 kB
import { BelongsTo, Column, CreatedAt, DataType, ForeignKey, Model, Table, } from 'sequelize-typescript'; import User from './user.entity'; import SystemModel from './system.entity'; import { LoginStatusEnum } from '../enum/login-status.enum'; @Table({ tableName: 'sso_LoginHistory', timestamps: true, createdAt: 'CreatedAt', updatedAt: false, }) export default class LoginHistoryModel extends Model { @Column({ primaryKey: true, allowNull: false, autoIncrement: true, type: DataType.INTEGER, }) HistoryId: number; @ForeignKey(() => User) @Column({ allowNull: false, type: DataType.INTEGER, }) UserId: number; @ForeignKey(() => SystemModel) @Column({ allowNull: true, type: DataType.STRING(10), }) SystemCode: string; @Column({ allowNull: true, type: DataType.STRING(191), }) LoginStatus: LoginStatusEnum; @Column({ allowNull: true, type: DataType.STRING(191), }) OriginIp: string; @CreatedAt CreatedAt: Date; @BelongsTo(() => User) User: User; @BelongsTo(() => SystemModel) System: SystemModel; }