feat(api): persist messenger data with Bearer auth and versioned Redis cache

This commit is contained in:
2026-10-14 06:29:08 +03:00
parent 65003b6119
commit 6fff6188ed
42 changed files with 9780 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import { Controller, Get, HttpStatus } from '@nestjs/common';
import { AppService } from './app.service';
import { PrismaService } from './prisma/prisma.service';
import { ApiException } from './common/exceptions/api.exception';
@Controller()
export class AppController {
constructor(
private readonly appService: AppService,
private readonly prisma: PrismaService,
) {}
@Get()
getHello(): string {
return this.appService.getHello();
}
@Get('health/live')
live() {
return { status: 'ok' };
}
@Get('health/ready')
async ready() {
try {
await this.prisma.$queryRaw`SELECT 1`;
} catch {
throw new ApiException(
HttpStatus.SERVICE_UNAVAILABLE,
'unavailable',
'База данных недоступна',
);
}
return { status: 'ok' };
}
}