feat: 搭建 NestJS 后端基础设施与 Prisma 数据模型
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||
import { Public } from './common/decorators/public.decorator';
|
||||
|
||||
@ApiTags('系统')
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly config: ConfigService) {}
|
||||
|
||||
@Public()
|
||||
@Get('health')
|
||||
@ApiOperation({ summary: '健康检查' })
|
||||
health() {
|
||||
return { status: 'ok', time: new Date().toISOString() };
|
||||
}
|
||||
|
||||
@Public()
|
||||
@Get('app-info')
|
||||
@ApiOperation({ summary: '应用基本信息(公开)' })
|
||||
appInfo() {
|
||||
return { appName: this.config.get<string>('appName') };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user