2023-12-05 14:33:45 +07:00
|
|
|
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 {
|
2024-01-09 17:11:15 +07:00
|
|
|
StringParam string `json:"StringParam"`
|
|
|
|
|
AlarmIDWhenOffline int `json:"AlarmIDWhenOffline"`
|
|
|
|
|
BeanChannel bool `json:"BeanChannel"`
|
|
|
|
|
CanisterType string `json:"CanisterType"`
|
|
|
|
|
DrainTimer int `json:"DrainTimer"`
|
|
|
|
|
IceScreamBingsuChannel bool `json:"IceScreamBingsuChannel"`
|
|
|
|
|
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"`
|
|
|
|
|
MaterialName string `json:"materialName"`
|
|
|
|
|
MaterialOtherName string `json:"materialOtherName"`
|
|
|
|
|
RawMaterialUnit string `json:"RawMaterialUnit"`
|
2023-12-05 14:33:45 +07:00
|
|
|
}
|
|
|
|
|
|
2024-02-07 15:39:19 +07:00
|
|
|
func (r *MaterialSetting) ToMap() map[string]interface{} {
|
|
|
|
|
var m map[string]interface{}
|
|
|
|
|
recipeRecord, _ := json.Marshal(r)
|
|
|
|
|
json.Unmarshal(recipeRecord, &m)
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (r *MaterialSetting) FromMap(m MaterialSetting) MaterialSetting {
|
|
|
|
|
recipeRecord, _ := json.Marshal(m)
|
|
|
|
|
json.Unmarshal(recipeRecord, &r)
|
|
|
|
|
return *r
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-05 14:33:45 +07:00
|
|
|
type Recipe01 struct {
|
|
|
|
|
Description string `json:"Description"`
|
|
|
|
|
ExtendID int `json:"ExtendID"`
|
|
|
|
|
OnTOP bool `json:"OnTOP"`
|
|
|
|
|
LastChange string `json:"LastChange"`
|
|
|
|
|
MenuStatus int `json:"MenuStatus"`
|
|
|
|
|
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 {
|
2024-01-11 08:12:19 +07:00
|
|
|
StringParam string `json:"StringParam"`
|
|
|
|
|
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"`
|
2023-12-05 14:33:45 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-07 15:39:19 +07:00
|
|
|
func (r *ToppingGroup) ToMap() map[string]interface{} {
|
|
|
|
|
var m map[string]interface{}
|
|
|
|
|
recipeRecord, _ := json.Marshal(r)
|
|
|
|
|
json.Unmarshal(recipeRecord, &m)
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (r *ToppingGroup) FromMap(m map[string]interface{}) ToppingGroup {
|
|
|
|
|
recipeRecord, _ := json.Marshal(m)
|
|
|
|
|
json.Unmarshal(recipeRecord, &r)
|
|
|
|
|
return *r
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-05 14:33:45 +07:00
|
|
|
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"`
|
2024-01-11 08:12:19 +07:00
|
|
|
StringParam string `json:"StringParam"`
|
2023-12-05 14:33:45 +07:00
|
|
|
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"`
|
|
|
|
|
}
|
2024-02-07 15:39:19 +07:00
|
|
|
|
|
|
|
|
func (r *ToppingList) ToMap() map[string]interface{} {
|
|
|
|
|
var m map[string]interface{}
|
|
|
|
|
recipeRecord, _ := json.Marshal(r)
|
|
|
|
|
json.Unmarshal(recipeRecord, &m)
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (r *ToppingList) FromMap(m map[string]interface{}) ToppingList {
|
|
|
|
|
recipeRecord, _ := json.Marshal(m)
|
|
|
|
|
json.Unmarshal(recipeRecord, &r)
|
|
|
|
|
return *r
|
|
|
|
|
}
|