Created
November 30, 2023 12:41
-
-
Save Baker-B/4676c19bf39338b444595fc796ce900b to your computer and use it in GitHub Desktop.
pseudo code for study
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Controller, | |
Post, | |
// UseGuards, | |
// Param, | |
Body, | |
Get, | |
Delete, | |
} from '@nestjs/common'; | |
import { JwtAuthGuard } from 'src/common/guards/jwt-auth.guard'; | |
// import { IAuthenticatedUser } from 'src/common/interfaces/authenticated.user'; | |
// import { User } from 'src/common/decorators/user.decorator'; | |
import { ServerService } from './server.service'; | |
import { ServerDto } from './dto/server.dto'; | |
@Controller('server') | |
// @UseGuards(JwtAuthGuard) | |
export default class ServerController { | |
constructor(private readonly serverService: ServerService) {} | |
@Post('userdata') | |
async getSession( | |
@Body() dto: ServerDto, | |
){ | |
const session = await this.serverService.getSession(dto) | |
if(session){ | |
const {fingerprint} = await this.serverService.getUser(session.userId) | |
return fingerprint | |
} | |
const mlModelResult = await this.serverService.getMlModel(dto) | |
if(mlModelResult < 0.85) { | |
const session = await this.serverService.setSession(dto) | |
const user = await this.serverService.setUser(session) | |
return user.fingerprint | |
} | |
// ?? откуда мл-модель в сервере знает, | |
// с чем сравнивать полученный набор полей? | |
// Она отдает степень похожести принятых с клиента полей .. | |
// .. похожести на что? | |
// Или в модели есть все данные всех пользователей.... | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment