参数错误处理
This commit is contained in:
@@ -117,8 +117,9 @@ func (c *ApiController) CallOpenAPI() {
|
|||||||
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\n", method, accessID, sign)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
result = routerMap[method].Call(parms)
|
result = routerMap[method].Call(parms)
|
||||||
if result[1].Interface() != nil {
|
if result[2].Interface() != nil {
|
||||||
err = result[1].Interface().(error)
|
err = result[2].Interface().(error)
|
||||||
|
errCode = result[1].String()
|
||||||
goto end
|
goto end
|
||||||
}
|
}
|
||||||
goto success
|
goto success
|
||||||
@@ -159,7 +160,7 @@ func (c *ApiController) DoPrint(dataMap map[string]interface{}) (data, errCode s
|
|||||||
)
|
)
|
||||||
globals.SugarLogger.Debugf("Begin API DoPrint data: [%v]", utils.Format4Output(dataMap, true))
|
globals.SugarLogger.Debugf("Begin API DoPrint data: [%v]", utils.Format4Output(dataMap, true))
|
||||||
if orderNo == 0 {
|
if orderNo == 0 {
|
||||||
return data, errCode, fmt.Errorf("参数错误:order_no 不能为空")
|
return data, model.ErrCodeOpenAPIParamErrNormal, fmt.Errorf("参数错误:order_no 不能为空")
|
||||||
}
|
}
|
||||||
printMsg := &model.PrintMsg{
|
printMsg := &model.PrintMsg{
|
||||||
PrintNo: printNo,
|
PrintNo: printNo,
|
||||||
|
|||||||
Reference in New Issue
Block a user