18 lines
670 B
TypeScript
18 lines
670 B
TypeScript
import { Controller, Get } from '@nestjs/common';
|
|
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
import { Public } from '../auth/Public';
|
|
import { PolicyService, PolicySnapshot } from './PolicyService';
|
|
|
|
@ApiTags('policy')
|
|
@Public()
|
|
@Controller('policy')
|
|
export class PolicyController {
|
|
constructor(private readonly policyService: PolicyService) {}
|
|
|
|
@Get('snapshot')
|
|
@ApiOperation({ summary: 'Get current feature availability policy snapshot (read-only)' })
|
|
@ApiResponse({ status: 200, description: 'Policy snapshot', type: Object })
|
|
async getSnapshot(): Promise<PolicySnapshot> {
|
|
return await this.policyService.getSnapshot();
|
|
}
|
|
} |