Update: Add frontend

This commit is contained in:
Yûki VACHOT 2021-12-08 08:36:27 +01:00
parent be5bfa1fb5
commit 3d3b5fc51e
76 changed files with 17761 additions and 1 deletions

View file

@ -0,0 +1,47 @@
import { Injectable } from '@angular/core';
import {Person} from "../../interfaces/Person";
@Injectable({
providedIn: 'root'
})
export class FictitiousDatasService
{
getUser(): Person
{
const id = (Math.floor(Math.random()*100000)).toString()
return {
id: id,
login: "Riri"+id,
email: "riri"+id+"@gmail.com",
hashPass: "blablabla",
role: "user",
}
}
getAdmin(): Person
{
const id = (Math.floor(Math.random()*100000)).toString()
return {
id: id,
login: "Fifi"+id,
email: "fifi"+id+"@gmail.com",
hashPass: "blablabla",
role: "admin",
}
}
getTabPerson(n: number): Person[]
{
let tab: Person[] = [];
for(let i=0 ; i<n ; i++)
{
if(Math.random() < 0.5) tab.push(this.getUser());
else tab.push(this.getAdmin());
}
return tab;
}
}