DELETE: Suppression de la mauvaise persistance
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
7ef13f97ec
commit
4fde4eadb4
@ -1,19 +0,0 @@
|
||||
import { Conversation } from "../../core/conversation";
|
||||
import { User } from "../../core/User/user";
|
||||
import IDataManagerConversation from "../IDataManagerConversation";
|
||||
|
||||
export default class DataManagerConversationDatabase implements IDataManagerConversation{
|
||||
|
||||
createConversation(c: Conversation): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getConversationFromUser(u: User): Conversation[] {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
deleteConversation(c: Conversation): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
updateConversation(c: Conversation): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
import { Match } from "../../core/match";
|
||||
import IDataManagerMatch from "../IDataManagerMatch";
|
||||
|
||||
export default class DataManagerMatchDatabase implements IDataManagerMatch{
|
||||
|
||||
|
||||
getMatchById(id: string): Match | null {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
createMatch(m: Match): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
updateMatch(m: Match): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
deleteMatch(m: Match): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import { Conversation } from "../../core/conversation";
|
||||
import { Message } from "../../core/message";
|
||||
import IDataManagerMessage from "../IDataManagerMessage";
|
||||
|
||||
export default class DataManagerMessageDatabase implements IDataManagerMessage{
|
||||
createMessage(m: Message): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getMessageFromConversation(c: Conversation): Message[] {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
import { User } from "../../core/User/user";
|
||||
import IDataManagerUser from "../IDataManagerUser";
|
||||
|
||||
export default class DataManagerUserDatabase implements IDataManagerUser{
|
||||
|
||||
createUser(u: User): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getUserById(id: string): User | null {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getUserByUsernamePassword(username: string, password: string): User | null {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getUserByUsername(username: string): User | null {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
updateUser(u: User): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
deleteUser(u: User): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
import { Conversation } from "../core/conversation";
|
||||
import { User } from "../core/User/user";
|
||||
|
||||
export default interface IDataManagerConversation{
|
||||
|
||||
createConversation(c:Conversation): void;
|
||||
|
||||
getConversationFromUser(u:User): Conversation[];
|
||||
|
||||
deleteConversation(c:Conversation): void;
|
||||
|
||||
updateConversation(c:Conversation): void;
|
||||
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
import { Match } from "../core/match";
|
||||
|
||||
export default interface IDataManagerMatch{
|
||||
|
||||
getMatchById(id:string): Match | null;
|
||||
|
||||
createMatch(m:Match): void;
|
||||
|
||||
updateMatch(m:Match): void;
|
||||
|
||||
deleteMatch(m:Match): void;
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import { Conversation } from "../core/conversation";
|
||||
import { Message } from "../core/message";
|
||||
|
||||
export default interface IDataManagerMessage{
|
||||
|
||||
createMessage(m: Message): void;
|
||||
|
||||
getMessageFromConversation(c:Conversation): Message[];
|
||||
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
import { User } from "../core/User/user";
|
||||
|
||||
export default interface IDataManagerUser{
|
||||
|
||||
createUser(u:User): void;
|
||||
|
||||
getUserById(id:string): User | null;
|
||||
|
||||
getUserByUsernamePassword(username:string, password:string): User | null;
|
||||
|
||||
getUserByUsername(username:string): User | null;
|
||||
|
||||
updateUser(u:User):void;
|
||||
|
||||
deleteUser(u:User): void;
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
import IDataManagerConversation from "./IDataManagerConversation";
|
||||
import IDataManagerMatch from "./IDataManagerMatch";
|
||||
import IDataManagerMessage from "./IDataManagerMessage";
|
||||
import IDataManagerUser from './IDataManagerUser';
|
||||
|
||||
export default abstract class Manager{
|
||||
managerConversation: IDataManagerConversation;
|
||||
managerMessage: IDataManagerMessage;
|
||||
managerMatch: IDataManagerMatch;
|
||||
managerUser: IDataManagerUser;
|
||||
|
||||
constructor(managerConversation: IDataManagerConversation, managerMessage: IDataManagerMessage, managerMatch: IDataManagerMatch, managerUser: IDataManagerUser){
|
||||
this.managerConversation=managerConversation;
|
||||
this.managerMessage=managerMessage;
|
||||
this.managerMatch=managerMatch;
|
||||
this.managerUser=managerUser;
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
import { Conversation } from "../../core/conversation";
|
||||
import { User } from "../../core/User/user";
|
||||
import IDataManagerConversation from "../IDataManagerConversation";
|
||||
|
||||
export default class DataManagerConversationStub implements IDataManagerConversation{
|
||||
|
||||
createConversation(c: Conversation): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getConversationFromUser(u: User): Conversation[] {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
deleteConversation(c: Conversation): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
updateConversation(c: Conversation): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
import { Match } from "../../core/match";
|
||||
import IDataManagerConversation from "../IDataManagerConversation";
|
||||
import IDataManagerMatch from "../IDataManagerMatch";
|
||||
|
||||
export default class DataManagerMatchStub implements IDataManagerMatch{
|
||||
|
||||
|
||||
getMatchById(id: string): Match | null {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
createMatch(m: Match): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
updateMatch(m: Match): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
deleteMatch(m: Match): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import { Conversation } from "../../core/conversation";
|
||||
import { Message } from "../../core/message";
|
||||
import IDataManagerMessage from "../IDataManagerMessage";
|
||||
|
||||
export default class DataManagerMessageStub implements IDataManagerMessage{
|
||||
createMessage(m: Message): void {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
getMessageFromConversation(c: Conversation): Message[] {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
import { Skin } from "../../core/skin"
|
||||
import { User } from "../../core/User/user"
|
||||
import IDataManagerUser from "../IDataManagerUser"
|
||||
|
||||
export default class DataManagerUserStub implements IDataManagerUser{
|
||||
|
||||
tabAllUser: User[]=[
|
||||
new User("14", "leBg", "MdpDeOuf", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0), [new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0) ], []),
|
||||
new User("48", "WeshWesh", "MdpDeOuf", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0), [new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0)], []),
|
||||
new User("17", "Alban", "oui", "ouioui", "homme", new Date(2022,12,12), 555, 667, 12, new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0), [new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0)], []),
|
||||
new User("17", "Fefe63", "jesuishm", "ouioui", "homme", new Date(2022,12,12), 12222, 123324, 12, new Skin("S0006", "Bob Red",require('bob_party/assets/BobsSkins/BobRed.png'), 100), [new Skin("S0006", "Bob Red",require('bob_party/assets/BobsSkins/BobRed.png'), 100),], []),
|
||||
]
|
||||
|
||||
/**
|
||||
* createUser methode that allow us to create a user in the stub
|
||||
* u the user to add
|
||||
*/
|
||||
createUser(u: User): void {
|
||||
this.tabAllUser.push(u);
|
||||
}
|
||||
|
||||
/**
|
||||
* getUserById methode that allow us to find a user with his id in the stub
|
||||
* id the id we want to search
|
||||
* return User if found, null if not
|
||||
*/
|
||||
getUserById(id: string): User | null {
|
||||
this.tabAllUser.forEach(user => {
|
||||
if (user.getId()==id) {
|
||||
return user;
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* getUserByUsernamePassword methode that allow us to find a user with his username and password in the stub
|
||||
* username the username of the presumed user
|
||||
* password the password of the presumed user
|
||||
* return User if found, null if not
|
||||
*/
|
||||
getUserByUsernamePassword(username: string, password: string): User | null {
|
||||
this.tabAllUser.forEach(user => {
|
||||
if (user.getId()==username && user.getPassword()==password) {
|
||||
return user;
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* getUserByUsername methode that allow us to find a user with his username in the stub
|
||||
* username the username of the presumed user
|
||||
* return User if found, null if not
|
||||
*/
|
||||
getUserByUsername(username: string): User | null {
|
||||
this.tabAllUser.forEach(user => {
|
||||
if (user.getId()==username) {
|
||||
return user;
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* updateUser methode that allow us to update a user in the stub
|
||||
* u the user we want to update
|
||||
*/
|
||||
updateUser(u: User): void {
|
||||
this.tabAllUser.forEach(user => {
|
||||
if (user.isEqual(u)) {
|
||||
user=u;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* deleteUser methode that allow us to delete a user in the stub
|
||||
* u the user we want to delete
|
||||
*/
|
||||
deleteUser(u: User): void {
|
||||
this.tabAllUser.forEach(user => {
|
||||
if (user.isEqual(u)) {
|
||||
this.tabAllUser.splice(this.tabAllUser.indexOf(u), 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
import { Conversation } from "../../core/conversation";
|
||||
import { Message } from "../../core/message";
|
||||
import { Skin } from "../../core/Skin";
|
||||
import { User } from "../../core/User/user";
|
||||
import IManager from "../IManager";
|
||||
import DataManagerConversationStub from "./DataManagerConversationStub";
|
||||
import DataManagerMatchStub from "./DataManagerMatchStub";
|
||||
import DataManagerMessageStub from "./DataManagerMessageStub";
|
||||
import DataManagerUserStub from "./DataManagerUserStub";
|
||||
|
||||
export default class extends IManager{
|
||||
currentUser: User|null=null;
|
||||
|
||||
|
||||
/*
|
||||
tabAllSkin: Skin[]=[
|
||||
new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0),
|
||||
new Skin("S0002", "Bob Blue",require('bob_party/assets/BobsSkins/BobBlue.png'), 100),
|
||||
new Skin("S0003", "Bob BW",require('bob_party/assets/BobsSkins/BobBW.png'), 100),
|
||||
new Skin("S0004", "Bob Green",require('bob_party/assets/BobsSkins/BobGreen.png'), 100),
|
||||
new Skin("S0005", "Bob P&T",require('bob_party/assets/BobsSkins/BobPinkTurquoise.png'), 100),
|
||||
new Skin("S0006", "Bob Red",require('bob_party/assets/BobsSkins/BobRed.png'), 100),
|
||||
new Skin("S0007", "Bob Cute",require('bob_party/assets/BobsSkins/BobYellowGreenBlueHeart.png'), 100),
|
||||
]
|
||||
|
||||
|
||||
|
||||
tabAllMessage: Message[]= [
|
||||
new Message("Salut", this.tabAllUser[1], new Date(2022,12,12,11,30,40)),
|
||||
new Message("Wesh", this.tabAllUser[0], new Date(2022,12,13,12,20,40)),
|
||||
new Message("Ca va", this.tabAllUser[1], new Date(2022,12,14, 12, 30, 35)),
|
||||
new Message("Ouais et toi?", this.tabAllUser[0], new Date(2022,12,14,12,35,0)),
|
||||
new Message("Coucou", this.tabAllUser[3], new Date(2022,12,14,12,35,0)),
|
||||
]
|
||||
|
||||
tablAllConersation: Conversation[]=[
|
||||
new Conversation([this.tabAllUser[1],this.tabAllUser[0] ], [this.tabAllMessage[0], this.tabAllMessage[1], this.tabAllMessage[2], this.tabAllMessage[3]], "le super nom")
|
||||
]
|
||||
|
||||
*/
|
||||
|
||||
constructor(){
|
||||
super(new DataManagerConversationStub, new DataManagerMessageStub, new DataManagerMatchStub, new DataManagerUserStub);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue