参数错误处理
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)
|
||||
if err == nil {
|
||||
result = routerMap[method].Call(parms)
|
||||
if result[1].Interface() != nil {
|
||||
err = result[1].Interface().(error)
|
||||
if result[2].Interface() != nil {
|
||||
err = result[2].Interface().(error)
|
||||
errCode = result[1].String()
|
||||
goto end
|
||||
}
|
||||
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))
|
||||
if orderNo == 0 {
|
||||
return data, errCode, fmt.Errorf("参数错误:order_no 不能为空")
|
||||
return data, model.ErrCodeOpenAPIParamErrNormal, fmt.Errorf("参数错误:order_no 不能为空")
|
||||
}
|
||||
printMsg := &model.PrintMsg{
|
||||
PrintNo: printNo,
|
||||
|
||||
Reference in New Issue
Block a user