param
This commit is contained in:
@@ -150,7 +150,7 @@ func (c *ApiController) CallOpenAPI() {
|
||||
err = buildMethodParamErr()
|
||||
goto end
|
||||
}
|
||||
globals.SugarLogger.Debugf("Begin API CallOpenAPI Method: %s, accessUUID:%s, sign:%s\n", method, accessID, sign)
|
||||
globals.SugarLogger.Debugf("Begin API CallOpenAPI Method: %s, accessUUID:%s, sign:%s, ip:%s\n", method, accessID, sign, getRealRemoteIP(c.Ctx.Request))
|
||||
if err == nil {
|
||||
result = routerMap[method].Call(parms)
|
||||
if result[2].Interface() != nil {
|
||||
@@ -249,20 +249,28 @@ func (c *ApiController) UpdatePrinter(dataMap map[string]interface{}) (data, err
|
||||
var (
|
||||
printNo, name, sim, sound string
|
||||
appID, volume int
|
||||
ok bool
|
||||
)
|
||||
globals.SugarLogger.Debugf("Begin API UpdatePrinter data: [%v], ip: %v", utils.Format4Output(dataMap, false))
|
||||
//, getRealRemoteIP(c.Ctx.Request)
|
||||
if _, ok := dataMap[keyPrintNo].(string); !ok {
|
||||
globals.SugarLogger.Debugf("Begin API UpdatePrinter data: [%v]", utils.Format4Output(dataMap, false))
|
||||
if _, ok = dataMap[keyPrintNo].(string); !ok {
|
||||
return buildParamErrCodeAndErr(keyPrintNo)
|
||||
} else {
|
||||
if printNo = dataMap[keyPrintNo].(string); printNo == "" {
|
||||
return buildParamErrCodeAndErr(keyPrintNo)
|
||||
}
|
||||
}
|
||||
name = dataMap[keyName].(string)
|
||||
sim = dataMap["sim"].(string)
|
||||
sound = dataMap["sound"].(string)
|
||||
volume = dataMap["volume"].(int)
|
||||
if name, ok = dataMap[keyName].(string); !ok {
|
||||
name = ""
|
||||
}
|
||||
if sim, ok = dataMap["sim"].(string); !ok {
|
||||
sim = ""
|
||||
}
|
||||
if sound, ok = dataMap["sound"].(string); !ok {
|
||||
sound = ""
|
||||
}
|
||||
if volume, ok = dataMap["volume"].(int); !ok {
|
||||
volume = 0
|
||||
}
|
||||
appID = utils.Str2Int(dataMap[keyAppID].(string))
|
||||
if err = cms.UpdatePrinter(appID, printNo, name, sim, sound, volume); err != nil {
|
||||
globals.SugarLogger.Debugf("End API UpdatePrinter err: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user