Suppression de l'ancien frontend
This commit is contained in:
parent
d62915bfe5
commit
427d837b35
219 changed files with 0 additions and 12333 deletions
|
|
@ -1,39 +0,0 @@
|
|||
export interface Advert
|
||||
{
|
||||
_id: string,
|
||||
userId: string,
|
||||
title: string,
|
||||
url: string,
|
||||
images: {
|
||||
url: string,
|
||||
description: string,
|
||||
}[],
|
||||
interests: string[],
|
||||
comment: string,
|
||||
views: Date[],
|
||||
isVisible: boolean,
|
||||
isActive: boolean,
|
||||
createdAt: Date,
|
||||
updatedAt: Date,
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface AdvertWithCountViews {
|
||||
id: string,
|
||||
userId: string,
|
||||
title: string,
|
||||
url: string,
|
||||
images: {
|
||||
url: string,
|
||||
description: string,
|
||||
}[],
|
||||
interests: string[],
|
||||
comment: string,
|
||||
views: Date[],
|
||||
countViews: number,
|
||||
isVisible: boolean,
|
||||
isActive: boolean,
|
||||
createdAt: Date,
|
||||
updatedAt: Date,
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
export interface PlaylistDB
|
||||
{
|
||||
_id: string,
|
||||
userId: string,
|
||||
name: string,
|
||||
videoIds: string[],
|
||||
isActive: boolean
|
||||
createdAt: Date,
|
||||
updatedAt: Date
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
export interface User
|
||||
{
|
||||
_id: string,
|
||||
email: string,
|
||||
hashPass: string,
|
||||
login: string,
|
||||
role: {
|
||||
name: string,
|
||||
permission: number,
|
||||
isAccepted: boolean,
|
||||
},
|
||||
profileImageUrl: string,
|
||||
dateOfBirth: Date,
|
||||
gender: string,
|
||||
interests: any[],
|
||||
company: string,
|
||||
isActive: boolean,
|
||||
lastConnexion: Date,
|
||||
createdAt: Date,
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
|
||||
interface VideoCategorie
|
||||
{
|
||||
id: number
|
||||
interest: string
|
||||
categories: {
|
||||
id: string
|
||||
name: string
|
||||
source: string
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
export interface VideoDB
|
||||
{
|
||||
_id: string,
|
||||
userId: string,
|
||||
videoId: string,
|
||||
source: string,
|
||||
tags: string[],
|
||||
interest: string,
|
||||
watchedDates: Date[],
|
||||
createdAt: Date,
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
|
||||
export interface VideoAll
|
||||
{
|
||||
_id: string,
|
||||
userId: string,
|
||||
videoId: string,
|
||||
source: string,
|
||||
tags: String[],
|
||||
interest: string,
|
||||
watchedDates: Date[],
|
||||
createdAt: Date,
|
||||
updatedAt: Date
|
||||
|
||||
title: string,
|
||||
views: number,
|
||||
publishedAt: Date,
|
||||
description: string,
|
||||
imageUrl: string
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FictitiousAdvertsService } from './fictitious-adverts.service';
|
||||
|
||||
describe('FictitiousAdvertsService', () => {
|
||||
let service: FictitiousAdvertsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(FictitiousAdvertsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {Advert} from "../../../interfaces/advert";
|
||||
import {FictitiousUtilsService} from "../fictitiousUtils/fictitious-utils.service";
|
||||
|
||||
|
||||
|
||||
const TAB_ADVERT: Advert[] = [
|
||||
{
|
||||
_id: "idNutella",
|
||||
userId: "userId",
|
||||
title: "pot de nutella XXL",
|
||||
url: "https://www.nutella.com/fr/fr/",
|
||||
images: [
|
||||
{ url: "nutella_v_1.jpeg", description: "image nutella 1" },
|
||||
{ url: "nutella_v_2.png", description: "image nutella 2" },
|
||||
{ url: "nutella_v_3.jpg", description: "image nutella 3" }
|
||||
],
|
||||
interests: [ "rock", "basket" ],
|
||||
comment: "pub pour vacances de noêl",
|
||||
views: [
|
||||
new Date(2021,10,1),
|
||||
new Date(2021,10,2),
|
||||
new Date(2021,10,3),
|
||||
new Date(2021,10,3),
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,7)
|
||||
],
|
||||
isVisible: true,
|
||||
isActive: true,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
_id: "idRolex",
|
||||
userId: "userId",
|
||||
title: "Rolex",
|
||||
url: "https://www.rolex.com",
|
||||
images: [
|
||||
{ url: "rolex_v_1.jpg", description: "rolex 1" },
|
||||
{ url: "rolex_v_2.png", description: "rolex 2" },
|
||||
],
|
||||
interests: [ "rock", "rap" ],
|
||||
comment: "pub pour cette année",
|
||||
views: [
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,6),
|
||||
new Date(2021,10,7),
|
||||
new Date(2021,10,8),
|
||||
new Date(2021,10,8),
|
||||
new Date(2021,10,8),
|
||||
new Date(2021,10,25),
|
||||
new Date(2021,10,25),
|
||||
new Date(2021,10,25),
|
||||
new Date(2021,10,27)
|
||||
],
|
||||
isVisible: true,
|
||||
isActive: true,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
_id: "idAlbion",
|
||||
userId: "userId",
|
||||
title: "Albion new version",
|
||||
url: "https://www.rolex.com",
|
||||
images: [
|
||||
{ url: "rolex_v_1.jpg", description: "albion 1" },
|
||||
{ url: "rolex_v_2.png", description: "albion 2" },
|
||||
],
|
||||
interests: [ "rock", "rap" ],
|
||||
comment: "pub pour cette année",
|
||||
views: [
|
||||
new Date(2021,10,3),
|
||||
new Date(2021,10,4),
|
||||
new Date(2021,10,4),
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,5),
|
||||
new Date(2021,10,6),
|
||||
new Date(2021,10,6),
|
||||
new Date(2021,10,8),
|
||||
new Date(2021,10,8),
|
||||
new Date(2021,10,8)
|
||||
],
|
||||
isVisible: true,
|
||||
isActive: true,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FictitiousAdvertsService
|
||||
{
|
||||
|
||||
constructor(private fictitiousUtilsService: FictitiousUtilsService) {}
|
||||
|
||||
|
||||
getAdvert(): Advert
|
||||
{
|
||||
const idx = Math.floor(Math.random() * TAB_ADVERT.length);
|
||||
let advert = Object.assign({}, TAB_ADVERT[idx]);
|
||||
advert._id = advert._id + this.fictitiousUtilsService.makeid(5);
|
||||
advert.interests = advert.interests.slice();
|
||||
advert.isVisible = (Math.random() < 0.5);
|
||||
return advert;
|
||||
}
|
||||
|
||||
|
||||
getTabAdvert(n: number): Advert[]
|
||||
{
|
||||
let tabAdvert = [];
|
||||
for(let i=0 ; i<n ; i++) tabAdvert.push(this.getAdvert());
|
||||
return tabAdvert;
|
||||
}
|
||||
|
||||
|
||||
get_TAB_ADVERT(): Advert[]
|
||||
{
|
||||
return TAB_ADVERT;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FictitiousUsersService } from './fictitious-users.service';
|
||||
|
||||
describe('FictitiousUsersService', () => {
|
||||
let service: FictitiousUsersService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(FictitiousUsersService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {User} from "../../../interfaces/user";
|
||||
import {FictitiousUtilsService} from "../fictitiousUtils/fictitious-utils.service";
|
||||
|
||||
|
||||
|
||||
const USER: User = {
|
||||
_id: "ririId",
|
||||
login: "Riri",
|
||||
hashPass: "agourgroou",
|
||||
email: "riri@gmail.com",
|
||||
role: {
|
||||
name: "user",
|
||||
permission: 0,
|
||||
isAccepted: true,
|
||||
|
||||
},
|
||||
profileImageUrl: "https://www.figurines-goodies.com/1185-thickbox_default/huey-duck-tales-disney-funko-pop.jpg",
|
||||
dateOfBirth: new Date(),
|
||||
gender: "man",
|
||||
interests: ["foot", "jeux-vidéo"],
|
||||
company: "",
|
||||
isActive: true,
|
||||
lastConnexion: new Date(),
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date()
|
||||
};
|
||||
|
||||
const ADVERTISER: User = {
|
||||
_id: "fifiId",
|
||||
login: "Fifi",
|
||||
hashPass: "agourgroou",
|
||||
email: "fifi@gmail.com",
|
||||
role: {
|
||||
name: "advertiser",
|
||||
permission: 5,
|
||||
isAccepted: true,
|
||||
|
||||
},
|
||||
profileImageUrl: "https://www.figurines-goodies.com/1188-large_default/dewey-duck-tales-disney-funko-pop.jpg",
|
||||
dateOfBirth: null,
|
||||
gender: "",
|
||||
interests: [],
|
||||
company: "My company",
|
||||
isActive: true,
|
||||
lastConnexion: new Date(),
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
};
|
||||
|
||||
const ADMIN: User = {
|
||||
_id: "loulouId",
|
||||
login: "Loulou",
|
||||
hashPass: "agourgroou",
|
||||
email: "loulou@gmail.com",
|
||||
role: {
|
||||
name: "admin",
|
||||
permission: 5,
|
||||
isAccepted: true,
|
||||
},
|
||||
profileImageUrl: "https://www.reference-gaming.com/assets/media/product/41195/figurine-pop-duck-tales-n-309-loulou.jpg?format=product-cover-large&k=1519639530",
|
||||
dateOfBirth: null,
|
||||
gender: "",
|
||||
interests: [],
|
||||
company: "",
|
||||
isActive: true,
|
||||
lastConnexion: new Date(),
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
};
|
||||
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FictitiousUsersService
|
||||
{
|
||||
|
||||
constructor(private fictitiousUtilsService: FictitiousUtilsService) { }
|
||||
|
||||
private getUserOrAdvertiserOrAdmin(modele: User): User
|
||||
{
|
||||
const res = Object.assign({}, modele);
|
||||
res._id += this.fictitiousUtilsService.makeid(5);
|
||||
res.login += (Math.floor(Math.random() * 1000)).toString();
|
||||
res.email = res.login + "@gmail.com" ;
|
||||
res.role.isAccepted = (Math.random() < 0.5);
|
||||
res.isActive = (Math.random() < 0.5);
|
||||
res.dateOfBirth = this.fictitiousUtilsService.randomDate(new Date(1900, 0, 1), new Date());
|
||||
res.lastConnexion = this.fictitiousUtilsService.randomDate(new Date(2000, 0, 1), new Date());
|
||||
return res;
|
||||
}
|
||||
|
||||
getUser(): User {
|
||||
return this.getUserOrAdvertiserOrAdmin(USER);
|
||||
}
|
||||
|
||||
getAdvertiser(): User {
|
||||
return this.getUserOrAdvertiserOrAdmin(ADVERTISER);
|
||||
}
|
||||
|
||||
getAdmin(): User {
|
||||
return this.getUserOrAdvertiserOrAdmin(ADMIN);
|
||||
}
|
||||
|
||||
getTabUser(n: number): User[]
|
||||
{
|
||||
const res: User[] = [];
|
||||
for(let i=0 ; i<n ; i++) res.push(this.getUser());
|
||||
return res;
|
||||
}
|
||||
|
||||
getTabAdvertiser(n: number): User[]
|
||||
{
|
||||
const res: User[] = [];
|
||||
for(let i=0 ; i<n ; i++) res.push(this.getAdvertiser());
|
||||
return res;
|
||||
}
|
||||
|
||||
getTabAdmin(n: number): User[]
|
||||
{
|
||||
const res: User[] = [];
|
||||
for(let i=0 ; i<n ; i++) res.push(this.getAdmin());
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FictitiousUtilsService } from './fictitious-utils.service';
|
||||
|
||||
describe('FictitiousUtilsService', () => {
|
||||
let service: FictitiousUtilsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(FictitiousUtilsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FictitiousUtilsService
|
||||
{
|
||||
|
||||
makeid(length)
|
||||
{
|
||||
let res = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for( let i = 0; i < length; i++ ) {
|
||||
const k = Math.floor(Math.random() * characters.length);
|
||||
res += characters.charAt(k);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
randomDate(start, end): Date
|
||||
{
|
||||
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
|
||||
}
|
||||
|
||||
|
||||
getTags(): string[]
|
||||
{
|
||||
return [ "musique", "rap", "rock", "sport", "foot", "basket", "tennis", "film", "action", "aventure", "horreur", "romance", "comedie"];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FictitiousVideosService } from './fictitious-videos.service';
|
||||
|
||||
describe('FictitiousVideosService', () => {
|
||||
let service: FictitiousVideosService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(FictitiousVideosService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,289 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {VideoAll} from "../../../interfaces/video";
|
||||
import {PlaylistDB} from "../../../interfaces/playlist";
|
||||
import {FictitiousUtilsService} from "../fictitiousUtils/fictitious-utils.service";
|
||||
|
||||
|
||||
|
||||
const TAB_VIDEO: VideoAll[] = [
|
||||
{
|
||||
_id: "Mowgli",
|
||||
//videoId: "https://www.youtube.com/watch?v=medPORJ8KO0",
|
||||
videoId: "medPORJ8KO0",
|
||||
userId: "userId",
|
||||
source: "youtube",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "PNL",
|
||||
watchedDates: [
|
||||
new Date(2021, 10, 15),
|
||||
new Date(2021, 10, 16),
|
||||
new Date(2021, 10, 17),
|
||||
new Date(2021, 10, 18),
|
||||
new Date(2021, 10, 19),
|
||||
new Date(2021, 10, 20),
|
||||
],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "PNL - Mowgli",
|
||||
views: 999999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/CaeH7TRnI3s/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCr4TMUqy_Lqi9_zh7efICrF_V_Vw",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. "
|
||||
},
|
||||
{
|
||||
_id: "Mexico",
|
||||
//videoId: "https://www.youtube.com/watch?v=LZx6oeNeoWM",
|
||||
videoId: "LZx6oeNeoWM",
|
||||
userId: "userId",
|
||||
source: "youtube",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "PNL",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "PNL - Mexico",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/LZx6oeNeoWM/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAIJsokYSLBB3TrnKhX5V1beCTrpQ",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. "
|
||||
},
|
||||
{
|
||||
_id: "Luz de luna",
|
||||
//videoId: "https://www.youtube.com/watch?v=fGoPhSV2Jic",
|
||||
videoId: "fGoPhSV2Jic",
|
||||
userId: "userId",
|
||||
source: "youtube",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "PNL",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "PNL - Luz de luna",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/fGoPhSV2Jic/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBICz3ZfnjAXQNZQniiCTRLbdyLcg",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. "
|
||||
},
|
||||
{
|
||||
_id: "Blanka",
|
||||
//videoId: "https://www.youtube.com/watch?v=u8bHjdljyLw",
|
||||
videoId: "u8bHjdljyLw",
|
||||
userId: "userId",
|
||||
source: "youtube",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "PNL",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "PNL - Blanka",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/PCwZnN4zDiY/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCaA-xe5rkkYJbNCbSg0z27Lm1Hgw",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. "
|
||||
},
|
||||
{
|
||||
_id: "Mowgli 2",
|
||||
//videoId: "https://www.dailymotion.com/video/x7ahxdn",
|
||||
videoId: "x7ahxdn",
|
||||
userId: "userId",
|
||||
source: "dailymotion",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "PNL",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "PNL - Mowgli 2",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/tno1qRfO894/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCOBBR6c3woXXIbOSdU06quQcN7pw",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. "
|
||||
},
|
||||
{
|
||||
_id: "Etre humain",
|
||||
//videoId: "https://www.youtube.com/watch?v=gfVo39B92Ow",
|
||||
videoId: "gfVo39B92Ow",
|
||||
userId: "userId",
|
||||
source: "youtube",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "Nekfeu",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "PNL - Etre humain",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/gfVo39B92Ow/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCPJpBqTYk5Nj3RSgase3GdbT7_Pg",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. "
|
||||
},
|
||||
{
|
||||
_id: "Humanoide",
|
||||
//videoId: "https://www.youtube.com/watch?v=MiyIg__WNOw",
|
||||
videoId: "MiyIg__WNOw",
|
||||
userId: "userId",
|
||||
source: "youtube",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "Nekfeu",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "Nekfeu - Humanoide",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/MiyIg__WNOw/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDboAq0TRqXBFGgXdpOD_HOsRZucw",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ",
|
||||
},
|
||||
{
|
||||
_id: "Dernier soupir",
|
||||
//videoId: "https://youtu.be/0GqjIF-4QQM?list=PLqeKQSn3LuAmpF-uIu39RIQRQkUzVol5l",
|
||||
videoId: "0GqjIF-4QQM",
|
||||
userId: "userId",
|
||||
source: "youtube",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "Nekfeu",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "Nekfeu - Dernier soupir",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/-S5IKBvT34c/hqdefault.jpg?sqp=-oaymwEcCOADEI4CSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC1kVCIB2bQGmOH74I5puXIhn7HRQ",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ",
|
||||
},
|
||||
{
|
||||
_id: "Les prélis",
|
||||
//videoId: "https://www.dailymotion.com/video/x4trtkd",
|
||||
videoId: "x4trtkd",
|
||||
userId: "userId",
|
||||
source: "dailymotion",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "Columbine",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "Columbine - Les prélis",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://s2.dmcdn.net/v/HPPjj1NtysAaAttYk/x240",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ",
|
||||
},
|
||||
{
|
||||
_id: "Pierre feuille ciseau",
|
||||
//videoId: "https://www.dailymotion.com/video/x6agl6i",
|
||||
videoId: "x6agl6i",
|
||||
userId: "userId",
|
||||
source: "dailymotion",
|
||||
tags: [ "rap", "musique" ],
|
||||
interest: "Columbine",
|
||||
watchedDates: [new Date()],
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
|
||||
title: "Columbine - Pierre feuille ciseau",
|
||||
views: 999999,
|
||||
publishedAt: new Date(),
|
||||
imageUrl: "https://i.ytimg.com/vi/tTo7CrPlbpI/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAhC5bWURH9R8Icdkv6LWRgsW2G-Q",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FictitiousVideosService
|
||||
{
|
||||
|
||||
constructor(private fictitiousUtilsService: FictitiousUtilsService) {}
|
||||
|
||||
|
||||
getVideoAll(): VideoAll
|
||||
{
|
||||
const index = Math.floor(Math.random() * TAB_VIDEO.length);
|
||||
return TAB_VIDEO[index];
|
||||
}
|
||||
|
||||
|
||||
getVideoByVideoId(videoId: string): VideoAll
|
||||
{
|
||||
return TAB_VIDEO.find(video => video.videoId === videoId);
|
||||
}
|
||||
|
||||
|
||||
getTabVideoAll(nbVideo: number): VideoAll[]
|
||||
{
|
||||
let tabVideo = [];
|
||||
for(let i=0 ; i<nbVideo ; i++) tabVideo.push(this.getVideoAll());
|
||||
return tabVideo;
|
||||
}
|
||||
|
||||
|
||||
get_TAB_VIDEO(): VideoAll[]
|
||||
{
|
||||
return TAB_VIDEO;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
getRandomTabPlaylistDB(nbPlaylist: number, nbVideoMax: number): PlaylistDB[]
|
||||
{
|
||||
let tabPlaylist: PlaylistDB[] = [];
|
||||
|
||||
for (let i = 0; i < nbPlaylist; i++)
|
||||
{
|
||||
const r = Math.floor(Math.random() * nbVideoMax);
|
||||
const tabVideo = this.getTabVideoAll(r);
|
||||
tabPlaylist.push({
|
||||
_id: "id_playlist_"+i.toString(),
|
||||
userId: "userId",
|
||||
name: "playlist_"+i.toString(),
|
||||
videoIds: tabVideo.map(x => x._id),
|
||||
isActive: true,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date()
|
||||
});
|
||||
}
|
||||
|
||||
return tabPlaylist;
|
||||
}
|
||||
|
||||
|
||||
getNoRandomTabPlaylistDB(nbPlaylist: number): PlaylistDB[]
|
||||
{
|
||||
let tabPlaylist: PlaylistDB[] = [];
|
||||
|
||||
for(let i = 0; i < nbPlaylist; i++)
|
||||
{
|
||||
const videoIds = [];
|
||||
for(let j=0 ; j<i*2 ; j++) videoIds.push(TAB_VIDEO[j%TAB_VIDEO.length]._id);
|
||||
tabPlaylist.push({
|
||||
_id: i.toString(),
|
||||
userId: "userId",
|
||||
name: "playlist_"+i.toString(),
|
||||
videoIds: videoIds,
|
||||
isActive: true,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date()
|
||||
});
|
||||
}
|
||||
|
||||
return tabPlaylist;
|
||||
}
|
||||
|
||||
|
||||
getPlaylistBy_id(_id: string): PlaylistDB
|
||||
{
|
||||
const n = parseInt(_id)
|
||||
return this.getNoRandomTabPlaylistDB(n+1)[n];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MessageService } from './message.service';
|
||||
|
||||
describe('MessageService', () => {
|
||||
let service: MessageService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(MessageService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {HttpClient, HttpParams} from "@angular/common/http";
|
||||
import {environment} from "../../../../environments/environment";
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MessageService
|
||||
{
|
||||
|
||||
constructor( private http: HttpClient ) { }
|
||||
|
||||
post(url: string, data: any): Observable<any>
|
||||
{
|
||||
const urlComplete = environment.debutUrl + url ;
|
||||
return this.http.post<any>(urlComplete, data, {withCredentials: true});
|
||||
}
|
||||
|
||||
get(url: string, params:HttpParams = new HttpParams()): Observable<any>
|
||||
{
|
||||
const urlComplete = environment.debutUrl + url ;
|
||||
return this.http.get<any>(urlComplete,{ withCredentials: true, params: params });
|
||||
}
|
||||
|
||||
put(url: string, data: any): Observable<any>
|
||||
{
|
||||
const urlComplete = environment.debutUrl + url ;
|
||||
return this.http.put<any>(urlComplete, data, {withCredentials: true});
|
||||
}
|
||||
|
||||
delete(url: string): Observable<any>
|
||||
{
|
||||
const urlComplete = environment.debutUrl + url ;
|
||||
return this.http.delete<any>(urlComplete,{withCredentials: true});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProfilService } from './profil.service';
|
||||
|
||||
describe('ProfilService', () => {
|
||||
let service: ProfilService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ProfilService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProfilService
|
||||
{
|
||||
|
||||
getId(): string
|
||||
{
|
||||
return localStorage.getItem('id');
|
||||
}
|
||||
|
||||
getProfileImageUrl(): string
|
||||
{
|
||||
return localStorage.getItem('profileImageUrl');
|
||||
}
|
||||
|
||||
setId(id: string): void
|
||||
{
|
||||
localStorage.setItem('id', id);
|
||||
}
|
||||
|
||||
setProfileImageUrl(profileImageUrl: string): void
|
||||
{
|
||||
localStorage.setItem('profileImageUrl', profileImageUrl);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ThemeService } from './theme.service';
|
||||
|
||||
describe('ThemeService', () => {
|
||||
let service: ThemeService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ThemeService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ThemeService
|
||||
{
|
||||
isLightTheme = true;
|
||||
|
||||
getClassTheme(): string
|
||||
{
|
||||
if(this.isLightTheme) return "lightTheme" ;
|
||||
else return "darkTheme"
|
||||
}
|
||||
}
|
||||
Reference in a new issue