init studio admin backend

This commit is contained in:
2026-07-01 17:30:04 +09:00
commit 4437d9980d
144 changed files with 44964 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { Controller, Get } from '@nestjs/common';
import { Public } from '../admin-auth/decorators/admin-auth.decorators';
import { HealthService } from './health.service';
@Public()
@Controller('health')
export class HealthController {
constructor(private readonly healthService: HealthService) {}
@Get()
getHealth() {
return this.healthService.getHealth();
}
@Get('db')
getDbHealth() {
return this.healthService.getDbHealth();
}
}
+12
View File
@@ -0,0 +1,12 @@
import { Module } from '@nestjs/common';
import { PrismaModule } from '../prisma/prisma.module';
import { HealthController } from './health.controller';
import { HealthService } from './health.service';
@Module({
imports: [PrismaModule],
controllers: [HealthController],
providers: [HealthService],
})
export class HealthModule {}
+25
View File
@@ -0,0 +1,25 @@
import { Injectable } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
@Injectable()
export class HealthService {
constructor(private readonly prisma: PrismaService) {}
getHealth() {
return {
ok: true,
service: 'atnmy-stdo-adm-v2-be',
timestamp: new Date().toISOString(),
};
}
async getDbHealth() {
await this.prisma.$queryRaw`SELECT 1`;
return {
ok: true,
database: 'ok',
timestamp: new Date().toISOString(),
};
}
}