26 lines
742 B
TypeScript
26 lines
742 B
TypeScript
import { Controller, Get } from '@nestjs/common';
|
|
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
|
import { Public } from './common/decorators/public.decorator';
|
|
import { SettingsService } from './settings/settings.service';
|
|
|
|
@ApiTags('系统')
|
|
@Controller()
|
|
export class AppController {
|
|
constructor(private readonly settings: SettingsService) {}
|
|
|
|
@Public()
|
|
@Get('health')
|
|
@ApiOperation({ summary: '健康检查' })
|
|
health() {
|
|
return { status: 'ok', time: new Date().toISOString() };
|
|
}
|
|
|
|
@Public()
|
|
@Get('app-info')
|
|
@ApiOperation({ summary: '应用基本信息(公开)' })
|
|
async appInfo() {
|
|
const all = await this.settings.getAll();
|
|
return { appName: all.appName, appIconUrl: all.appIconUrl };
|
|
}
|
|
}
|