andrew_bashliy
3 years ago
6 changed files with 63 additions and 2 deletions
@ -1,5 +1,6 @@
@@ -1,5 +1,6 @@
|
||||
import { SESSIONS_ENTITIES } from 'src/domain/sessions/entities' |
||||
import { USERS_ENTITIES } from 'src/domain/users/entities' |
||||
import { IPS_ENTITIES } from 'src/domain/ips/entities' |
||||
import { LOG_ENTITIES } from 'src/domain/logs/entities' |
||||
|
||||
export const ENTITIES = [...USERS_ENTITIES, ...SESSIONS_ENTITIES, ...IPS_ENTITIES] |
||||
export const ENTITIES = [...USERS_ENTITIES, ...SESSIONS_ENTITIES, ...IPS_ENTITIES, ...LOG_ENTITIES] |
||||
|
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
export namespace Logs { |
||||
export enum Type { |
||||
Black = 'b', |
||||
White = 'w', |
||||
} |
||||
|
||||
export interface ILog { |
||||
/** Унікальний ідентифікатор */ |
||||
id?: number |
||||
|
||||
/** IP адреса */ |
||||
ip?: string |
||||
|
||||
/** Ідентифіктор користувача */ |
||||
userId?: number |
||||
|
||||
/** Дата створення */ |
||||
createdAt?: string |
||||
|
||||
/** Дата останньої зміни */ |
||||
updatedAt?: string |
||||
|
||||
/** Опис */ |
||||
description?: string |
||||
|
||||
/** Тип */ |
||||
type?: Type |
||||
} |
||||
} |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
import { Log } from './log.entity' |
||||
|
||||
export const LOG_ENTITIES = [Log] |
||||
|
||||
export { Log } |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
import { Logs } from 'src/core' |
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm' |
||||
|
||||
@Entity('logs') |
||||
export class Log implements Logs.ILog { |
||||
@PrimaryGeneratedColumn() |
||||
id: number |
||||
|
||||
@Column({ nullable: true }) |
||||
userId?: number |
||||
|
||||
@Column({ nullable: true }) |
||||
ip?: string |
||||
|
||||
@CreateDateColumn({ type: 'timestamp', default: () => 'LOCALTIMESTAMP' }) |
||||
createdAt: string |
||||
|
||||
@UpdateDateColumn({ type: 'timestamp', default: () => 'LOCALTIMESTAMP' }) |
||||
updatedAt: string |
||||
|
||||
@Column({ type: 'char', nullable: true }) |
||||
type?: Logs.Type |
||||
|
||||
@Column({ nullable: true }) |
||||
description?: string |
||||
} |
Loading…
Reference in new issue