diff --git a/Makefile b/Makefile index 243cabae..c9015b7f 100644 --- a/Makefile +++ b/Makefile @@ -127,9 +127,9 @@ xiang: bindata sed "s/*.iqka.com/$(XIANG_DOMAIN)/g" share/const.go.bak > share/const.go; \ fi; - GOOS=linux GOARCH=amd64 go build -v -o .tmp/xiang-linux-amd64 - GOOS=linux GOARCH=arm GOARM=7 go build -v -o .tmp/xiang-linux-arm - GOOS=linux GOARCH=arm64 GOARM=7 go build -v -o .tmp/xiang-linux-arm64 +# GOOS=linux GOARCH=amd64 go build -v -o .tmp/xiang-linux-amd64 +# GOOS=linux GOARCH=arm GOARM=7 go build -v -o .tmp/xiang-linux-arm +# GOOS=linux GOARCH=arm64 GOARM=7 go build -v -o .tmp/xiang-linux-arm64 GOOS=darwin GOARCH=amd64 go build -v -o .tmp/xiang-darwin-amd64 mkdir -p dist/bin mv .tmp/xiang-*-* dist/bin/ @@ -170,8 +170,8 @@ release: clean fi; cd dist/release && GOOS=linux GOARCH=amd64 go build -v -o ../../.tmp/xiang-${VERSION}-linux-amd64 - cd dist/release && GOOS=linux GOARCH=arm GOARM=7 go build -v -o ../../.tmp/xiang-${VERSION}-linux-arm - cd dist/release && GOOS=linux GOARCH=arm64 GOARM=7 go build -v -o ../../.tmp/xiang-${VERSION}-linux-arm64 +# cd dist/release && GOOS=linux GOARCH=arm GOARM=7 go build -v -o ../../.tmp/xiang-${VERSION}-linux-arm +# cd dist/release && GOOS=linux GOARCH=arm64 GOARM=7 go build -v -o ../../.tmp/xiang-${VERSION}-linux-arm64 cd dist/release && GOOS=darwin GOARCH=amd64 go build -v -o ../../.tmp/xiang-${VERSION}-darwin-amd64 rm -rf dist/release diff --git a/data/bindata.go b/data/bindata.go index f51f2edd..57388e1e 100644 --- a/data/bindata.go +++ b/data/bindata.go @@ -204,7 +204,7 @@ func uiFooBarHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "ui/foo/bar.html", size: 21, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "ui/foo/bar.html", size: 21, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -224,7 +224,7 @@ func uiIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "ui/index.html", size: 12, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "ui/index.html", size: 12, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -244,7 +244,7 @@ func xiangDs_store() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -264,7 +264,7 @@ func xiangApisReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -284,7 +284,7 @@ func xiangApisChartHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -304,7 +304,7 @@ func xiangApisPageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -324,7 +324,7 @@ func xiangApisStorageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/apis/storage.http.json", size: 1092, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/apis/storage.http.json", size: 1092, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -344,7 +344,7 @@ func xiangApisTableHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/apis/table.http.json", size: 2632, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/apis/table.http.json", size: 2632, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -364,7 +364,7 @@ func xiangApisUserHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -384,7 +384,7 @@ func xiangApisXiangHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/apis/xiang.http.json", size: 797, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/apis/xiang.http.json", size: 797, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -404,7 +404,7 @@ func xiangDataAppJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/data/app.json", size: 245, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/data/app.json", size: 245, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -424,7 +424,7 @@ func xiangDataIconsDs_store() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/data/icons/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/data/icons/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -444,7 +444,7 @@ func xiangDataIcons404Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -464,7 +464,7 @@ func xiangDataIconsIconIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/data/icons/icon.icns", size: 75636, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/data/icons/icon.icns", size: 75636, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -484,7 +484,7 @@ func xiangDataIconsIconIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/data/icons/icon.ico", size: 31310, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/data/icons/icon.ico", size: 31310, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -504,7 +504,7 @@ func xiangDataIconsIconPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/data/icons/icon.png", size: 22420, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/data/icons/icon.png", size: 22420, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -524,7 +524,7 @@ func xiangDataIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/data/index.html", size: 302, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/data/index.html", size: 302, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -544,7 +544,7 @@ func xiangFlowsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -564,7 +564,7 @@ func xiangFlowsMenuFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -584,7 +584,7 @@ func xiangFlowsTableGetFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/flows/table/get.flow.json", size: 541, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/flows/table/get.flow.json", size: 541, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -604,7 +604,7 @@ func xiangModelsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -624,7 +624,7 @@ func xiangModelsMenuJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/models/menu.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/models/menu.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -644,7 +644,7 @@ func xiangModelsUserJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/models/user.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/models/user.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -664,7 +664,7 @@ func xiangTablesReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -684,7 +684,7 @@ func xiangTablesMenuJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/tables/menu.json", size: 10382, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/tables/menu.json", size: 10382, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -704,7 +704,7 @@ func xiangTablesUserJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xiang/tables/user.json", size: 1422, mode: os.FileMode(420), modTime: time.Unix(1634745823, 0)} + info := bindataFileInfo{name: "xiang/tables/user.json", size: 1422, mode: os.FileMode(420), modTime: time.Unix(1634960874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/debug.sh b/debug.sh new file mode 100755 index 00000000..9c1dc207 --- /dev/null +++ b/debug.sh @@ -0,0 +1,10 @@ +#!/bin/bash +make clean +make xiang +VERSION=$(go run . version) +rm -rf ../xiang-spec/xiang/* +cp dist/bin/xiang-* ../xiang-spec/xiang/ +rm -f ~/Code/bin/xiang +ln -s ~/Code/yao/xiang-spec/xiang/xiang-darwin-amd64 ~/Code/bin/xiang + +make clean \ No newline at end of file diff --git a/helper/process.go b/helper/process.go index f70dddf6..3c7857fe 100644 --- a/helper/process.go +++ b/helper/process.go @@ -1,9 +1,11 @@ package helper import ( + "fmt" "reflect" "github.com/yaoapp/gou" + "github.com/yaoapp/gou/query/share" "github.com/yaoapp/kun/exception" ) @@ -52,14 +54,20 @@ func ProcessArraySplit(process *gou.Process) interface{} { records = append(records, value) continue } - exception.New("参数错误: 第1个参数不是数组", 400).Ctx(reflect.TypeOf(process.Args[0]).Name()).Throw() + exception.New("参数错误: 第1个参数不是数组", 400).Ctx(fmt.Sprintf("%#v", process.Args[0])).Throw() + } + break + case []share.Record: + for _, v := range args.([]share.Record) { + records = append(records, v) } break case []map[string]interface{}: records = args.([]map[string]interface{}) break default: - exception.New("参数错误: 第1个参数不是数组", 400).Ctx(reflect.TypeOf(process.Args[0]).Name()).Throw() + fmt.Printf("%#v %s\n", args, reflect.TypeOf(args).Kind()) + exception.New("参数错误: 第1个参数不是数组", 400).Ctx(fmt.Sprintf("%#v", process.Args[0])).Throw() break } columns, values := ArraySplit(records)