Export types to json

This commit is contained in:
2024-08-09 18:02:58 +02:00
parent b177416204
commit 01e6515de5
2 changed files with 27 additions and 27 deletions

View File

@@ -11,19 +11,19 @@ type (
db *DB db *DB
} }
Food struct { Food struct {
rowid int64 rowid int64 `json:"rowid"`
date string date string `json:"date"`
food string food string `json:"food"`
descripton string descripton string `json:"description"`
amount float32 amount float32 `json:"amount"`
per100 float32 per100 float32 `json:"per100"`
energy float32 energy float32 `json:"energy"`
} }
AggregatedFood struct { AggregatedFood struct {
period string period string `json:"period"`
amount float32 amount float32 `json:"amount"`
avgPer100 float32 avgPer100 float32 `json:"avgPer100"`
energy float32 energy float32 `json:"energy"`
} }
) )

View File

@@ -13,21 +13,21 @@ type (
) )
type settings struct { type settings struct {
FoodDaysLookback int FoodDaysLookback int `default:"30" json:"foodDaysLookback"`
FoodAggregatedDaysLookback int FoodAggregatedDaysLookback int `default:"30" json:"foodAggregatedDaysLookback"`
FoodDailyLookback int FoodDailyLookback int `default:"30" json:"foodDailyLookback"`
FoodWeeklyLookback int FoodWeeklyLookback int `default:"4" json:"foodWeeklyLookback"`
FoodMonthlyLookback int FoodMonthlyLookback int `default:"4" json:"foodMonthlyLookback"`
FoodYearlyLookback int FoodYearlyLookback int `default:"2" json:"foodYearlyLookback"`
WeightDaysLookback int WeightDaysLookback int `default:"30" json:"weightDaysLookback"`
WeightAggregatedDaysLookback int WeightAggregatedDaysLookback int `default:"30" json:"weightAggregatedDaysLookback"`
WeightDailyLookback int WeightDailyLookback int `default:"30" json:"weightDailyLookback"`
WeightWeeklyLookback int WeightWeeklyLookback int `default:"4" json:"weightWeeklyLookback"`
WeightMonthlyLookback int WeightMonthlyLookback int `default:"4" json:"weightMonthlyLookback"`
WeightYearlyLookback int WeightYearlyLookback int `default:"2" json:"weightYearlyLookback"`
Target int Target int `default:"2000" json:"target"`
} }
var Settings settings var Settings settings