check
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user