simple POC
All checks were successful
build / windows (push) Successful in 5m37s
build / linux (push) Successful in 4m20s

This commit is contained in:
2025-03-10 11:25:38 +01:00
parent 037b593c6b
commit b107b926a2
17 changed files with 364 additions and 210 deletions

View File

@ -1,4 +1,15 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {model} from '../models';
export function GetGame(arg1:number):Promise<model.Game>;
export function GetGames():Promise<Array<model.Game>>;
export function GetLastGameID():Promise<number>;
export function Greet(arg1:string):Promise<string>;
export function NewGame():Promise<number>;
export function SaveStep(arg1:model.Step):Promise<void>;

View File

@ -2,6 +2,26 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function GetGame(arg1) {
return window['go']['main']['App']['GetGame'](arg1);
}
export function GetGames() {
return window['go']['main']['App']['GetGames']();
}
export function GetLastGameID() {
return window['go']['main']['App']['GetLastGameID']();
}
export function Greet(arg1) {
return window['go']['main']['App']['Greet'](arg1);
}
export function NewGame() {
return window['go']['main']['App']['NewGame']();
}
export function SaveStep(arg1) {
return window['go']['main']['App']['SaveStep'](arg1);
}

View File

@ -1,18 +1,100 @@
export namespace model {
export class Thing {
export class Step {
ID: number;
Name: string;
// Go type: time
CreatedAt: any;
// Go type: time
UpdatedAt: any;
// Go type: gorm
DeletedAt: any;
GameID: number;
Game: Game;
PointsTeamA: number;
AdderTeamA: number;
PointsTeamB: number;
AdderTeamB: number;
static createFrom(source: any = {}) {
return new Thing(source);
return new Step(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.Name = source["Name"];
this.CreatedAt = this.convertValues(source["CreatedAt"], null);
this.UpdatedAt = this.convertValues(source["UpdatedAt"], null);
this.DeletedAt = this.convertValues(source["DeletedAt"], null);
this.GameID = source["GameID"];
this.Game = this.convertValues(source["Game"], Game);
this.PointsTeamA = source["PointsTeamA"];
this.AdderTeamA = source["AdderTeamA"];
this.PointsTeamB = source["PointsTeamB"];
this.AdderTeamB = source["AdderTeamB"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class Game {
ID: number;
// Go type: time
CreatedAt: any;
// Go type: time
UpdatedAt: any;
// Go type: gorm
DeletedAt: any;
TeamA: number;
TeamB: number;
Steps: Step[];
static createFrom(source: any = {}) {
return new Game(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.CreatedAt = this.convertValues(source["CreatedAt"], null);
this.UpdatedAt = this.convertValues(source["UpdatedAt"], null);
this.DeletedAt = this.convertValues(source["DeletedAt"], null);
this.TeamA = source["TeamA"];
this.TeamB = source["TeamB"];
this.Steps = this.convertValues(source["Steps"], Step);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}

View File

@ -1,9 +0,0 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {model} from '../models';
export function DeleteThing(arg1:number):Promise<void>;
export function GetThings():Promise<Array<model.Thing>>;
export function NewThing(arg1:string):Promise<void>;

View File

@ -1,15 +0,0 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function DeleteThing(arg1) {
return window['go']['things']['Service']['DeleteThing'](arg1);
}
export function GetThings() {
return window['go']['things']['Service']['GetThings']();
}
export function NewThing(arg1) {
return window['go']['things']['Service']['NewThing'](arg1);
}