change display, add StringParam (WIP)

This commit is contained in:
pakintada@gmail.com 2024-01-09 17:11:15 +07:00
parent dd1c072201
commit 98341d2d80
11 changed files with 352 additions and 125 deletions

View file

@ -1 +0,0 @@
/Users/wanloprungsiyangkul/project/cofffeemachineConfig

@ -0,0 +1 @@
Subproject commit 6e0d512afc4667a2204ff773ad8a3851120cdadd

View file

@ -28,31 +28,33 @@ type MaterialCode struct {
}
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"`
MaterialName string `json:"materialName"`
MaterialOtherName string `json:"materialOtherName"`
RawMaterialUnit string `json:"RawMaterialUnit"`
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"`
}
type Recipe01 struct {

View file

@ -71,7 +71,7 @@ func (mr *MaterialRouter) GetFullMaterialDetail(w http.ResponseWriter, r *http.R
materialDetails = append(materialDetails, map[string]interface{}{
"materialId": matSetting.ID,
"name": mat_name,
"type": "powder:" + strconv.FormatBool(matSetting.PowderChannel) + ",syrup:" + strconv.FormatBool(matSetting.SyrupChannel) + ",bean:" + strconv.FormatBool(matSetting.BeanChannel) + ",equipment:" + strconv.FormatBool(matSetting.IsEquipment),
"type": "powder:" + strconv.FormatBool(matSetting.PowderChannel) + ",syrup:" + strconv.FormatBool(matSetting.SyrupChannel) + ",bean:" + strconv.FormatBool(matSetting.BeanChannel) + ",equipment:" + strconv.FormatBool(matSetting.IsEquipment) + ",soda:" + strconv.FormatBool(matSetting.SodaChannel) + ",icecream:" + strconv.FormatBool(matSetting.IceScreamBingsuChannel),
})
}