Initial commit: digital reception monorepo (M1-M11 + demo extensions)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
import { IsISO8601, IsString } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { Public } from '../auth/decorators/public.decorator';
|
||||
import { LogsBiometry } from '../auth/decorators/logs-biometry.decorator';
|
||||
import { RecognitionService } from './recognition.service';
|
||||
|
||||
class ProbeDto {
|
||||
@IsString()
|
||||
frame!: string;
|
||||
|
||||
@IsString()
|
||||
cameraId!: string;
|
||||
|
||||
@IsISO8601()
|
||||
@Type(() => String)
|
||||
occurredAt!: string;
|
||||
}
|
||||
|
||||
@Controller('recognition')
|
||||
export class RecognitionController {
|
||||
constructor(private readonly recognition: RecognitionService) {}
|
||||
|
||||
// Public (нет JWT), но логируется как биометрический доступ.
|
||||
// В будущем заменим на внутренний service-to-service token.
|
||||
@Public()
|
||||
@LogsBiometry('recognition_probe')
|
||||
@Post('probe')
|
||||
probe(@Body() dto: ProbeDto) {
|
||||
return this.recognition.probe({
|
||||
frameBase64: dto.frame,
|
||||
cameraId: dto.cameraId,
|
||||
occurredAt: new Date(dto.occurredAt),
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user