2025-08-23 13:20:01 +08:00
|
|
|
import { Controller, Get } from '@nestjs/common';
|
|
|
|
|
import { AppService } from './app.service';
|
2025-08-27 11:24:22 +08:00
|
|
|
import { Public } from './common/auth/decorators/public.decorator';
|
2025-08-23 13:20:01 +08:00
|
|
|
|
|
|
|
|
@Controller()
|
|
|
|
|
export class AppController {
|
|
|
|
|
constructor(private readonly appService: AppService) {}
|
|
|
|
|
|
|
|
|
|
@Get()
|
2025-08-27 11:24:22 +08:00
|
|
|
@Public()
|
2025-08-23 13:20:01 +08:00
|
|
|
getHello(): string {
|
|
|
|
|
return this.appService.getHello();
|
|
|
|
|
}
|
2025-08-27 11:24:22 +08:00
|
|
|
|
|
|
|
|
@Get('healthz')
|
|
|
|
|
@Public()
|
|
|
|
|
healthCheck() {
|
|
|
|
|
return {
|
|
|
|
|
status: 'ok',
|
|
|
|
|
timestamp: new Date().toISOString(),
|
|
|
|
|
uptime: process.uptime(),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get('readyz')
|
|
|
|
|
@Public()
|
|
|
|
|
readinessCheck() {
|
|
|
|
|
return {
|
|
|
|
|
status: 'ready',
|
|
|
|
|
timestamp: new Date().toISOString(),
|
|
|
|
|
services: {
|
|
|
|
|
redis: 'connected',
|
|
|
|
|
kafka: 'connected',
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
2025-08-23 13:20:01 +08:00
|
|
|
}
|