aa
This commit is contained in:
@@ -13,7 +13,9 @@ import (
|
|||||||
"github.com/astaxie/beego/client/orm"
|
"github.com/astaxie/beego/client/orm"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -80,6 +82,7 @@ func (c *ApiController) CallOpenAPI() {
|
|||||||
dataMap = make(map[string]interface{})
|
dataMap = make(map[string]interface{})
|
||||||
now = time.Now().Unix()
|
now = time.Now().Unix()
|
||||||
parms, result []reflect.Value
|
parms, result []reflect.Value
|
||||||
|
urls = url.Values{}
|
||||||
app = &model.Apps{}
|
app = &model.Apps{}
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
)
|
)
|
||||||
@@ -140,7 +143,8 @@ func (c *ApiController) CallOpenAPI() {
|
|||||||
}
|
}
|
||||||
//判断app_id和sign匹配end
|
//判断app_id和sign匹配end
|
||||||
//call
|
//call
|
||||||
globals.SugarLogger.Debugf("Begin API CallOpenAPI urls......", c.Ctx.Input.Data())
|
urls, _ = c.Input()
|
||||||
|
dataMap = utils.URLValues2Map(urls)
|
||||||
delete(dataMap, keyMethod)
|
delete(dataMap, keyMethod)
|
||||||
delete(dataMap, keyTimestamp)
|
delete(dataMap, keyTimestamp)
|
||||||
delete(dataMap, keySign)
|
delete(dataMap, keySign)
|
||||||
@@ -275,11 +279,15 @@ func (c *ApiController) UpdatePrinter(dataMap map[string]interface{}) (data, err
|
|||||||
} else {
|
} else {
|
||||||
sound = &soundStr
|
sound = &soundStr
|
||||||
}
|
}
|
||||||
if volumeInt, ok := dataMap[keyVolume].(int); !ok {
|
if volumeStr, ok := dataMap[keyVolume].(string); !ok {
|
||||||
//volume = nil
|
volume = nil
|
||||||
return buildParamErrCodeAndErr(keyVolume)
|
|
||||||
} else {
|
} else {
|
||||||
volume = &volumeInt
|
if volumeInt64, err2 := strconv.ParseInt(volumeStr, 10, 64); err2 == nil {
|
||||||
|
volumeInt := int(volumeInt64)
|
||||||
|
volume = &volumeInt
|
||||||
|
} else {
|
||||||
|
return buildParamErrCodeAndErr(keyVolume)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
appID = utils.Str2Int(dataMap[keyAppID].(string))
|
appID = utils.Str2Int(dataMap[keyAppID].(string))
|
||||||
if err = cms.UpdatePrinter(appID, printNo, name, sim, sound, volume); err != nil {
|
if err = cms.UpdatePrinter(appID, printNo, name, sim, sound, volume); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user