- e
+
-
+
-
+
+
+
diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts
index 03aa673..3fc226e 100755
--- a/frontend/wailsjs/go/main/App.d.ts
+++ b/frontend/wailsjs/go/main/App.d.ts
@@ -2,6 +2,8 @@
// This file is automatically generated. DO NOT EDIT
import {model} from '../models';
+export function CreateStage(arg1:number):Promise
;
+
export function DeleteParticipat(arg1:model.Participant):Promise;
export function ExportTournament(arg1:model.Tournament):Promise;
@@ -20,6 +22,8 @@ export function GetTournaments():Promise>;
export function RemoveParticipantFromTournament(arg1:model.Participant,arg2:model.Tournament):Promise;
+export function SaveMatch(arg1:model.Match):Promise;
+
export function SaveParticipant(arg1:model.Participant):Promise;
export function SaveTournament(arg1:model.Tournament):Promise;
diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js
index dba73c9..20f31b0 100755
--- a/frontend/wailsjs/go/main/App.js
+++ b/frontend/wailsjs/go/main/App.js
@@ -2,6 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
+export function CreateStage(arg1) {
+ return window['go']['main']['App']['CreateStage'](arg1);
+}
+
export function DeleteParticipat(arg1) {
return window['go']['main']['App']['DeleteParticipat'](arg1);
}
@@ -38,6 +42,10 @@ export function RemoveParticipantFromTournament(arg1, arg2) {
return window['go']['main']['App']['RemoveParticipantFromTournament'](arg1, arg2);
}
+export function SaveMatch(arg1) {
+ return window['go']['main']['App']['SaveMatch'](arg1);
+}
+
export function SaveParticipant(arg1) {
return window['go']['main']['App']['SaveParticipant'](arg1);
}
diff --git a/frontend/wailsjs/go/models.ts b/frontend/wailsjs/go/models.ts
index 6fb34b3..6c011d9 100755
--- a/frontend/wailsjs/go/models.ts
+++ b/frontend/wailsjs/go/models.ts
@@ -54,8 +54,8 @@ export namespace model {
Game: Game;
Size: number;
TournamentState: number;
- WinnierParticipantID: number;
- WinnierParticipant: Participant;
+ WinnerParticipantID: number;
+ WinnerParticipant: Participant;
Participants: Participant[];
Matches: Match[];
@@ -74,8 +74,8 @@ export namespace model {
this.Game = this.convertValues(source["Game"], Game);
this.Size = source["Size"];
this.TournamentState = source["TournamentState"];
- this.WinnierParticipantID = source["WinnierParticipantID"];
- this.WinnierParticipant = this.convertValues(source["WinnierParticipant"], Participant);
+ this.WinnerParticipantID = source["WinnerParticipantID"];
+ this.WinnerParticipant = this.convertValues(source["WinnerParticipant"], Participant);
this.Participants = this.convertValues(source["Participants"], Participant);
this.Matches = this.convertValues(source["Matches"], Match);
}
@@ -160,8 +160,8 @@ export namespace model {
Participant1: Participant;
Participant2ID: number;
Participant2: Participant;
- WinnierParticipantID: number;
- WinnierParticipant: Participant;
+ WinnerParticipantID: number;
+ WinnerParticipant: Participant;
static createFrom(source: any = {}) {
return new Match(source);
@@ -180,8 +180,8 @@ export namespace model {
this.Participant1 = this.convertValues(source["Participant1"], Participant);
this.Participant2ID = source["Participant2ID"];
this.Participant2 = this.convertValues(source["Participant2"], Participant);
- this.WinnierParticipantID = source["WinnierParticipantID"];
- this.WinnierParticipant = this.convertValues(source["WinnierParticipant"], Participant);
+ this.WinnerParticipantID = source["WinnerParticipantID"];
+ this.WinnerParticipant = this.convertValues(source["WinnerParticipant"], Participant);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
diff --git a/model/model.go b/model/model.go
index 1a5eaff..2e18935 100644
--- a/model/model.go
+++ b/model/model.go
@@ -19,26 +19,26 @@ type Participant struct {
type Tournament struct {
gorm.Model
- Title string
- GameID int
- Game Game `gorm:"foreignKey:GameID"`
- Size int // number of prarticipants
- TournamentState int
- WinnierParticipantID int
- WinnierParticipant Participant `gorm:"foreignKey:WinnierParticipantID"`
- Participants []*Participant `gorm:"many2many:partcipant_tournaments;"`
- Matches []Match
+ Title string
+ GameID int
+ Game Game `gorm:"foreignKey:GameID"`
+ Size int // number of prarticipants
+ TournamentState int
+ WinnerParticipantID int
+ WinnerParticipant Participant `gorm:"foreignKey:WinnerParticipantID"`
+ Participants []*Participant `gorm:"many2many:partcipant_tournaments;"`
+ Matches []Match
}
type Match struct {
gorm.Model
- TournamentID uint
- Stage int
- Order int
- Participant1ID uint
- Participant1 Participant `gorm:"foreignKey:Participant1ID"`
- Participant2ID uint
- Participant2 Participant `gorm:"foreignKey:Participant2ID"`
- WinnierParticipantID uint
- WinnierParticipant Participant `gorm:"foreignKey:WinnierParticipantID"`
+ TournamentID uint
+ Stage int
+ Order int
+ Participant1ID uint
+ Participant1 Participant `gorm:"foreignKey:Participant1ID"`
+ Participant2ID uint
+ Participant2 Participant `gorm:"foreignKey:Participant2ID"`
+ WinnerParticipantID uint
+ WinnerParticipant Participant `gorm:"foreignKey:WinnerParticipantID"`
}
diff --git a/tournament.db b/tournament.db
index b917d5a..75dc330 100644
Binary files a/tournament.db and b/tournament.db differ