feat: add logging functionality with LoggerService; implement log entity and controller; enhance query processing with logging support

This commit is contained in:
lborv
2025-10-11 16:21:03 +03:00
parent 323fc6e817
commit 57e4a8b932
19 changed files with 328 additions and 24 deletions

View File

@ -0,0 +1,17 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AdminToken1760184857707 implements MigrationInterface {
name = "AdminToken1760184857707";
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE \`token\` CHANGE \`isActive\` \`isActive\` tinyint NOT NULL DEFAULT '1'`
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE \`token\` CHANGE \`isActive\` \`isActive\` tinyint NOT NULL DEFAULT 0`
);
}
}

View File

@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Logs1760188157352 implements MigrationInterface {
name = "Logs1760188157352";
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE \`log\` (\`id\` varchar(36) NOT NULL, \`traceId\` varchar(255) NOT NULL, \`content\` longtext NOT NULL, \`createdAt\` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP(), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`
);
await queryRunner.query(
`ALTER TABLE \`token\` CHANGE \`isActive\` \`isActive\` tinyint NOT NULL DEFAULT '1'`
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE \`token\` CHANGE \`isActive\` \`isActive\` tinyint NOT NULL DEFAULT 0`
);
await queryRunner.query(`DROP TABLE \`log\``);
}
}