From 128038da5fc3f4504cff483ed724801e9d3c7bd7 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 23 Oct 2021 11:28:43 +0800 Subject: [PATCH] debig --- helper/process.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/helper/process.go b/helper/process.go index 52668acf..f70dddf6 100644 --- a/helper/process.go +++ b/helper/process.go @@ -1,6 +1,8 @@ package helper import ( + "reflect" + "github.com/yaoapp/gou" "github.com/yaoapp/kun/exception" ) @@ -50,13 +52,14 @@ func ProcessArraySplit(process *gou.Process) interface{} { records = append(records, value) continue } - exception.New("参数错误: 第1个参数不是字符串数组", 400).Ctx(process.Args[0]).Throw() + exception.New("参数错误: 第1个参数不是数组", 400).Ctx(reflect.TypeOf(process.Args[0]).Name()).Throw() } + break case []map[string]interface{}: records = args.([]map[string]interface{}) - + break default: - exception.New("参数错误: 第1个参数不是字符串数组", 400).Ctx(process.Args[0]).Throw() + exception.New("参数错误: 第1个参数不是数组", 400).Ctx(reflect.TypeOf(process.Args[0]).Name()).Throw() break } columns, values := ArraySplit(records)