This commit is contained in:
suyl
2021-07-13 16:31:46 +08:00
parent 41f36bd16c
commit cf3d09b39a
2 changed files with 72 additions and 33 deletions

View File

@@ -38,6 +38,9 @@ const (
keyOrderNo = "order_no"
keyContent = "content"
keyMsgID = "msg_id"
keySound = "sound"
keyVolume = "volume"
keySim = "sim"
)
var (
@@ -265,17 +268,17 @@ func (c *ApiController) UpdatePrinter(dataMap map[string]interface{}) (data, err
} else {
name = &nameStr
}
if simStr, ok := dataMap["sim"].(string); !ok {
if simStr, ok := dataMap[keySim].(string); !ok {
sim = nil
} else {
sim = &simStr
}
if soundStr, ok := dataMap["sound"].(string); !ok {
if soundStr, ok := dataMap[keySound].(string); !ok {
sound = nil
} else {
sound = &soundStr
}
if volumeInt, ok := dataMap["volume"].(int); !ok {
if volumeInt, ok := dataMap[keyVolume].(int); !ok {
volume = nil
} else {
volume = &volumeInt