diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts index 987b6bb..cfa9a64 100644 --- a/frontend/wailsjs/go/main/App.d.ts +++ b/frontend/wailsjs/go/main/App.d.ts @@ -2,4 +2,12 @@ // This file is automatically generated. DO NOT EDIT import {main} from '../models'; +export function CreateFood(arg1:main.Food):Promise; + export function GetFood():Promise; + +export function GetSettings():Promise; + +export function SetSetting(arg1:string,arg2:any):Promise; + +export function UpdateFood(arg1:main.Food):Promise; diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js index 3d1f4f0..de92774 100644 --- a/frontend/wailsjs/go/main/App.js +++ b/frontend/wailsjs/go/main/App.js @@ -2,6 +2,22 @@ // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // This file is automatically generated. DO NOT EDIT +export function CreateFood(arg1) { + return window['go']['main']['App']['CreateFood'](arg1); +} + export function GetFood() { return window['go']['main']['App']['GetFood'](); } + +export function GetSettings() { + return window['go']['main']['App']['GetSettings'](); +} + +export function SetSetting(arg1, arg2) { + return window['go']['main']['App']['SetSetting'](arg1, arg2); +} + +export function UpdateFood(arg1) { + return window['go']['main']['App']['UpdateFood'](arg1); +} diff --git a/frontend/wailsjs/go/models.ts b/frontend/wailsjs/go/models.ts index 6c9d68c..0198c06 100644 --- a/frontend/wailsjs/go/models.ts +++ b/frontend/wailsjs/go/models.ts @@ -58,6 +58,76 @@ export namespace main { return a; } } + export class WailsFood1 { + data: Food; + success: boolean; + error?: string; + + static createFrom(source: any = {}) { + return new WailsFood1(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.data = this.convertValues(source["data"], Food); + this.success = source["success"]; + this.error = source["error"]; + } + + 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 settings { + foodDaysLookback: number; + foodAggregatedDaysLookback: number; + foodDailyLookback: number; + foodWeeklyLookback: number; + foodMonthlyLookback: number; + foodYearlyLookback: number; + weightDaysLookback: number; + weightAggregatedDaysLookback: number; + weightDailyLookback: number; + weightWeeklyLookback: number; + weightMonthlyLookback: number; + weightYearlyLookback: number; + target: number; + + static createFrom(source: any = {}) { + return new settings(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.foodDaysLookback = source["foodDaysLookback"]; + this.foodAggregatedDaysLookback = source["foodAggregatedDaysLookback"]; + this.foodDailyLookback = source["foodDailyLookback"]; + this.foodWeeklyLookback = source["foodWeeklyLookback"]; + this.foodMonthlyLookback = source["foodMonthlyLookback"]; + this.foodYearlyLookback = source["foodYearlyLookback"]; + this.weightDaysLookback = source["weightDaysLookback"]; + this.weightAggregatedDaysLookback = source["weightAggregatedDaysLookback"]; + this.weightDailyLookback = source["weightDailyLookback"]; + this.weightWeeklyLookback = source["weightWeeklyLookback"]; + this.weightMonthlyLookback = source["weightMonthlyLookback"]; + this.weightYearlyLookback = source["weightYearlyLookback"]; + this.target = source["target"]; + } + } }