typescript^2
Alban GUILHOT 3 years ago
commit 4a98ef5afe

@ -0,0 +1,23 @@
# database container deployment
kind: pipeline
name: BD
steps:
- name: deploy-container-mysql
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: mysql
CONTAINERNAME: mysql
COMMAND: create
# OVERWRITE: false
PRIVATE: true
CODEFIRST_CLIENTDRONE_ENV_MYSQL_ROOT_PASSWORD:
from_secret: P@s$w0rd123
CODEFIRST_CLIENTDRONE_ENV_MYSQL_DATABASE:
from_secret: BDBOB
CODEFIRST_CLIENTDRONE_ENV_MYSQL_USER:
from_secret: bob
CODEFIRST_CLIENTDRONE_ENV_MYSQL_PASSWORD:
from_secret: P@s$w0rd123
scripts:
- GRANT ALL PRIVILEGES ON *.* TO 'CODEFIRST_CLIENTDRONE_ENV_MYSQL_USER'@'localhost' IDENTIFIED BY 'CODEFIRST_CLIENTDRONE_ENV_MYSQL_PASSWORD';

@ -3,7 +3,7 @@ import { Pressable, Image, Text, View} from "react-native"
import { Skin } from "../core/Skin" import { Skin } from "../core/Skin"
import React from "react" import React from "react"
import { SkinComponent } from "./Skin" import { SkinComponent } from "./Skin"
import { User } from "../core/user" import { User } from "../core/User/user"
/* /*
Import the correct stylesheet Import the correct stylesheet

@ -1,6 +1,6 @@
import { createSlice, PayloadAction } from "@reduxjs/toolkit" import { createSlice, PayloadAction } from "@reduxjs/toolkit"
import { Skin } from "../../core/Skin"; import { Skin } from "../../core/Skin";
import { User } from "../../core/user"; import { User } from "../../core/User/user";
interface currentUserState { interface currentUserState {
value: User[] value: User[]

@ -17,7 +17,6 @@ function Chat(props: { navigation: any; }) {
return ( return (
<View style={stylesScreen.container}> <View style={stylesScreen.container}>
<TopBar <TopBar
skin={currentUser.getCurrentSkin()}
nav={navigation} nav={navigation}
/> />
<View style={stylesScreen.bodyStart}> <View style={stylesScreen.bodyStart}>

@ -16,13 +16,12 @@ let tabConv:Conversation[]=[];
const msc = require('../../assets/Icons/FondGris.png'); const msc = require('../../assets/Icons/FondGris.png');
const UserActu=new User("14", "leBg", "MdpDeOuf", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, tabConv); const UserActu=new User("14", "leBg", "MdpDeOuf", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, tabConv);
const jeuTest= new GameSolo("SNAKE", require('../../assets/Icons/UnSelected/Gamepad.png'),"ouin", 1, new Map<number,number>); const jeuTest= new GameSolo("SNAKE", require('../../assets/Icons/UnSelected/Gamepad.png'),"ouin", 1, 1,new Map<number,number>);
function GameChoice(props: { navigation: any; }) { function GameChoice(props: { navigation: any; }) {
const { navigation } = props const { navigation } = props
return ( return (
<View style={styles.container}> <View style={styles.container}>
<TopBar <TopBar
skin={UserActu.getCurrentSkin()}
nav={navigation} nav={navigation}
/> />
<View style={styles.body}> <View style={styles.body}>

@ -22,7 +22,6 @@ function Home(props: { navigation: any; }) {
return ( return (
<View style={stylesScreen.container}> <View style={stylesScreen.container}>
<TopBar <TopBar
skin={currentUser.getCurrentSkin()}
nav={navigation} nav={navigation}
state= 'Home' state= 'Home'
/> />

@ -23,7 +23,6 @@ function Profile(props: { navigation: any; }) {
return ( return (
<View style={stylesScreen.container}> <View style={stylesScreen.container}>
<TopBar <TopBar
skin={currentUser.getCurrentSkin()}
nav={navigation} nav={navigation}
/> />
<View style={stylesScreen.bodyStart}> <View style={stylesScreen.bodyStart}>
@ -38,7 +37,7 @@ function Profile(props: { navigation: any; }) {
<Text style={styles.coinText}>{currentUser.getCurrentCoins()}</Text> <Text style={styles.coinText}>{currentUser.getCurrentCoins()}</Text>
</View> </View>
<View style={styles.skinView}> <View style={styles.skinView}>
<SkinComponent skin={currentUser.getCurrentSkin()} state='profile' nav={navigation} /> <SkinComponent skin={currentUser.getCurrentSkin()} state='profile' />
<ButtonGreySmall onPress={() => navigation.navigate('SkinList')} title='Changer de skin' state='Profile'/> <ButtonGreySmall onPress={() => navigation.navigate('SkinList')} title='Changer de skin' state='Profile'/>
</View> </View>
</View> </View>

@ -21,7 +21,6 @@ function SkinList(props: { navigation: any; }) {
return ( return (
<View style={stylesScreen.container}> <View style={stylesScreen.container}>
<TopBar <TopBar
skin={currentUser.getCurrentSkin()}
nav={navigation} nav={navigation}
/> />
<View style={stylesScreen.bodyStart}> <View style={stylesScreen.bodyStart}>

@ -18,7 +18,6 @@ function Store(props: { navigation: any; }) {
return ( return (
<View style={stylesScreen.container}> <View style={stylesScreen.container}>
<TopBar <TopBar
skin={currentUser.getCurrentSkin()}
nav={navigation} nav={navigation}
/> />
<View style={stylesScreen.bodyStart}> <View style={stylesScreen.bodyStart}>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,108 @@
#Drop all the tables
DROP TABLE Battle;
DROP TABLE Own;
DROP TABLE Message;
DROP TABLE Belong;
DROP TABLE ConvGroup;
DROP TABLE User;
DROP TABLE Skin;
DROP TABLE Game;
#Create the User table
CREATE TABLE User (
ID char(5) PRIMARY KEY,
Username varchar(20) NOT NULL,
Password varchar(20) NOT NULL,
Nationality varchar(20) NOT NULL,
Sex char(1) NOT NULL,
DateOfBirth date NOT NULL,
CurrentBobCoins bigint(255) DEFAULT 0,
TotalBobCoins bigint(255) DEFAULT 0,
NbGamePlayed bigint(255) DEFAULT 0
);
#Create the Skin table
CREATE TABLE Skin (
ID char(5) PRIMARY KEY,
Name varchar(20) UNIQUE NOT NULL,
Image varchar(20) UNIQUE NOT NULL
);
#Create the Own table
CREATE TABLE Own (
IDSkin char(5),
IDUser char(5),
CONSTRAINT FK_Skin FOREIGN KEY (IDSkin) REFERENCES User(ID),
CONSTRAINT FK_User FOREIGN KEY (IDUser) REFERENCES Skin(ID),
PRIMARY KEY (IDUser, IDSkin)
);
#Create the Game table
CREATE TABLE Game (
ID char(5) PRIMARY KEY,
Name varchar(20) UNIQUE NOT NULL
);
#Create the Match table
CREATE TABLE Battle (
ID char(5) PRIMARY KEY,
Winner char(5) NOT NULL,
Loser char(5) NOT NULL,
Game char(5) NOT NULL,
CONSTRAINT Fk_Winner FOREIGN KEY (Winner) REFERENCES User(ID),
CONSTRAINT Fk_Loser FOREIGN KEY (Loser) REFERENCES User(ID),
CONSTRAINT Fk_Game FOREIGN KEY (Game) REFERENCES Game(ID)
);
#Create the Group table
CREATE TABLE ConvGroup (
ID char(5) PRIMARY KEY,
Name varchar(20) NOT NULL
);
#Create the Message table
CREATE TABLE Message (
ID char(5) PRIMARY KEY,
Message text NOT NULL,
IDSender char(5) NOT NULL,
IDUserReceiver char(5),
IDGroupReceiver char(5),
CONSTRAINT Fk_Sender FOREIGN KEY (IDSender) REFERENCES User(ID),
CONSTRAINT Fk_UsRec FOREIGN KEY (IDUserReceiver) REFERENCES User(ID),
CONSTRAINT Fk_GrRec FOREIGN KEY (IDGroupReceiver) REFERENCES ConvGroup(ID)
);
#Create the Belong Table
CREATE TABLE Belong (
IDUser char(5),
IDGroup char(5),
CONSTRAINT Fk_UserID FOREIGN KEY (IDUser) REFERENCES User(ID),
CONSTRAINT Fk_Group FOREIGN KEY (IDGroup) REFERENCES ConvGroup(ID),
PRIMARY KEY (IDUser, IDGroup)
);
Loading…
Cancel
Save