Update model
This commit is contained in:
8
frontend/wailsjs/go/main/App.d.ts
vendored
8
frontend/wailsjs/go/main/App.d.ts
vendored
@@ -2,4 +2,12 @@
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
import {main} from '../models';
|
||||
|
||||
export function CreateFood(arg1:main.Food):Promise<main.WailsFood1>;
|
||||
|
||||
export function GetFood():Promise<main.WailsFood>;
|
||||
|
||||
export function GetSettings():Promise<main.settings>;
|
||||
|
||||
export function SetSetting(arg1:string,arg2:any):Promise<main.settings>;
|
||||
|
||||
export function UpdateFood(arg1:main.Food):Promise<main.WailsFood1>;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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"];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user