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