File size: 654 Bytes
b7e75fd 5e7da44 b7e75fd 5e7da44 b7e75fd 5e7da44 b7e75fd 5e7da44 b7e75fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import { Controller, Get, Render } from '@nestjs/common';
import { MatchingService } from './matching/matching.service';
@Controller()
export class AppController {
constructor(private readonly matchingService: MatchingService) {}
@Get()
@Render('dashboard')
getDashboard() {
const candidate = this.matchingService.getCandidateData(0);
const matches = this.matchingService.findTopMatches(10);
return {
candidate,
matches,
totalMatches: matches.length,
avgScore: (matches.reduce((sum, m) => sum + m.score, 0) / matches.length).toFixed(3),
bestScore: matches[0]?.score.toFixed(3) || '0',
};
}
} |