change save file method, add file changes history
This commit is contained in:
parent
519749fd3a
commit
820557a268
12 changed files with 2388 additions and 2036 deletions
|
|
@ -1,159 +1,160 @@
|
|||
package models
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type Recipe struct {
|
||||
Timestamp string `json:"Timestamp"`
|
||||
MachineSetting MachineSetting `json:"MachineSetting"`
|
||||
Recipe01 []Recipe01 `json:"Recipe01"`
|
||||
Topping Topping `json:"Topping"`
|
||||
MaterialCode []MaterialCode `json:"MaterialCode"`
|
||||
MaterialSetting []MaterialSetting `json:"MaterialSetting"`
|
||||
}
|
||||
|
||||
type MachineSetting struct {
|
||||
RecipeTag string `json:"RecipeTag"`
|
||||
StrTextShowError []string `json:"strTextShowError"`
|
||||
ConfigNumber int `json:"configNumber"`
|
||||
TemperatureMax int `json:"temperatureMax"`
|
||||
TemperatureMin int `json:"temperatureMin"`
|
||||
}
|
||||
|
||||
type MaterialCode struct {
|
||||
PackageDescription string `json:"PackageDescription"`
|
||||
RefillValuePerStep int `json:"RefillValuePerStep"`
|
||||
MaterialID uint64 `json:"materialID"`
|
||||
MaterialCode string `json:"materialCode"`
|
||||
}
|
||||
|
||||
type MaterialSetting struct {
|
||||
AlarmIDWhenOffline int `json:"AlarmIDWhenOffline"`
|
||||
BeanChannel bool `json:"BeanChannel"`
|
||||
CanisterType string `json:"CanisterType"`
|
||||
DrainTimer int `json:"DrainTimer"`
|
||||
IsEquipment bool `json:"IsEquipment"`
|
||||
LeavesChannel bool `json:"LeavesChannel"`
|
||||
LowToOffline int `json:"LowToOffline"`
|
||||
MaterialStatus int `json:"MaterialStatus"`
|
||||
PowderChannel bool `json:"PowderChannel"`
|
||||
RefillUnitGram bool `json:"RefillUnitGram"`
|
||||
RefillUnitMilliliters bool `json:"RefillUnitMilliliters"`
|
||||
RefillUnitPCS bool `json:"RefillUnitPCS"`
|
||||
ScheduleDrainType int `json:"ScheduleDrainType"`
|
||||
SodaChannel bool `json:"SodaChannel"`
|
||||
StockAdjust int `json:"StockAdjust"`
|
||||
SyrupChannel bool `json:"SyrupChannel"`
|
||||
ID uint64 `json:"id"`
|
||||
IDAlternate int `json:"idAlternate"`
|
||||
IsUse bool `json:"isUse"`
|
||||
PayRettryMaxCount int `json:"pay_rettry_max_count"`
|
||||
FeedMode string `json:"feed_mode"`
|
||||
MaterialParameter string `json:"MaterialParameter"`
|
||||
}
|
||||
|
||||
type Recipe01 struct {
|
||||
Description string `json:"Description"`
|
||||
ExtendID int `json:"ExtendID"`
|
||||
OnTOP bool `json:"OnTOP"`
|
||||
LastChange string `json:"LastChange"`
|
||||
MenuStatus int `json:"MenuStatus"`
|
||||
RemainingCups json.Number `json:"RemainingCups"`
|
||||
StringParam string `json:"StringParam"`
|
||||
TextForWarningBeforePay []string `json:"TextForWarningBeforePay"`
|
||||
CashPrice int `json:"cashPrice"`
|
||||
Changerecipe string `json:"changerecipe"`
|
||||
Disable bool `json:"disable"`
|
||||
Disable_by_cup bool `json:"disable_by_cup"`
|
||||
Disable_by_ice bool `json:"disable_by_ice"`
|
||||
EncoderCount int `json:"EncoderCount"`
|
||||
ID int `json:"id"`
|
||||
IsUse bool `json:"isUse"`
|
||||
IsShow bool `json:"isShow"`
|
||||
Name string `json:"name"`
|
||||
NonCashPrice int `json:"nonCashPrice"`
|
||||
OtherDescription string `json:"otherDescription"`
|
||||
OtherName string `json:"otherName"`
|
||||
ProductCode string `json:"productCode"`
|
||||
Recipes []MatRecipe `json:"recipes"`
|
||||
SubMenu []Recipe01 `json:"SubMenu"`
|
||||
ToppingSet []ToppingSet `json:"ToppingSet"`
|
||||
Total_time int `json:"total_time"`
|
||||
Total_weight int `json:"total_weight"`
|
||||
UriData string `json:"uriData"`
|
||||
UseGram bool `json:"useGram"`
|
||||
Weight_float int `json:"weight_float"`
|
||||
}
|
||||
|
||||
func (r *Recipe01) ToMap() map[string]interface{} {
|
||||
var m map[string]interface{}
|
||||
recipeRecord, _ := json.Marshal(r)
|
||||
json.Unmarshal(recipeRecord, &m)
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *Recipe01) FromMap(m map[string]interface{}) Recipe01 {
|
||||
recipeRecord, _ := json.Marshal(m)
|
||||
json.Unmarshal(recipeRecord, &r)
|
||||
return *r
|
||||
}
|
||||
|
||||
type MatRecipe struct {
|
||||
MixOrder int `json:"MixOrder"`
|
||||
FeedParameter int `json:"FeedParameter"`
|
||||
FeedPattern int `json:"FeedPattern"`
|
||||
IsUse bool `json:"isUse"`
|
||||
MaterialPathId int `json:"materialPathId"`
|
||||
PowderGram int `json:"powderGram"`
|
||||
PowderTime int `json:"powderTime"`
|
||||
StirTime int `json:"stirTime"`
|
||||
SyrupGram int `json:"syrupGram"`
|
||||
SyrupTime int `json:"syrupTime"`
|
||||
WaterCold int `json:"waterCold"`
|
||||
WaterYield int `json:"waterYield"`
|
||||
}
|
||||
|
||||
type ToppingSet struct {
|
||||
ListGroupID []int `json:"ListGroupID"`
|
||||
DefaultIDSelect int `json:"defaultIDSelect"`
|
||||
GroupID string `json:"groupID"`
|
||||
IsUse bool `json:"isUse"`
|
||||
}
|
||||
|
||||
type Topping struct {
|
||||
ToppingGroup []ToppingGroup `json:"ToppingGroup"`
|
||||
ToppingList []ToppingList `json:"ToppingList"`
|
||||
}
|
||||
|
||||
type ToppingGroup struct {
|
||||
Desc string `json:"Desc"`
|
||||
GroupID int `json:"groupID"`
|
||||
IDDefault int `json:"idDefault"`
|
||||
IDInGroup string `json:"idInGroup"`
|
||||
InUse bool `json:"inUse"`
|
||||
Name string `json:"name"`
|
||||
OtherName string `json:"otherName"`
|
||||
}
|
||||
|
||||
type ToppingList struct {
|
||||
ExtendID int `json:"ExtendID"`
|
||||
OnTOP bool `json:"OnTOP"`
|
||||
MenuStatus int `json:"MenuStatus"`
|
||||
CashPrice int `json:"cashPrice"`
|
||||
Disable bool `json:"disable"`
|
||||
Disable_by_cup bool `json:"disable_by_cup"`
|
||||
Disable_by_ice bool `json:"disable_by_ice"`
|
||||
EncoderCount int `json:"EncoderCount"`
|
||||
ID int `json:"id"`
|
||||
IsUse bool `json:"isUse"`
|
||||
IsShow bool `json:"isShow"`
|
||||
StringParam string `json:"stringParam"`
|
||||
Name string `json:"name"`
|
||||
NonCashPrice int `json:"nonCashPrice"`
|
||||
OtherName string `json:"otherName"`
|
||||
ProductCode string `json:"productCode"`
|
||||
Recipes []MatRecipe `json:"recipes"`
|
||||
Total_time int `json:"total_time"`
|
||||
Total_weight int `json:"total_weight"`
|
||||
UseGram bool `json:"useGram"`
|
||||
Weight_float int `json:"weight_float"`
|
||||
}
|
||||
package models
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type Recipe struct {
|
||||
Timestamp string `json:"Timestamp"`
|
||||
MachineSetting MachineSetting `json:"MachineSetting"`
|
||||
Recipe01 []Recipe01 `json:"Recipe01"`
|
||||
Topping Topping `json:"Topping"`
|
||||
MaterialCode []MaterialCode `json:"MaterialCode"`
|
||||
MaterialSetting []MaterialSetting `json:"MaterialSetting"`
|
||||
}
|
||||
|
||||
type MachineSetting struct {
|
||||
RecipeTag string `json:"RecipeTag"`
|
||||
StrTextShowError []string `json:"strTextShowError"`
|
||||
ConfigNumber int `json:"configNumber"`
|
||||
Comment []string `json:"Comment"`
|
||||
TemperatureMax int `json:"temperatureMax"`
|
||||
TemperatureMin int `json:"temperatureMin"`
|
||||
}
|
||||
|
||||
type MaterialCode struct {
|
||||
PackageDescription string `json:"PackageDescription"`
|
||||
RefillValuePerStep int `json:"RefillValuePerStep"`
|
||||
MaterialID uint64 `json:"materialID"`
|
||||
MaterialCode string `json:"materialCode"`
|
||||
}
|
||||
|
||||
type MaterialSetting struct {
|
||||
AlarmIDWhenOffline int `json:"AlarmIDWhenOffline"`
|
||||
BeanChannel bool `json:"BeanChannel"`
|
||||
CanisterType string `json:"CanisterType"`
|
||||
DrainTimer int `json:"DrainTimer"`
|
||||
IsEquipment bool `json:"IsEquipment"`
|
||||
LeavesChannel bool `json:"LeavesChannel"`
|
||||
LowToOffline int `json:"LowToOffline"`
|
||||
MaterialStatus int `json:"MaterialStatus"`
|
||||
PowderChannel bool `json:"PowderChannel"`
|
||||
RefillUnitGram bool `json:"RefillUnitGram"`
|
||||
RefillUnitMilliliters bool `json:"RefillUnitMilliliters"`
|
||||
RefillUnitPCS bool `json:"RefillUnitPCS"`
|
||||
ScheduleDrainType int `json:"ScheduleDrainType"`
|
||||
SodaChannel bool `json:"SodaChannel"`
|
||||
StockAdjust int `json:"StockAdjust"`
|
||||
SyrupChannel bool `json:"SyrupChannel"`
|
||||
ID uint64 `json:"id"`
|
||||
IDAlternate int `json:"idAlternate"`
|
||||
IsUse bool `json:"isUse"`
|
||||
PayRettryMaxCount int `json:"pay_rettry_max_count"`
|
||||
FeedMode string `json:"feed_mode"`
|
||||
MaterialParameter string `json:"MaterialParameter"`
|
||||
}
|
||||
|
||||
type Recipe01 struct {
|
||||
Description string `json:"Description"`
|
||||
ExtendID int `json:"ExtendID"`
|
||||
OnTOP bool `json:"OnTOP"`
|
||||
LastChange string `json:"LastChange"`
|
||||
MenuStatus int `json:"MenuStatus"`
|
||||
RemainingCups json.Number `json:"RemainingCups"`
|
||||
StringParam string `json:"StringParam"`
|
||||
TextForWarningBeforePay []string `json:"TextForWarningBeforePay"`
|
||||
CashPrice int `json:"cashPrice"`
|
||||
Changerecipe string `json:"changerecipe"`
|
||||
Disable bool `json:"disable"`
|
||||
Disable_by_cup bool `json:"disable_by_cup"`
|
||||
Disable_by_ice bool `json:"disable_by_ice"`
|
||||
EncoderCount int `json:"EncoderCount"`
|
||||
ID int `json:"id"`
|
||||
IsUse bool `json:"isUse"`
|
||||
IsShow bool `json:"isShow"`
|
||||
Name string `json:"name"`
|
||||
NonCashPrice int `json:"nonCashPrice"`
|
||||
OtherDescription string `json:"otherDescription"`
|
||||
OtherName string `json:"otherName"`
|
||||
ProductCode string `json:"productCode"`
|
||||
Recipes []MatRecipe `json:"recipes"`
|
||||
SubMenu []Recipe01 `json:"SubMenu"`
|
||||
ToppingSet []ToppingSet `json:"ToppingSet"`
|
||||
Total_time int `json:"total_time"`
|
||||
Total_weight int `json:"total_weight"`
|
||||
UriData string `json:"uriData"`
|
||||
UseGram bool `json:"useGram"`
|
||||
Weight_float int `json:"weight_float"`
|
||||
}
|
||||
|
||||
func (r *Recipe01) ToMap() map[string]interface{} {
|
||||
var m map[string]interface{}
|
||||
recipeRecord, _ := json.Marshal(r)
|
||||
json.Unmarshal(recipeRecord, &m)
|
||||
return m
|
||||
}
|
||||
|
||||
func (r *Recipe01) FromMap(m map[string]interface{}) Recipe01 {
|
||||
recipeRecord, _ := json.Marshal(m)
|
||||
json.Unmarshal(recipeRecord, &r)
|
||||
return *r
|
||||
}
|
||||
|
||||
type MatRecipe struct {
|
||||
MixOrder int `json:"MixOrder"`
|
||||
FeedParameter int `json:"FeedParameter"`
|
||||
FeedPattern int `json:"FeedPattern"`
|
||||
IsUse bool `json:"isUse"`
|
||||
MaterialPathId int `json:"materialPathId"`
|
||||
PowderGram int `json:"powderGram"`
|
||||
PowderTime int `json:"powderTime"`
|
||||
StirTime int `json:"stirTime"`
|
||||
SyrupGram int `json:"syrupGram"`
|
||||
SyrupTime int `json:"syrupTime"`
|
||||
WaterCold int `json:"waterCold"`
|
||||
WaterYield int `json:"waterYield"`
|
||||
}
|
||||
|
||||
type ToppingSet struct {
|
||||
ListGroupID []int `json:"ListGroupID"`
|
||||
DefaultIDSelect int `json:"defaultIDSelect"`
|
||||
GroupID string `json:"groupID"`
|
||||
IsUse bool `json:"isUse"`
|
||||
}
|
||||
|
||||
type Topping struct {
|
||||
ToppingGroup []ToppingGroup `json:"ToppingGroup"`
|
||||
ToppingList []ToppingList `json:"ToppingList"`
|
||||
}
|
||||
|
||||
type ToppingGroup struct {
|
||||
Desc string `json:"Desc"`
|
||||
GroupID int `json:"groupID"`
|
||||
IDDefault int `json:"idDefault"`
|
||||
IDInGroup string `json:"idInGroup"`
|
||||
InUse bool `json:"inUse"`
|
||||
Name string `json:"name"`
|
||||
OtherName string `json:"otherName"`
|
||||
}
|
||||
|
||||
type ToppingList struct {
|
||||
ExtendID int `json:"ExtendID"`
|
||||
OnTOP bool `json:"OnTOP"`
|
||||
MenuStatus int `json:"MenuStatus"`
|
||||
CashPrice int `json:"cashPrice"`
|
||||
Disable bool `json:"disable"`
|
||||
Disable_by_cup bool `json:"disable_by_cup"`
|
||||
Disable_by_ice bool `json:"disable_by_ice"`
|
||||
EncoderCount int `json:"EncoderCount"`
|
||||
ID int `json:"id"`
|
||||
IsUse bool `json:"isUse"`
|
||||
IsShow bool `json:"isShow"`
|
||||
StringParam string `json:"stringParam"`
|
||||
Name string `json:"name"`
|
||||
NonCashPrice int `json:"nonCashPrice"`
|
||||
OtherName string `json:"otherName"`
|
||||
ProductCode string `json:"productCode"`
|
||||
Recipes []MatRecipe `json:"recipes"`
|
||||
Total_time int `json:"total_time"`
|
||||
Total_weight int `json:"total_weight"`
|
||||
UseGram bool `json:"useGram"`
|
||||
Weight_float int `json:"weight_float"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue