From 311028bf7c28f0a69919346b339143b46cea1fc9 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Nov 2022 11:05:33 +0800 Subject: [PATCH 1/6] [change] form.bind layout --- widgets/form/layout.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/widgets/form/layout.go b/widgets/form/layout.go index cc489a3e..d38bc84b 100644 --- a/widgets/form/layout.go +++ b/widgets/form/layout.go @@ -47,6 +47,9 @@ func (layout *LayoutDSL) BindModel(m *gou.Model, formID string, fields *FieldsDS if ok && name != "deleted_at" { if col, has := fields.formMap[name]; has { width := 12 + if col.Edit != nil && (col.Edit.Type == "TextArea" || col.Edit.Type == "Upload") { + width = 24 + } // if c, has := m.Columns[name]; has { // typ := strings.ToLower(c.Type) // if typ == "id" || strings.Contains(typ, "integer") || strings.Contains(typ, "float") { @@ -137,6 +140,9 @@ func (layout *LayoutDSL) BindTable(tab *table.DSL, formID string, fields *Fields name := column.Key if col, has := fields.Form[name]; has && column.Bind != "deleted_at" { width := 12 + if col.Edit != nil && (col.Edit.Type == "TextArea" || col.Edit.Type == "Upload") { + width = 24 + } columns = append(columns, Column{InstanceDSL: component.InstanceDSL{Name: col.Key, Width: width}}) } } From dbd92f2d58188029f7f7d19320305a8fadcb1d9f Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Nov 2022 11:19:03 +0800 Subject: [PATCH 2/6] [fix] load icons bug --- app/app.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index 66b86c4e..9fa96705 100644 --- a/app/app.go +++ b/app/app.go @@ -43,16 +43,15 @@ func LoadInfo(root string) { exception.New("解析应用失败 %s", 500, err).Throw() } } - - if fs.MustExists("/yao/icons/icon.icns") { + if has, _ := fs.Exists("/yao/icons/icon.icns"); has { info.Icons.Set("icns", xfs.Encode(fs.MustReadFile("/yao/icons/icon.icns"))) } - if fs.MustExists("/yao/icons/icon.ico") { + if has, _ := fs.Exists("/yao/icons/icon.ico"); has { info.Icons.Set("ico", xfs.Encode(fs.MustReadFile("/yao/icons/icon.ico"))) } - if fs.MustExists("/yao/icons/icon.png") { + if has, _ := fs.Exists("/yao/icons/icon.png"); has { info.Icons.Set("png", xfs.Encode(fs.MustReadFile("/yao/icons/icon.png"))) } From 78397bcdb3f24410cb47dbddf5aa408f52fdec96 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Nov 2022 11:48:48 +0800 Subject: [PATCH 3/6] [add] yao-int to binary --- Makefile | 49 ++++++ data/bindata.go | 430 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 440 insertions(+), 39 deletions(-) diff --git a/Makefile b/Makefile index baacdda5..4afc4b16 100644 --- a/Makefile +++ b/Makefile @@ -139,12 +139,28 @@ pack: bindata fmt .PHONY: bindata bindata: + +# Setup Workdir + rm -rf .tmp/data + rm -rf .tmp/yao-init mkdir -p .tmp/data + +# Checkout init + git clone https://github.com/YaoApp/yao-init.git .tmp/yao-init + rm -rf .tmp/yao-init/.git + rm -rf .tmp/yao-init/.gitignore + rm -rf .tmp/yao-init/LICENSE + rm -rf .tmp/yao-init/README.md + +# Copy Files + cp -r .tmp/yao-init .tmp/data/init cp -r ui .tmp/data/ + cp -r ui .tmp/data/public cp -r xgen .tmp/data/ cp -r yao .tmp/data/ go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/... rm -rf .tmp/data + rm -rf .tmp/yao-init # make artifacts-linux .PHONY: artifacts-linux @@ -160,15 +176,23 @@ artifacts-linux: clean rm -f ../xgen-v1.0/pnpm-lock.yaml echo "BASE=__yao_admin_root" > ../xgen-v1.0/packages/xgen/.env cd ../xgen-v1.0 && pnpm install && pnpm run build + # Setup UI cd ../xgen-v1.0/packages/setup && pnpm install && pnpm run build +# Init Application + cd ../yao-init rm -rf .git + cd ../yao-init rm -rf .gitignore + cd ../yao-init rm -rf LICENSE + cd ../yao-init rm -rf README.md + # Packing mkdir -p .tmp/data/xgen cp -r ./ui .tmp/data/ui cp -r ../xgen-v0.9/dist .tmp/data/xgen/v0.9 cp -r ../xgen-v1.0/packages/setup/build .tmp/data/xgen/setup cp -r ../xgen-v1.0/packages/xgen/dist .tmp/data/xgen/v1.0 + cp -r ../yao-init .tmp/data/init cp -r yao .tmp/data/ go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/... rm -rf .tmp/data @@ -206,9 +230,15 @@ artifacts-macos: clean rm -f ../xgen-v1.0/pnpm-lock.yaml echo "BASE=__yao_admin_root" > ../xgen-v1.0/packages/xgen/.env cd ../xgen-v1.0 && pnpm install && pnpm run build + # Setup UI cd ../xgen-v1.0/packages/setup && pnpm install && pnpm run build +# Init Application + cd ../yao-init rm -rf .git + cd ../yao-init rm -rf .gitignore + cd ../yao-init rm -rf LICENSE + cd ../yao-init rm -rf README.md # Packing mkdir -p .tmp/data/xgen @@ -216,6 +246,7 @@ artifacts-macos: clean cp -r ../xgen-v0.9/dist .tmp/data/xgen/v0.9 cp -r ../xgen-v1.0/packages/setup/build .tmp/data/xgen/setup cp -r ../xgen-v1.0/packages/xgen/dist .tmp/data/xgen/v1.0 + cp -r ../yao-init .tmp/data/init cp -r yao .tmp/data/ go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/... rm -rf .tmp/data @@ -281,6 +312,14 @@ release: clean # Setup UI cd .tmp/xgen/v1.0/packages/setup && pnpm install && pnpm run build + +# Checkout init + git clone https://github.com/YaoApp/yao-init.git .tmp/yao-init + rm -rf .tmp/yao-init/.git + rm -rf .tmp/yao-init/.gitignore + rm -rf .tmp/yao-init/LICENSE + rm -rf .tmp/yao-init/README.md + # Packing mkdir -p .tmp/data/xgen cp -r ./ui .tmp/data/ui @@ -288,6 +327,7 @@ release: clean cp -r .tmp/xgen/v0.9/dist .tmp/data/xgen/v0.9 cp -r .tmp/xgen/v1.0/packages/setup/build .tmp/data/xgen/setup cp -r .tmp/xgen/v1.0/packages/xgen/dist .tmp/data/xgen/v1.0 + cp -r .tmp/yao-init .tmp/data/init go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/... rm -rf .tmp/data rm -rf .tmp/xgen @@ -326,6 +366,14 @@ linux-release: clean # Setup UI cd .tmp/xgen/v1.0/packages/setup && pnpm install && pnpm run build + +# Checkout init + git clone https://github.com/YaoApp/yao-init.git .tmp/yao-init + rm -rf .tmp/yao-init/.git + rm -rf .tmp/yao-init/.gitignore + rm -rf .tmp/yao-init/LICENSE + rm -rf .tmp/yao-init/README.md + # Packing mkdir -p .tmp/data/xgen cp -r ./ui .tmp/data/ui @@ -333,6 +381,7 @@ linux-release: clean cp -r .tmp/xgen/v0.9/dist .tmp/data/xgen/v0.9 cp -r .tmp/xgen/v1.0/packages/setup/build .tmp/data/xgen/setup cp -r .tmp/xgen/v1.0/packages/xgen/dist .tmp/data/xgen/v1.0 + cp -r .tmp/yao-init .tmp/data/init go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/... rm -rf .tmp/data rm -rf .tmp/xgen diff --git a/data/bindata.go b/data/bindata.go index ff8dc740..4ba244d2 100644 --- a/data/bindata.go +++ b/data/bindata.go @@ -1,5 +1,19 @@ // Code generated for package data by go-bindata DO NOT EDIT. (@generated) // sources: +// .tmp/data/init/app.json +// .tmp/data/init/charts/dashboard.chart.json +// .tmp/data/init/flows/app/menu.flow.json +// .tmp/data/init/forms/pet.form.json +// .tmp/data/init/langs/zh-cn/global.yml +// .tmp/data/init/langs/zh-hk/langs/global.yml +// .tmp/data/init/logins/admin.login.json +// .tmp/data/init/logins/user.login.json +// .tmp/data/init/models/pet.mod.json +// .tmp/data/init/public/index.html +// .tmp/data/init/scripts/demo.js +// .tmp/data/init/scripts/stat.js +// .tmp/data/init/tables/pet.tab.json +// .tmp/data/public/index.html // .tmp/data/ui/index.html // .tmp/data/xgen/setup/index.html // .tmp/data/xgen/v0.9/index.html @@ -202,6 +216,286 @@ func AssetFile() http.FileSystem { return &assetOperator{} } +var _initAppJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x8e\x3d\x6b\xc4\x30\x0c\x86\xf7\xfc\x0a\xa1\x39\x98\x5c\x47\x6f\x07\x37\x77\x68\xc7\xd2\x41\x24\x4a\x62\xb0\x2d\x63\x2b\xfd\xe0\xc8\x7f\x2f\xb6\xaf\x14\x3a\xea\x79\x5e\xbd\xd2\x7d\x00\xc0\xaf\x8d\x23\x5a\xc0\x8b\x99\x70\xac\x20\x52\xe0\x0a\xac\xbd\x71\x10\xb8\xa6\xe4\xdd\x4c\xea\x24\x76\x5f\x76\xc9\xfa\x17\xe8\x70\xe1\x32\x67\x97\x5a\xaa\xa9\x6b\x14\xdd\x39\xc3\x37\x09\xd0\xff\x8a\x0f\xce\xe5\x91\x9c\xcc\x65\x32\x4f\x1d\xd3\x12\x5c\x7c\x11\x69\xed\x6d\x78\x5c\x64\x3d\x52\x65\xfd\x46\x31\x0b\x07\x31\x37\x52\xea\x3e\x70\x3c\xd0\xc2\x1d\x30\x65\x99\xb9\x94\x9a\x5d\xbd\x7c\x16\x43\x29\x99\xa6\x47\x40\xca\x5b\x35\x6f\x58\xd7\xf1\x1d\xce\xb6\x2c\xed\x69\xf2\xbd\x60\x77\x0b\x3f\x8b\xba\xf5\xf7\x5f\x0b\x9a\x0f\x1e\xbb\x79\x65\x55\x17\x37\xb4\xb0\x92\x2f\x0c\xe7\x70\x0e\x3f\x01\x00\x00\xff\xff\xea\x60\x22\x8d\x45\x01\x00\x00") + +func initAppJsonBytes() ([]byte, error) { + return bindataRead( + _initAppJson, + "init/app.json", + ) +} + +func initAppJson() (*asset, error) { + bytes, err := initAppJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/app.json", size: 325, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initChartsDashboardChartJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x59\xdb\x6e\xdb\x36\x18\xbe\xcf\x53\x08\x04\x7a\xe7\xc6\x8e\xd1\x16\x9d\xef\xd6\xee\x62\xc5\x8a\x21\x68\x7b\x17\x14\x01\x2d\xd1\x31\x11\x49\x14\x28\x2a\x89\x17\x18\xd8\xd0\xb5\xf1\xb2\x76\xe7\x2e\x05\x5a\x0c\x2b\x86\x62\x87\x8b\xb4\x03\x82\x20\x4b\xd6\x0e\xd8\xb3\x54\x72\xf2\x16\x03\x29\x5b\x26\x29\xc9\x96\x0b\xcd\x39\x5c\xb4\x4e\xfe\x03\xff\xd3\xf7\x59\xfc\xb5\x39\x67\x18\xc0\x85\x0e\x02\x0d\x03\x44\x8f\x5f\x45\x8f\x76\xc3\xa7\x6f\x8e\x9f\xff\x06\x2a\x5c\x62\x12\xb7\x85\x57\x40\xc3\xe0\x7a\x86\x01\x5a\x81\x6d\x83\x86\xd1\x82\xb6\x8f\xe6\x0c\xa3\x2b\x94\xa0\xc9\x30\x71\x47\x4a\x4d\xd4\x22\x14\x35\x2c\xc8\x20\xf7\xea\x9b\x14\x7b\xcc\x9f\xf7\x19\x64\xf3\xd7\x84\xec\x03\x2e\xaa\xc4\xda\x03\xb5\xd8\xd6\x30\x80\x47\x89\x89\x7c\x3f\x65\x29\xd9\x70\x2b\xd4\x82\x81\xcd\x40\xc3\x58\x02\xf5\x5a\xbd\x7e\xb1\xf6\xde\xc5\x7a\x0d\xdc\x15\xf2\xee\xc0\x35\x6c\x31\x44\xb3\xe3\x78\x9f\x8b\x84\xcb\x24\x0d\x1b\x76\x48\xc0\x46\x69\x10\x0f\x51\xa8\x64\x96\xe4\xca\xa3\x5b\x1a\xfc\xc9\x48\x84\x42\x81\x61\x66\x8b\x62\x86\xbb\x4f\xfa\xaf\xbf\x8d\x7e\xdc\x8a\x9e\xff\x92\xc4\x2d\x54\xb0\x29\x7c\x8a\xff\x2f\x36\x09\x59\x55\xc5\x5a\x39\x93\xbf\x5f\x27\x8e\x43\xdc\xf9\x36\xf6\x19\xa1\x9d\xc5\xc0\x6f\x73\x1d\x03\x78\x90\xb5\x87\x1d\x6c\x33\xe6\xf9\x8d\x6a\xb5\x03\x09\xf4\x3c\x7f\xde\x24\x4e\xd5\x22\x26\x30\xba\x92\xaf\xd1\xe7\xe1\x27\xb5\x6c\x2d\x6c\x33\x44\xe5\xac\x4d\x62\x07\x4e\x9c\xf5\xa6\x34\x2e\x3b\xfb\x27\x3b\x7b\xe1\xc3\xc3\x93\x9d\x3d\x50\x31\xc0\x3a\xb6\x18\x8f\xe9\x8a\xd1\x55\x1d\x9a\x6d\x48\x59\x8e\xbf\x51\x15\x47\x8e\xc3\xdd\x9f\xfb\x5f\xfc\x1e\x3d\x7e\x75\xb2\xf5\xb5\xe6\xb8\x92\xaf\xdf\xff\xf3\x28\xfc\xe9\xcb\x42\xfa\xaf\xbf\x8f\x9e\xf5\xa2\x1f\xf6\xc3\xfb\x2f\x0a\xe9\x3f\x3c\x0a\x0f\x7a\xd3\xc6\x13\xeb\x2f\xbf\x3d\xd8\x8e\x9e\xf5\xa6\x4d\x63\x1a\x33\x29\x9b\x69\xcc\xa4\xa4\xa6\x30\x4b\x57\xed\x6a\xae\xe6\xcb\x70\xeb\xb0\x88\x66\xff\xe8\xef\xf0\x9b\xde\xf1\xcb\xcf\xc3\xde\x83\x62\x9e\x45\xae\xd1\xf6\x93\xfe\xe1\x3f\xe1\xd3\x37\xc5\xa3\x99\xce\x46\x8e\x6b\x4a\x4b\xd1\xc4\xe8\xab\xef\xc2\x83\x7b\xb2\xfe\x42\x3d\xcf\x60\x7b\x3f\xfa\xf4\xb3\xb0\xf7\xa0\xb0\x81\x88\x2d\xda\xef\x1d\xef\xfd\x25\x1b\xd4\x2f\xe9\xa8\x4e\x08\xae\x85\x91\x6d\xf9\x12\x99\xa7\x70\xae\x20\x5a\x26\x20\xd0\xc4\xae\xc5\x8f\xa5\xd0\x5d\x41\x12\x5f\x01\x64\x61\x16\xf3\x10\xeb\x78\x22\xb2\x5b\x5c\x65\x11\x9b\xab\x88\xf2\xc0\x3c\x4a\x3c\x71\x68\x37\x09\xac\x3b\x9e\x1d\x06\x23\x96\x79\x3e\x76\x4d\xe2\x28\x01\xd8\xd8\x5d\xe5\x92\xea\x46\xf5\x0e\x6c\xda\xa8\xea\x21\x26\xcb\x63\x4e\x57\xd9\xff\x46\xca\xcb\x1a\x46\xeb\x1a\xe5\x26\x09\x7d\x1c\x38\x4d\x44\xaf\x8b\x30\x15\xa6\x4e\x52\x53\x89\x5a\x24\xf4\x21\xc2\x2b\x6d\x7e\xf2\xc2\xe5\x5a\x45\x95\x7b\x14\xb5\xf0\x06\xf7\xfc\xef\x0b\xa0\xc9\x2c\x64\x62\x07\xda\xdc\x6b\x5d\x13\xf1\xce\x7f\x84\x3a\xdc\xce\x82\x0c\xe9\x96\x6b\xd0\x0e\x86\x72\xf1\x19\x8c\xa5\xfc\x64\xaa\x86\x38\xcd\x2c\xb7\x49\x7c\x36\x4d\xb1\x67\x59\x46\x93\xd8\x84\x8a\x99\x44\x96\x5e\x8c\x33\x56\x62\x85\xe0\x72\x70\xc5\xa6\x9a\xea\x53\x29\x34\xd1\xd1\x2f\xc4\x81\x2b\x18\x00\x08\xf2\xce\x2d\xf5\xc2\xcc\xa6\x59\xfb\x6e\x28\x89\x46\x4a\x2d\x38\xa4\xd6\x6d\xd6\x11\xcf\x89\xe2\x01\xce\xb2\xb0\xcb\x9f\xb2\x6b\x32\xd9\x2b\x47\xd8\xd8\x4d\xd5\x48\xeb\x5b\xfd\x5c\xf0\xcc\xa4\xce\x9c\x2a\xe3\xcc\xa6\x2f\xe7\x94\xb8\x26\x75\xee\x54\x29\x6c\xc6\x9d\x3b\x0f\x4c\xa8\xdc\xa2\x32\x3b\xe6\x21\xb6\x6c\x92\xc0\x2d\x19\x70\x39\x1d\x1b\xd5\xe7\xed\xc1\x1f\xa0\x40\xe8\x83\x0b\x5d\x6e\xe8\xe2\xd4\x72\x23\xeb\xff\xfa\x68\x42\x64\xf2\xd5\x71\xcc\x57\xcb\xb2\x43\x5c\xd6\xb6\x3b\x25\xc7\x17\xde\xbf\x37\x21\x3e\xf9\xaa\x9a\x19\x9f\x45\x4c\x46\x68\xba\xef\xb3\xeb\xab\x7a\xe7\xcc\x6e\x2f\x45\x6b\xcb\xb3\x1d\xcf\x77\x26\x14\x39\xfb\x34\x9b\xaf\x2d\x27\x1b\xa1\x38\xe1\x78\xc9\x36\x1d\x88\xd5\x9d\xc0\xf8\x8a\xe9\xa8\x38\xbb\x05\xe3\x60\x2b\xbf\x60\x19\xdb\x90\xfc\x82\xe5\x83\xf5\xec\x96\x8d\x73\x40\xf9\x65\xcb\xd8\x06\xe5\x97\x2d\x8f\x43\xce\x6e\xd1\xfe\x17\x70\x2a\x5b\x9e\x6c\xb2\x85\x0c\xfa\x24\xa0\x26\x2a\x15\x97\x8b\x18\x15\x2a\x54\x7b\xf8\x28\x53\xbf\xa4\x3f\xca\x48\x4f\x1d\x5a\x64\x42\xec\x23\x8a\x91\xba\xa0\x8d\x7f\x36\xb5\xdf\xb5\x27\x14\x7d\x24\x12\x25\x4a\x7c\x74\x67\x10\x3e\xa4\x08\x66\xea\x40\x0b\x07\xe2\xd0\x85\x5a\xc5\x58\xa8\xd5\xee\x66\x28\x99\xc8\x8d\xb7\x56\x4b\xe0\x4a\xed\x02\xa8\x18\xe0\x72\xed\x02\xc8\xd2\xc4\x0c\x39\xd2\x98\x34\x09\xb5\x10\xbd\x35\x3c\xe3\x8a\xb2\x13\x37\x94\x56\x1b\xc9\xf6\x4c\x97\x48\xf3\x05\x28\x6a\x29\xeb\x33\x43\x6e\x91\xe8\x69\xb1\x69\xce\x58\x86\xc7\x3f\x9b\xd2\xeb\x84\xd1\x76\x9b\xcf\xd4\x0d\xd7\x42\x1b\x49\xef\xf4\xa9\x57\x2d\x47\x7b\x6b\xc5\x32\xee\x54\xb1\xa4\xd3\x93\x2f\xaf\x2b\x27\x4d\xbe\xcf\x20\x0b\xfc\xa2\xb3\x7d\x0d\x16\x23\x81\x62\xb3\x9d\x3a\x5b\x28\xc0\x0d\xec\xdf\x84\x4d\x64\xa7\xdc\xf2\xb1\xe1\xf3\xb5\x06\xb9\xac\xa6\xd7\x15\xb4\x88\xcb\x6e\xe3\x4f\x90\xb8\x1e\x28\x42\x9d\x79\x4a\x47\xd0\xb0\x40\x4d\xad\x40\x03\xb1\xb8\x9b\x5c\x1b\x5e\x23\x32\xf1\x35\x11\x10\x19\x36\xbe\x67\x63\x76\x93\xdf\x95\x84\x8d\xdf\x26\xeb\xc3\x17\x80\x99\xfa\x4a\x69\x75\xfd\x73\x05\x38\x31\xe2\x29\xd8\x0c\x06\xea\x14\x20\x27\x2f\xfc\x27\x41\x4e\xdf\xa2\x8c\x03\x1c\x6f\x6e\xb9\xa0\x13\xef\x28\xc6\x41\x4e\x03\x99\x06\xab\xd2\xa0\xe4\x33\xd8\x19\x87\xa4\x8c\x15\x40\x7c\x9e\x43\x88\x78\x99\xc2\x68\x80\xb2\xe4\x1d\xa7\x49\xec\x41\xbc\x57\xcf\x03\xd0\x52\xc3\x3a\x89\x83\xfc\x77\xa1\xa0\x33\x97\xf6\x34\x40\x9b\x1b\xfe\xdb\x9d\xeb\xce\xfd\x17\x00\x00\xff\xff\xd0\x0b\x67\xa8\x17\x21\x00\x00") + +func initChartsDashboardChartJsonBytes() ([]byte, error) { + return bindataRead( + _initChartsDashboardChartJson, + "init/charts/dashboard.chart.json", + ) +} + +func initChartsDashboardChartJson() (*asset, error) { + bytes, err := initChartsDashboardChartJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/charts/dashboard.chart.json", size: 8471, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initFlowsAppMenuFlowJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x92\x4f\x4b\xc3\x30\x18\xc6\xef\xfd\x14\x2f\x39\x57\xb2\xed\xd8\x9b\x08\xde\x84\x1d\xbc\xc9\x90\xb4\x09\x34\x2c\x4b\x4a\x97\x4e\x65\xec\xae\x88\x88\x07\xf5\xa0\xe0\x76\x10\xe6\xc5\x4f\x30\xf6\x6d\xba\xf5\x63\x48\x8a\xeb\x9f\x6d\x75\x4e\x36\x2f\x6d\xde\x27\xff\x9e\xdf\xfb\xa4\x6f\x01\x20\x49\x3a\x0c\x39\x80\x0e\x9b\x4d\x38\x61\x32\x42\x76\xaa\x2a\xca\xba\xc8\x81\xb3\x56\x5a\xaa\x48\x07\x91\x36\xb5\x05\x00\xd0\x4f\xbf\x00\x88\x53\xe4\x40\xdd\x5e\x94\xae\x50\x5e\xdb\x6c\xab\x65\x12\xf7\x94\x34\xc7\x9b\xff\x01\xf1\x34\xef\x71\x7d\x85\xb2\xe9\xc5\xed\xf1\xcb\x34\x19\x8d\x73\x3d\x20\x21\x93\xe6\x42\x19\x09\x51\x50\xb5\x6f\x56\xe3\x4b\x7c\xe4\x93\x50\x63\x4a\xba\xbe\xab\x48\x48\xf3\x9d\x3d\xde\xe5\xae\x60\xe7\x1d\xc3\xe2\x40\x2d\xd5\x07\xf6\x1a\xdf\x8d\x5f\xfb\x76\x95\x6a\xaf\x7a\x4e\x46\xe3\xd9\x70\xb2\x85\xe7\x53\xe2\x0a\x86\x03\xa6\x2b\xdd\xe6\xad\xf4\x7c\x2e\x68\xc8\x64\xd6\xf3\xa2\xff\x0a\xd3\x1b\x8c\x97\x1b\xfe\x39\x9c\xdf\x7c\xc4\xd7\xcf\xc5\xb6\x17\x7a\x53\xab\x97\x8f\xcd\xe0\x1a\x4b\xf2\x0f\x74\x6b\x09\xb3\xb9\xc1\xf7\xa8\xb5\x8b\x84\x3c\xc1\x83\xa5\x87\x50\x88\x29\xbe\x7b\xdc\x22\xa6\x63\x15\x76\x0c\x07\xae\x63\x46\xf9\xff\x85\xb5\xca\x50\xe2\x98\x4f\x9e\x92\xe9\xc3\x6c\x3c\x8a\x27\xf7\xbb\x49\xac\x0a\x74\x43\x6e\xf6\xde\x10\x67\x6f\xef\xf3\xd7\xdb\x3d\x21\xf6\x38\xbb\xf8\xdb\xd3\xb4\xcc\x68\x60\x7d\x05\x00\x00\xff\xff\xf6\x10\xcd\xdb\x2f\x05\x00\x00") + +func initFlowsAppMenuFlowJsonBytes() ([]byte, error) { + return bindataRead( + _initFlowsAppMenuFlowJson, + "init/flows/app/menu.flow.json", + ) +} + +func initFlowsAppMenuFlowJson() (*asset, error) { + bytes, err := initFlowsAppMenuFlowJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/flows/app/menu.flow.json", size: 1327, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initFormsPetFormJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xaa\xe6\x52\x50\x50\xca\x4b\xcc\x4d\x55\xb2\x52\x50\x7a\xba\x6e\xc1\xf3\xce\x95\x4a\x3a\x20\xb1\xc4\xe4\x92\xcc\xfc\x3c\x25\x2b\x05\x90\x0a\x05\x05\xa5\xa4\xcc\xbc\x14\x10\x4f\x41\x29\x37\x3f\x25\x35\x07\xa4\xbc\x20\xb5\x44\x49\x47\x41\x29\xbf\x00\xa6\xb2\x56\xa1\x96\x4b\x41\xa1\x96\xab\x96\x0b\x10\x00\x00\xff\xff\x80\xb9\x61\x26\x57\x00\x00\x00") + +func initFormsPetFormJsonBytes() ([]byte, error) { + return bindataRead( + _initFormsPetFormJson, + "init/forms/pet.form.json", + ) +} + +func initFormsPetFormJson() (*asset, error) { + bytes, err := initFormsPetFormJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/forms/pet.form.json", size: 87, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initLangsZhCnGlobalYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe2\x72\x49\xcd\xcd\xb7\x52\x78\xb6\x67\xca\xf3\x25\xbb\xc0\x1c\x05\xc7\x82\x82\x9c\xcc\xe4\xc4\x92\xcc\xfc\x3c\x2b\x85\xe7\x4b\x76\x3d\xd9\xd7\xfd\x74\xd7\x94\xe7\x53\x56\x70\x39\xe6\xe5\x97\x64\xa4\x16\x29\x54\x26\xe6\x2b\x24\x22\xab\x7a\xda\xdf\xf1\x64\x47\xc3\x93\x1d\xab\x14\x22\x1d\xfd\x15\x20\xaa\x01\x01\x00\x00\xff\xff\x33\x85\x58\x87\x5a\x00\x00\x00") + +func initLangsZhCnGlobalYmlBytes() ([]byte, error) { + return bindataRead( + _initLangsZhCnGlobalYml, + "init/langs/zh-cn/global.yml", + ) +} + +func initLangsZhCnGlobalYml() (*asset, error) { + bytes, err := initLangsZhCnGlobalYmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/langs/zh-cn/global.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initLangsZhHkLangsGlobalYml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe2\x72\x49\xcd\xcd\xb7\x52\x78\xb6\x67\xca\xf3\x25\xbb\xc0\x1c\x05\xc7\x82\x82\x9c\xcc\xe4\xc4\x92\xcc\xfc\x3c\x2b\x85\xe7\x4b\x76\x3d\xd9\xd7\xfd\xac\xbd\xf3\xf9\x94\x15\x5c\x8e\x79\xf9\x25\x19\xa9\x45\x0a\x95\x89\xf9\x0a\x89\xc8\xaa\x9e\xf6\x77\x3c\xd9\xd1\xf0\xb4\xa1\x3b\xd2\xd1\x1f\xa2\x16\x10\x00\x00\xff\xff\xbe\x23\xc9\x88\x58\x00\x00\x00") + +func initLangsZhHkLangsGlobalYmlBytes() ([]byte, error) { + return bindataRead( + _initLangsZhHkLangsGlobalYml, + "init/langs/zh-hk/langs/global.yml", + ) +} + +func initLangsZhHkLangsGlobalYml() (*asset, error) { + bytes, err := initLangsZhHkLangsGlobalYmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/langs/zh-hk/langs/global.yml", size: 88, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initLoginsAdminLoginJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x44\x8f\xc1\x4a\x04\x31\x10\x44\xef\xf3\x15\x4d\x9f\xdd\xc9\x3d\x20\xb2\xa8\x37\x3d\xcb\x22\x1e\xda\x99\x38\x13\x4c\xba\x43\xd2\x0b\x06\xd9\x7f\x97\x8e\xe8\x9e\xeb\xd5\xa3\xea\x7b\x02\x40\xa6\x1c\xd0\x03\x7a\x7f\x5c\x73\x64\x78\x92\x2d\x32\xde\x58\x44\x8b\x46\x61\xf4\x60\x20\x00\x96\x2a\x4b\x68\xcd\xe8\x4e\x32\x27\x23\xe7\xd1\x1a\xbc\x35\xea\x66\xf1\x2b\xfa\x42\x3d\x09\xad\xf8\x36\x01\x5c\x86\x2d\x51\x97\xb3\x5e\x6d\x81\xb5\x76\x73\xb9\x2f\x77\xbf\x53\x55\xb7\x52\xdb\xdf\x85\xea\xfa\xa7\x6b\x49\x36\xe2\xdf\x75\xcf\xf4\x19\xe0\x24\xe7\x0a\x0f\x35\x50\x86\x97\xa8\x3b\x9c\x48\xe0\x58\x0a\x3c\xf2\x16\x39\xfc\xd7\xa2\x8e\x4b\xbb\x6a\x69\xde\xb9\x4e\x42\xa5\xb4\x79\x91\x7c\xf7\x51\x25\xdf\x46\x6e\x4a\xbc\x84\x03\xd9\xf8\xc3\x38\x82\x36\x74\xba\x4c\x3f\x01\x00\x00\xff\xff\x78\x4b\x48\x60\x15\x01\x00\x00") + +func initLoginsAdminLoginJsonBytes() ([]byte, error) { + return bindataRead( + _initLoginsAdminLoginJson, + "init/logins/admin.login.json", + ) +} + +func initLoginsAdminLoginJson() (*asset, error) { + bytes, err := initLoginsAdminLoginJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/logins/admin.login.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initLoginsUserLoginJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x44\x8f\x31\x4b\x04\x41\x0c\x46\xfb\xfd\x15\x61\x6a\x6f\xa7\x1f\xb0\x10\xb4\xd3\x4e\x91\x43\x2c\xe2\x1a\xf7\x06\x67\x93\x90\x64\xc1\x45\xee\xbf\xcb\xac\xe8\xd5\xf9\xde\xe3\xe5\x7b\x00\x48\x8c\x0b\xa5\x02\xa9\x94\x27\x27\x83\x7b\x99\x2b\xa7\xab\x7e\xc1\x29\xaa\x70\x2a\xd0\x77\x00\x49\x4d\x26\x72\xef\x63\x9f\xac\x6a\xf8\xb8\x3a\xd9\x78\x41\x3a\x64\x73\x5f\xbc\xa4\xa2\xb8\x35\xc1\xf7\xf4\x3a\x00\x9c\x77\x61\xc3\x4d\xd6\xb8\x08\x89\xc3\xb6\xae\xcb\x5f\xf9\x11\xdf\x1a\x65\xa5\xf8\x13\x79\x93\x19\xf9\xb7\xec\x01\x3f\x09\x8e\xb2\x1a\xdc\x1a\xe1\x02\xcf\x35\x4e\x70\x44\x81\x1b\x55\xb8\xe3\xb9\x32\xfd\x63\x35\xf6\x77\x4e\x11\xea\x25\xe7\x0d\x05\x55\x7d\x9c\x64\xc9\x1f\x26\xcb\x75\x65\x0f\xe4\x89\x0e\xbd\xfd\xd0\xf6\xf6\x5e\x38\x9c\x87\x9f\x00\x00\x00\xff\xff\x0a\xac\x80\x64\x10\x01\x00\x00") + +func initLoginsUserLoginJsonBytes() ([]byte, error) { + return bindataRead( + _initLoginsUserLoginJson, + "init/logins/user.login.json", + ) +} + +func initLoginsUserLoginJson() (*asset, error) { + bytes, err := initLoginsUserLoginJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/logins/user.login.json", size: 272, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initModelsPetModJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x94\xcf\x6e\xd3\x40\x10\xc6\xef\x7e\x8a\xd5\x9c\x7b\x08\x9c\x90\xcf\x5c\xb8\x71\x47\x28\xda\x78\x27\xce\xc2\x7a\x37\xf2\x8e\x11\x51\x14\x09\x0e\x15\x6a\xb9\x70\x22\xa0\x22\x04\x48\x40\xb9\x00\x85\x52\x01\x95\xe0\x69\x1c\xa7\x6f\x81\x76\xdd\xc6\x36\x76\xa3\x26\x17\xff\xf9\xc6\x33\xfb\xf3\xb7\xb3\x33\x0d\x18\x03\xcd\x13\x84\x90\x41\x18\xde\x46\x82\x1d\x27\x11\x1f\x28\xa7\x4d\xab\xe8\x84\x9b\xbe\xc0\xc4\xf4\xc7\xee\x23\x06\x8a\x0f\x50\xb9\x40\xfe\xf9\x4d\xb1\xf7\x69\xf9\xf6\x10\xd8\xcc\x27\x47\x46\x65\x89\xb6\x10\xb2\x3b\x01\x63\xac\x5e\x44\x8a\x46\xea\xad\x9b\xee\x95\x26\x63\x3c\x7f\x2b\x2b\x30\x36\xf5\xd7\x1a\x9b\xbf\xef\x5c\xa8\xab\x02\x8b\x17\x3f\x8a\x8f\x5f\xab\xc0\x45\x29\x4b\xa9\xd4\x71\x2d\x01\x75\x4c\x23\x08\xd9\x8d\xde\x4a\x93\x5a\xe0\x43\x08\x19\xa5\x19\xae\x44\x9d\x29\x75\xfe\xef\x4e\xf7\xf2\x65\x4c\x7e\xb1\x36\x53\x71\x74\x9a\xbf\x7e\xda\x66\x42\x9d\x25\x95\x6a\xc6\x24\x8d\x76\x1e\x41\xc4\xbd\xa1\xc2\xc4\xee\x66\x68\x84\xa9\x85\xbb\x9d\x9c\x6b\x79\x2c\x71\xca\x6c\x07\x51\xbe\xfb\xfe\xec\xe5\xbb\x62\xff\x64\xf1\xe8\xf1\x26\x5c\x23\x8c\xee\xa3\xdf\xb1\x28\x2b\xfd\xf4\x4f\x28\xb6\xa1\x4b\x8c\xe8\x74\x6b\x53\x2a\xd4\x6e\x7f\x3c\x95\x90\xb6\x7c\xde\x02\xc7\x68\x25\x75\x77\x4b\x7d\xc9\x9f\x7d\xc8\x5f\x1d\x16\xbf\xff\xb6\xb1\x06\xc6\x28\xe4\xba\x0a\x08\x1c\xf2\x4c\x11\x84\x6c\xc8\x95\xc5\xcd\x41\x4a\x6b\xfb\x97\x6e\xde\xe2\xdb\x69\xf1\x7c\x7e\x35\x9b\x2a\x18\xe8\x75\x9a\xd7\x73\xb6\x5d\x73\x97\xeb\x57\x31\xad\xd1\x5b\x93\xe6\xa9\xf7\x3d\xb5\x98\x9f\x9c\xcd\x8f\xeb\x87\x58\x6a\xc2\x18\x53\xe8\xa8\x11\x19\xdb\x9c\x1c\xcb\xfd\xa3\xe5\xf1\xaf\xb5\xd9\xff\xbb\x25\x13\x1e\xa3\x6d\xfb\x70\xcf\x1a\xdd\xd5\x5d\x07\x3f\xf3\xdd\xef\xf9\xc1\x9f\x62\xef\x09\xac\x3f\xe4\x01\x63\xde\x11\x48\x51\x71\x67\x98\x1b\x60\xd3\x72\xa2\x3d\xe0\x2a\x43\x3f\xd0\xca\x4f\xbc\x61\x75\x61\x65\x71\x09\x0c\x24\x13\xb4\xc4\x93\xb1\x6d\x0c\x18\xb0\x66\x48\x7d\x81\x0a\x09\x6d\xb5\xfa\x2c\x98\x05\xff\x02\x00\x00\xff\xff\xf5\x4a\x23\xb3\x8a\x05\x00\x00") + +func initModelsPetModJsonBytes() ([]byte, error) { + return bindataRead( + _initModelsPetModJson, + "init/models/pet.mod.json", + ) +} + +func initModelsPetModJson() (*asset, error) { + bytes, err := initModelsPetModJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/models/pet.mod.json", size: 1418, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initPublicIndexHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x54\x41\x6f\xdb\x3c\x0c\xbd\xf7\x57\xf0\x73\xaf\x76\x9d\x7c\xed\xb6\xd6\x75\x02\x74\x43\x87\x15\xd8\x3a\x60\xc1\x0e\x3d\x0d\x8c\x4d\xdb\x6a\x64\xd1\xb0\x98\xa4\xde\xb0\xff\x3e\xa8\x71\x62\x35\x2e\x86\x21\x40\x2c\xea\x91\x7c\xd4\xa3\xa8\xb4\x92\x5a\x83\x46\x53\xce\x02\x32\xc1\xfc\x04\x20\xad\x08\x73\xb7\x00\x48\x45\x89\xa6\xf9\x03\x32\xdc\x34\x0d\xdc\x9a\x52\x19\x4a\xe3\xdd\xee\xce\xa3\x26\x41\xc8\x2a\x6c\x2d\xc9\x2c\x58\x4b\x11\x5d\x06\x10\xf7\xa0\x95\x6e\xef\x08\xb0\xe4\xbc\x83\x5f\xbd\x01\x50\xb0\x91\xa8\xc0\x5a\xe9\x2e\x81\xaf\x6b\x29\x94\x84\x10\x61\xd3\x68\x8a\x6c\x67\x85\xea\x10\xde\x6b\x65\x56\x5f\x30\x5b\x3c\xdb\x1f\xd9\x48\x08\x0b\x2a\x99\xe0\xfb\x5d\x08\xdf\x78\xc9\xc2\xe1\x21\x23\xc0\x27\xd2\x1b\x12\x95\x21\xdc\xd3\x9a\x42\xb8\x69\x15\xea\x10\xee\x59\x18\x16\x68\x6c\x08\x16\x8d\x8d\x2c\xb5\xaa\x08\xdd\x91\x34\xc1\x07\xd6\xdc\xc2\x6d\xcd\x8f\xca\x4f\xb5\xa7\xe9\x91\xc1\x5e\x74\xf5\x92\xf7\x49\xbd\xe0\xeb\x43\x70\xe6\x36\x13\x38\x9d\x4e\xa7\xc3\xe6\x12\xb3\x55\xd9\xf2\xda\xe4\x09\x9c\x16\x13\xf7\xbb\x7e\xa9\x85\x55\x3f\x29\x81\xe9\x65\xf3\x34\x00\x42\x4f\x12\xa1\x56\xa5\x49\x20\x23\x23\xd4\x0e\x18\x6f\xa8\x2d\x34\x6f\x13\xa8\x54\x9e\x93\x19\x90\x06\xf3\x5c\x99\x32\x12\x6e\x12\x98\x4e\x26\x43\xc6\xdf\xfd\xf7\xac\xc1\x92\xbc\x66\xe4\xca\x36\x1a\xbb\x04\x0a\x4d\x1e\xfd\xe3\xda\x8a\x2a\xba\x28\x63\x23\x64\x24\x01\xdb\x60\x46\xd1\x92\x64\x4b\x3e\xa1\x8b\x8a\x72\xd5\x52\x26\x8a\x5d\xa9\xac\xd7\xb5\x87\x57\xa4\xca\x4a\x12\x38\x9f\x6c\xaa\x51\x29\xee\xba\x51\x7b\x7c\x33\x76\x6a\xfc\x7f\xe1\xab\xf1\x0c\x6c\xfb\x5c\x17\x13\x4f\xc0\x1a\xdb\x52\x99\x68\xc9\x22\x5c\x27\x30\x39\x7b\x43\xf5\x88\xa8\x3f\x05\xe4\x6a\xe3\xb1\xfd\x2d\xf4\x65\x67\xde\x8e\x75\x44\x2f\xd1\xbe\xed\x57\x57\x57\x47\x0d\xcc\x29\xe3\x16\x77\xd2\x18\x36\xf4\xef\xe9\x93\xca\x75\xf9\x15\x92\xf3\xf3\x77\xd3\x22\x1b\xfc\x8f\xcf\xf8\x5a\x61\xc7\x31\xee\x3f\x8d\x0f\x33\x9a\xc6\xfb\xc1\x4f\xdd\xa8\xf6\x23\xec\xc4\xca\x34\x5a\x3b\x0b\x76\x8d\x0a\x46\xcf\x41\xae\x36\x63\x67\x77\xc1\x82\xfd\xe8\xfb\x40\x5f\xe1\x01\xdb\xa1\xf3\x3b\x81\x2d\xb7\x2b\xfb\x1f\xa4\x08\x55\x4b\xc5\x2c\x88\x31\xaf\x95\x89\x03\x10\x6c\x4b\xf7\xba\xfc\x58\x6a\x34\xab\x60\xfe\x99\x4b\x65\xd2\x18\xe7\x1e\xb7\xab\xdf\x37\x3c\xc6\x82\x59\x5c\xdd\x03\xe1\x9e\xa1\x12\x69\x6c\x12\xc7\x1d\x32\x36\x8d\x3d\xcb\xb8\x1e\xb3\x3d\x20\xdf\xf4\xa0\xe3\x1c\xb3\x1d\x96\x69\xbc\x13\x2e\x8d\xdd\xab\x3a\x3f\xf9\x13\x00\x00\xff\xff\x76\x4b\x41\x9d\x5d\x05\x00\x00") + +func initPublicIndexHtmlBytes() ([]byte, error) { + return bindataRead( + _initPublicIndexHtml, + "init/public/index.html", + ) +} + +func initPublicIndexHtml() (*asset, error) { + bytes, err := initPublicIndexHtmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/public/index.html", size: 1373, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initScriptsDemoJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x8d\x31\x4f\xc3\x30\x10\x85\x77\xff\x8a\x27\x4f\xad\x65\xb5\x69\x05\x11\x15\x1b\x74\x61\xeb\x8e\x3a\xb8\xce\x41\xab\x12\x5f\x65\x5f\x86\x08\xf1\xdf\xd1\x99\x54\x62\xc9\xe2\xf7\xe9\xe9\x7d\xbe\xb5\x73\x06\x0e\x7b\xea\x19\xfb\x20\xc1\xc0\xad\xcd\xc7\x90\xa2\x5c\x38\xd5\x66\xb1\xc4\xb7\x01\x32\xc9\x90\x13\x0e\x99\x23\x95\xb2\x30\x00\x60\xc7\xc0\x2b\x09\xa7\x2f\x5a\xbd\xa5\x42\x59\xac\xff\xeb\x6f\x74\xc7\x77\x9b\x42\x4f\xd6\xc3\xca\x78\xab\x59\x24\xc8\x50\x94\x7a\xee\xee\xcd\xa8\x19\xb9\x88\x3d\x4e\x5e\x7d\xd5\x7f\x65\xbe\x5e\xea\x2e\x06\xa9\x71\xa6\x78\xa5\x4e\x91\x92\x1e\x57\xdc\x36\x8d\xc7\xa6\x79\x9c\x74\x15\x5f\xc2\xa9\x7e\xdb\xf1\xe7\xac\xb6\x79\x6a\x3d\xb6\x0f\xff\xac\x03\xb3\x4e\x58\xce\x94\xcb\xbc\xb7\xdb\x79\xb4\xed\xe4\x1d\x0d\xb0\x7c\x36\x3f\xe6\x37\x00\x00\xff\xff\x4c\x3d\x94\xef\x4e\x01\x00\x00") + +func initScriptsDemoJsBytes() ([]byte, error) { + return bindataRead( + _initScriptsDemoJs, + "init/scripts/demo.js", + ) +} + +func initScriptsDemoJs() (*asset, error) { + bytes, err := initScriptsDemoJsBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/scripts/demo.js", size: 334, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initScriptsStatJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x95\x4f\x6b\xdb\x4c\x10\xc6\xcf\xd1\xa7\x18\x04\x2f\x24\x46\x71\xa4\x95\x2c\x4b\xca\xe5\xfd\x13\x78\x49\x0f\xed\xa1\xc7\x10\x82\xaa\xac\x13\x53\x5b\xeb\xae\x56\x01\x63\x7c\x6a\x0b\x05\xe7\x94\x43\x5c\x48\xa1\xa7\x5e\x12\x4a\x20\x87\x36\x90\x43\xbf\x4c\x6c\xb7\xdf\xa2\xac\x56\x6b\xaf\xa5\x18\xb9\x17\x23\xcf\xfe\x66\xe6\x79\x56\xab\x1d\x6d\xa7\x56\xd3\xa0\x06\xaf\x70\x8b\x50\x1c\x1c\x87\x2c\x84\x53\x42\x5e\xf3\xd8\xdf\xbd\x90\x86\x5d\x18\xd4\x86\x90\x3d\x25\x59\x90\x62\x96\xd2\x98\x3f\xef\x68\xad\x34\x8e\x58\x9b\xc4\xf0\x6f\x96\xbe\x17\xb2\x70\x53\xa0\x5b\x30\xd0\xa0\x43\x4e\xea\xfb\x71\x8b\x6c\xea\x07\xd1\x69\x48\xd9\x61\xde\x06\xe6\x6d\x02\xf8\x2b\xd1\x0d\x78\xf6\xf2\xc5\xf3\x7a\xc2\x68\x3b\x3e\x69\xb7\xfa\xb2\xc4\xd6\xae\x06\xa2\x1b\x1c\x88\xd0\xe1\xae\x36\xd4\x00\x40\xaa\x0e\x5b\x0c\xd3\x95\xa2\x79\x7c\xb5\xe4\x7f\x78\x6e\xa6\x98\x73\x2b\xf4\x66\x0d\xaa\xe4\x66\xf9\x8a\x58\xfe\xbf\x20\xf4\x7f\xcc\x60\x4f\xca\x79\x62\x5b\x15\x5d\xd5\x9b\xd8\xa3\x24\xc2\x49\x22\x64\xbd\x49\x31\xed\xaf\xbb\x8d\x03\xae\xa9\x1d\x47\xa4\x8b\x03\x38\xd0\x36\x60\x00\x67\x61\x27\xc5\x01\x38\xa6\x6d\x9a\x06\x2f\x89\x03\xd0\x91\x89\xd0\xb6\xb5\x6d\xe9\x30\x34\x54\xaa\x61\x7a\x45\x0a\x95\x29\xdb\x2a\xd5\xb2\xcb\x94\xe3\x95\x6a\x39\x65\xca\xf5\xfd\x22\xd5\x78\xa2\x63\xb3\x54\xcb\xcd\x29\x00\x38\xcc\x7e\x23\x92\xb0\x82\x69\xe4\x59\x6b\x98\x46\xb6\xb9\x86\x69\xe4\xaf\x63\x1a\xb9\xcd\x35\x4c\x23\xd7\x59\xc7\xb4\x85\x2a\x4d\xd3\x6c\x71\xc9\xb4\x57\xaf\xb6\xdc\xac\xbb\x95\x86\xfd\xba\x55\x69\xd7\xab\x3b\xd5\x6f\xb8\xee\x57\x5a\xf5\x8b\x9a\x4b\x46\x7b\x98\x1d\x45\x24\x8d\x59\x00\x0d\x67\x1e\x61\xfd\x1e\x57\x61\x2c\x8e\xfd\x51\x97\xc4\xec\xb4\xd3\x0f\xc0\xf5\xf8\xc9\xe2\x2b\xc7\x24\x62\x84\xca\x74\x64\x8b\x74\x8a\xcf\x8e\x94\xaa\x03\x88\x52\x4a\x71\xde\x20\x5b\x0e\xc0\x69\xe4\x22\xe6\xb4\xe8\xa8\xc0\x9e\x64\x2d\x5b\x65\x8b\x6a\x94\x0c\x21\x2c\xcf\xf2\x91\x69\x9a\x6a\xe2\xb2\x58\x25\x0d\xd9\x32\x07\x35\xf3\x04\x7e\x41\x24\x24\xa5\x11\xce\x75\x89\x83\x20\x9e\xf5\xd9\xf9\xcd\xec\xfc\x46\x37\x20\xaf\x65\x79\x72\xd7\x25\x30\x1a\xcf\x46\xe3\x05\xe0\x16\xd6\x27\xef\xbf\x3d\x3e\x5c\x2e\xd6\xed\xa5\x37\xa2\x34\x4f\x58\xc8\xd2\x44\xb6\x97\xff\xf4\xc9\xf7\xbb\xe9\xe7\x2f\xb3\x4f\xa3\x42\x89\x25\x68\x7a\xf7\x30\xbb\x1c\x3f\xde\x7f\x55\x84\xa2\x12\xc5\x4b\xdd\x3d\x4c\xdf\x7d\x58\x50\xfe\x2a\x35\xea\x45\x10\x87\xfc\x26\xd4\xa7\xb7\x57\xd3\xdb\x2b\xdd\xe0\x05\xfb\x01\xd8\x46\x7e\x5b\xc8\xcd\x57\xd0\x5f\x1f\x7f\x4c\xee\xdf\xce\x51\x57\xa2\x0e\x2a\xa1\x93\x8b\xeb\xc9\xc5\xf5\x1c\x6d\x4a\xd4\x2d\x57\x9d\x8d\xc6\x3f\xaf\x46\x73\xd4\x92\xa8\xb5\x78\xfb\xdc\xc7\x90\x8f\x15\x39\x53\xfe\x23\xdd\x5e\xca\x30\x90\x94\x15\xc6\x4a\xab\x8d\x3b\xc7\x85\x58\xf6\x25\xfd\xd1\x80\xdc\xcf\x8e\xe8\x66\x56\xcc\x10\xf9\xd9\x47\x58\x98\x95\x5c\xdb\x7c\x34\x89\x1c\x29\x4d\x8c\x25\x0e\x14\x26\xd3\x40\x48\x0c\x40\x2d\x1e\xa8\x3d\x02\x31\xdd\x86\x5b\x1a\x28\xf3\x2b\x03\x76\xb5\x21\x9f\xac\x1b\xbf\x03\x00\x00\xff\xff\x69\x42\x8b\x51\xbb\x08\x00\x00") + +func initScriptsStatJsBytes() ([]byte, error) { + return bindataRead( + _initScriptsStatJs, + "init/scripts/stat.js", + ) +} + +func initScriptsStatJs() (*asset, error) { + bytes, err := initScriptsStatJsBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/scripts/stat.js", size: 2235, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _initTablesPetTabJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x34\xcb\x31\x0a\x02\x31\x10\x85\xe1\x3e\xa7\xf8\x79\xf5\x9e\x60\x3a\xed\x05\xaf\xb0\x9a\x08\x01\x33\xb3\x48\x3a\x99\xbb\x4b\x84\x2d\x1f\xef\xfb\xbf\x05\xe4\xfb\x68\x32\x64\x76\x6f\x93\x4b\x1d\xdd\xb9\x76\xaf\xdc\xa2\xb6\xb7\xb6\x65\xf6\xe7\xec\xe1\x32\x56\x01\x7a\x74\xaf\x6b\xa1\xf1\x47\x86\x8e\x36\xb5\xa1\x38\x4e\x89\x5e\xf1\x19\xe7\x45\x92\x05\xb2\x64\xf9\x05\x00\x00\xff\xff\xbb\xda\xa8\x3e\x76\x00\x00\x00") + +func initTablesPetTabJsonBytes() ([]byte, error) { + return bindataRead( + _initTablesPetTabJson, + "init/tables/pet.tab.json", + ) +} + +func initTablesPetTabJson() (*asset, error) { + bytes, err := initTablesPetTabJsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "init/tables/pet.tab.json", size: 118, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _publicIndexHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x52\x56\x56\x08\xf5\x54\x08\xf2\xf7\x0f\xe1\x02\x04\x00\x00\xff\xff\x07\xc5\xfb\x5d\x0b\x00\x00\x00") + +func publicIndexHtmlBytes() ([]byte, error) { + return bindataRead( + _publicIndexHtml, + "public/index.html", + ) +} + +func publicIndexHtml() (*asset, error) { + bytes, err := publicIndexHtmlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _uiIndexHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x52\x56\x56\x08\xf5\x54\x08\xf2\xf7\x0f\xe1\x02\x04\x00\x00\xff\xff\x07\xc5\xfb\x5d\x0b\x00\x00\x00") func uiIndexHtmlBytes() ([]byte, error) { @@ -217,7 +511,7 @@ func uiIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -237,7 +531,7 @@ func xgenSetupIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/setup/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "xgen/setup/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -257,7 +551,7 @@ func xgenV09IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v0.9/index.html", size: 14, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "xgen/v0.9/index.html", size: 14, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -277,7 +571,7 @@ func xgenV10IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/index.html", size: 50, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "xgen/v1.0/index.html", size: 50, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -297,7 +591,7 @@ func xgenV10Layouts__indexAsyncJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "xgen/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -317,7 +611,7 @@ func xgenV10UmiJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "xgen/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -337,7 +631,7 @@ func yaoApisReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -357,7 +651,7 @@ func yaoApisChartHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -377,7 +671,7 @@ func yaoApisImportHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/import.http.json", size: 1676, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/import.http.json", size: 1676, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -397,7 +691,7 @@ func yaoApisPageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -417,7 +711,7 @@ func yaoApisStorageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/storage.http.json", size: 1026, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/storage.http.json", size: 1026, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -437,7 +731,7 @@ func yaoApisTableHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/table.http.json", size: 3213, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/table.http.json", size: 3213, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -457,7 +751,7 @@ func yaoApisUserHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -477,7 +771,7 @@ func yaoApisXiangHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -497,7 +791,7 @@ func yaoDataAppJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/app.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/data/app.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -517,7 +811,7 @@ func yaoDataIcons404Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -537,7 +831,7 @@ func yaoDataIconsIconIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -557,7 +851,7 @@ func yaoDataIconsIconIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -577,7 +871,7 @@ func yaoDataIconsIconPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -597,7 +891,7 @@ func yaoDataIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -617,7 +911,7 @@ func yaoFieldsModelTransJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14959, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14959, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -637,7 +931,7 @@ func yaoFlowsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -657,7 +951,7 @@ func yaoFlowsAdminGuardFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/admin/guard.flow.json", size: 559, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/flows/admin/guard.flow.json", size: 559, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -677,7 +971,7 @@ func yaoFlowsMenuFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -697,7 +991,7 @@ func yaoFlowsUserFindFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/user/find.flow.json", size: 328, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/flows/user/find.flow.json", size: 328, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -717,7 +1011,7 @@ func yaoLangsEnUsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -737,7 +1031,7 @@ func yaoLangsZhCnGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -757,7 +1051,7 @@ func yaoLangsZhCnLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -777,7 +1071,7 @@ func yaoLangsZhCnLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -797,7 +1091,7 @@ func yaoLangsZhHkGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -817,7 +1111,7 @@ func yaoLangsZhHkLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -837,7 +1131,7 @@ func yaoLangsZhHkLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -857,7 +1151,7 @@ func yaoModelsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -877,7 +1171,7 @@ func yaoModelsMenuModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/menu.mod.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/models/menu.mod.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -897,7 +1191,7 @@ func yaoModelsUserModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/user.mod.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/models/user.mod.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -917,7 +1211,7 @@ func yaoModelsWorkflowModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/workflow.mod.json", size: 3333, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/models/workflow.mod.json", size: 3333, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -937,7 +1231,7 @@ func yaoTablesReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -957,7 +1251,7 @@ func yaoTablesMenuTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/menu.tab.json", size: 10471, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/tables/menu.tab.json", size: 10471, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -977,7 +1271,7 @@ func yaoTablesUserTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/user.tab.json", size: 2357, mode: os.FileMode(420), modTime: time.Unix(1668091290, 0)} + info := bindataFileInfo{name: "yao/tables/user.tab.json", size: 2357, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1034,6 +1328,20 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ + "init/app.json": initAppJson, + "init/charts/dashboard.chart.json": initChartsDashboardChartJson, + "init/flows/app/menu.flow.json": initFlowsAppMenuFlowJson, + "init/forms/pet.form.json": initFormsPetFormJson, + "init/langs/zh-cn/global.yml": initLangsZhCnGlobalYml, + "init/langs/zh-hk/langs/global.yml": initLangsZhHkLangsGlobalYml, + "init/logins/admin.login.json": initLoginsAdminLoginJson, + "init/logins/user.login.json": initLoginsUserLoginJson, + "init/models/pet.mod.json": initModelsPetModJson, + "init/public/index.html": initPublicIndexHtml, + "init/scripts/demo.js": initScriptsDemoJs, + "init/scripts/stat.js": initScriptsStatJs, + "init/tables/pet.tab.json": initTablesPetTabJson, + "public/index.html": publicIndexHtml, "ui/index.html": uiIndexHtml, "xgen/setup/index.html": xgenSetupIndexHtml, "xgen/v0.9/index.html": xgenV09IndexHtml, @@ -1118,6 +1426,50 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ + "init": {nil, map[string]*bintree{ + "app.json": {initAppJson, map[string]*bintree{}}, + "charts": {nil, map[string]*bintree{ + "dashboard.chart.json": {initChartsDashboardChartJson, map[string]*bintree{}}, + }}, + "flows": {nil, map[string]*bintree{ + "app": {nil, map[string]*bintree{ + "menu.flow.json": {initFlowsAppMenuFlowJson, map[string]*bintree{}}, + }}, + }}, + "forms": {nil, map[string]*bintree{ + "pet.form.json": {initFormsPetFormJson, map[string]*bintree{}}, + }}, + "langs": {nil, map[string]*bintree{ + "zh-cn": {nil, map[string]*bintree{ + "global.yml": {initLangsZhCnGlobalYml, map[string]*bintree{}}, + }}, + "zh-hk": {nil, map[string]*bintree{ + "langs": {nil, map[string]*bintree{ + "global.yml": {initLangsZhHkLangsGlobalYml, map[string]*bintree{}}, + }}, + }}, + }}, + "logins": {nil, map[string]*bintree{ + "admin.login.json": {initLoginsAdminLoginJson, map[string]*bintree{}}, + "user.login.json": {initLoginsUserLoginJson, map[string]*bintree{}}, + }}, + "models": {nil, map[string]*bintree{ + "pet.mod.json": {initModelsPetModJson, map[string]*bintree{}}, + }}, + "public": {nil, map[string]*bintree{ + "index.html": {initPublicIndexHtml, map[string]*bintree{}}, + }}, + "scripts": {nil, map[string]*bintree{ + "demo.js": {initScriptsDemoJs, map[string]*bintree{}}, + "stat.js": {initScriptsStatJs, map[string]*bintree{}}, + }}, + "tables": {nil, map[string]*bintree{ + "pet.tab.json": {initTablesPetTabJson, map[string]*bintree{}}, + }}, + }}, + "public": {nil, map[string]*bintree{ + "index.html": {publicIndexHtml, map[string]*bintree{}}, + }}, "ui": {nil, map[string]*bintree{ "index.html": {uiIndexHtml, map[string]*bintree{}}, }}, From 50cedfb9f7162db3fb5ffd4c764c97e50dd4b405 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Nov 2022 12:13:50 +0800 Subject: [PATCH 4/6] [change] release workflow --- .github/workflows/release-linux.yml | 7 +++++++ .github/workflows/release-macos.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index 4fb1380c..2af70ca4 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -79,6 +79,12 @@ jobs: #ref: 5002c3fded585aaa69a4366135b415ea3234964e path: xgen-v1.0 + - name: Checkout Yao-Init + uses: actions/checkout@v2 + with: + repository: yaoapp/yao-init + path: yao-init + - name: Move Kun, Xun, Gou, UI, V8Go run: | mv kun ../ @@ -87,6 +93,7 @@ jobs: mv v8go ../ mv xgen-v0.9 ../ mv xgen-v1.0 ../ + mv yao-init ../ ls -l . ls -l ../ diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index 212a9be7..fa678da8 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -74,6 +74,12 @@ jobs: # ref: 5002c3fded585aaa69a4366135b415ea3234964e path: xgen-v1.0 + - name: Checkout Yao-Init + uses: actions/checkout@v2 + with: + repository: yaoapp/yao-init + path: yao-init + - name: Move Kun, Xun, Gou, UI, V8Go run: | mv kun ../ @@ -82,6 +88,7 @@ jobs: mv v8go ../ mv xgen-v0.9 ../ mv xgen-v1.0 ../ + mv yao-init ../ ls -l . ls -l ../ From 5878b238c74333f1d076fb4d8a09028c7bcef654 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Nov 2022 12:35:03 +0800 Subject: [PATCH 5/6] [change] init application --- data/bindata.go | 106 ++--- setup/install.go | 910 +----------------------------------------- setup/install_test.go | 17 + 3 files changed, 88 insertions(+), 945 deletions(-) diff --git a/data/bindata.go b/data/bindata.go index 4ba244d2..b9c0a5ed 100644 --- a/data/bindata.go +++ b/data/bindata.go @@ -231,7 +231,7 @@ func initAppJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/app.json", size: 325, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/app.json", size: 325, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -251,7 +251,7 @@ func initChartsDashboardChartJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/charts/dashboard.chart.json", size: 8471, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/charts/dashboard.chart.json", size: 8471, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -271,7 +271,7 @@ func initFlowsAppMenuFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/flows/app/menu.flow.json", size: 1327, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/flows/app/menu.flow.json", size: 1327, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -291,7 +291,7 @@ func initFormsPetFormJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/forms/pet.form.json", size: 87, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/forms/pet.form.json", size: 87, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -311,7 +311,7 @@ func initLangsZhCnGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/langs/zh-cn/global.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/langs/zh-cn/global.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -331,7 +331,7 @@ func initLangsZhHkLangsGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/langs/zh-hk/langs/global.yml", size: 88, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/langs/zh-hk/langs/global.yml", size: 88, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -351,7 +351,7 @@ func initLoginsAdminLoginJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logins/admin.login.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/logins/admin.login.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -371,7 +371,7 @@ func initLoginsUserLoginJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logins/user.login.json", size: 272, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/logins/user.login.json", size: 272, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -391,7 +391,7 @@ func initModelsPetModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/models/pet.mod.json", size: 1418, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/models/pet.mod.json", size: 1418, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -411,7 +411,7 @@ func initPublicIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/index.html", size: 1373, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/public/index.html", size: 1373, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -431,7 +431,7 @@ func initScriptsDemoJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/demo.js", size: 334, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/scripts/demo.js", size: 334, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -451,7 +451,7 @@ func initScriptsStatJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/stat.js", size: 2235, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/scripts/stat.js", size: 2235, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -471,7 +471,7 @@ func initTablesPetTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/tables/pet.tab.json", size: 118, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "init/tables/pet.tab.json", size: 118, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -491,7 +491,7 @@ func publicIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -511,7 +511,7 @@ func uiIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -531,7 +531,7 @@ func xgenSetupIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/setup/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "xgen/setup/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -551,7 +551,7 @@ func xgenV09IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v0.9/index.html", size: 14, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "xgen/v0.9/index.html", size: 14, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -571,7 +571,7 @@ func xgenV10IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/index.html", size: 50, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "xgen/v1.0/index.html", size: 50, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -591,7 +591,7 @@ func xgenV10Layouts__indexAsyncJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "xgen/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -611,7 +611,7 @@ func xgenV10UmiJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "xgen/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -631,7 +631,7 @@ func yaoApisReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -651,7 +651,7 @@ func yaoApisChartHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -671,7 +671,7 @@ func yaoApisImportHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/import.http.json", size: 1676, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/import.http.json", size: 1676, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -691,7 +691,7 @@ func yaoApisPageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -711,7 +711,7 @@ func yaoApisStorageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/storage.http.json", size: 1026, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/storage.http.json", size: 1026, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -731,7 +731,7 @@ func yaoApisTableHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/table.http.json", size: 3213, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/table.http.json", size: 3213, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -751,7 +751,7 @@ func yaoApisUserHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -771,7 +771,7 @@ func yaoApisXiangHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -791,7 +791,7 @@ func yaoDataAppJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/app.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/data/app.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -811,7 +811,7 @@ func yaoDataIcons404Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -831,7 +831,7 @@ func yaoDataIconsIconIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -851,7 +851,7 @@ func yaoDataIconsIconIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -871,7 +871,7 @@ func yaoDataIconsIconPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -891,7 +891,7 @@ func yaoDataIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -911,7 +911,7 @@ func yaoFieldsModelTransJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14959, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14959, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -931,7 +931,7 @@ func yaoFlowsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -951,7 +951,7 @@ func yaoFlowsAdminGuardFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/admin/guard.flow.json", size: 559, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/flows/admin/guard.flow.json", size: 559, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -971,7 +971,7 @@ func yaoFlowsMenuFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -991,7 +991,7 @@ func yaoFlowsUserFindFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/user/find.flow.json", size: 328, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/flows/user/find.flow.json", size: 328, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1011,7 +1011,7 @@ func yaoLangsEnUsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1031,7 +1031,7 @@ func yaoLangsZhCnGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1051,7 +1051,7 @@ func yaoLangsZhCnLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1071,7 +1071,7 @@ func yaoLangsZhCnLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1091,7 +1091,7 @@ func yaoLangsZhHkGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1111,7 +1111,7 @@ func yaoLangsZhHkLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1131,7 +1131,7 @@ func yaoLangsZhHkLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1151,7 +1151,7 @@ func yaoModelsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1171,7 +1171,7 @@ func yaoModelsMenuModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/menu.mod.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/models/menu.mod.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1191,7 +1191,7 @@ func yaoModelsUserModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/user.mod.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/models/user.mod.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1211,7 +1211,7 @@ func yaoModelsWorkflowModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/workflow.mod.json", size: 3333, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/models/workflow.mod.json", size: 3333, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1231,7 +1231,7 @@ func yaoTablesReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1251,7 +1251,7 @@ func yaoTablesMenuTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/menu.tab.json", size: 10471, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/tables/menu.tab.json", size: 10471, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1271,7 +1271,7 @@ func yaoTablesUserTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/user.tab.json", size: 2357, mode: os.FileMode(420), modTime: time.Unix(1668656844, 0)} + info := bindataFileInfo{name: "yao/tables/user.tab.json", size: 2357, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/setup/install.go b/setup/install.go index b5c13fc3..ab6780b4 100644 --- a/setup/install.go +++ b/setup/install.go @@ -7,12 +7,9 @@ import ( "strings" "github.com/yaoapp/gou" - "github.com/yaoapp/gou/fs" - "github.com/yaoapp/gou/fs/dsl" - "github.com/yaoapp/gou/fs/system" "github.com/yaoapp/kun/log" + "github.com/yaoapp/yao/data" "github.com/yaoapp/yao/engine" - "github.com/yaoapp/yao/share" "github.com/yaoapp/yao/widgets/app" ) @@ -95,7 +92,7 @@ func Install(payload map[string]map[string]string) error { return err } - err = makeDemoWidgets(root) + err = makeInit(root) if err != nil { return err } @@ -231,897 +228,26 @@ func makeDirs(root string) error { return nil } -func makeDemoWidgets(root string) error { - - dsl := dsl.New(root) - - // make app - ok, err := makeAppWidget(dsl, root) - if err != nil || !ok { - return err - } - - // make flows - err = makeMenuFlowWidget(dsl, root) - if err != nil { - return err - } - - // make logins - err = makeLoginWidget(dsl, root) - if err != nil { - return err - } - - // make models - err = makeModelWidget(dsl, root) - if err != nil { - return err - } - - // make tables & forms - err = makeTableFormWidget(dsl, root) - if err != nil { - return err - } - - // make chart - err = makeChartWidget(dsl, root) - if err != nil { - return err - } - - // make scripts - err = makeScript(root) - if err != nil { - return err - } - - // make scripts - err = makeLang(root) - if err != nil { - return err - } - - // make index page - err = makeIndexPage(root) - if err != nil { - return err - } - - return nil -} - -func makeAppWidget(dsl fs.FileSystem, root string) (bool, error) { - - file := filepath.Join("app.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return false, nil - } - - _, err := dsl.WriteFile(file, []byte(fmt.Sprintf(` - { - "xgen": "1.0", - "name": "::Demo Application", - "short": "::Demo", - "description": "::Another yao application", - "version": "%s", - "adminRoot": "admin", - "setup": "scripts.demo.Data", - "menu": { - "process": "flows.app.menu", - "args": ["demo"] - }, - "optional": { - "hideNotification": true, - "hideSetting": false - } - } - `, share.VERSION)), 0644) - - if err != nil { - return false, err - } - - return true, nil -} - -func makeMenuFlowWidget(dsl fs.FileSystem, root string) error { - - file := filepath.Join("flows", "app", "menu.flow.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - - _, err := dsl.WriteFile(file, []byte(` - { - "name": "APP Menu", - "nodes": [], - "output": [ - { - "blocks": 0, - "icon": "icon-activity", - "id": 1, - "name": "图表", - "parent": null, - "path": "/x/Chart/dashboard", - "visible_menu": 0 - }, - { - "blocks": 0, - "icon": "icon-book", - "id": 2, - "name": "表格", - "parent": null, - "path": "/x/Table/pet", - "visible_menu": 1, - "children": [ - { - "blocks": 0, - "icon": "icon-book", - "name": "宠物列表", - "id": 2010, - "parent": 2, - "path": "/x/Table/pet", - "visible_menu": 1 - } - ] - }, - { - "blocks": 0, - "icon": "icon-clipboard", - "id": 2, - "name": "表单", - "parent": null, - "path": "/x/Form/pet/1/edit", - "visible_menu": 1, - "children": [ - { - "blocks": 0, - "icon": "icon-clipboard", - "name": "编辑模式", - "id": 2010, - "parent": 2, - "path": "/x/Form/pet/1/edit", - "visible_menu": 1 - }, - { - "blocks": 0, - "icon": "icon-clipboard", - "name": "查看模式", - "id": 2010, - "parent": 2, - "path": "/x/Form/pet/1/view", - "visible_menu": 1 - } - ] - } - ] - } - `), 0644) - - if err != nil { - return err - } - - return nil -} - -func makeLoginWidget(dsl fs.FileSystem, root string) error { - file := filepath.Join("logins", "admin.login.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - _, err := dsl.WriteFile(file, []byte(` - { - "name": "::Admin Login", - "action": { - "process": "yao.login.Admin", - "args": [":payload"] - }, - "layout": { - "entry": "/x/Chart/dashboard", - "slogan": "::Make Your Dream With Yao App Engine", - "site": "https://yaoapps.com?from=instance-admin-login" - } - } - `), 0644) - - if err != nil { - return err - } - - file = filepath.Join("logins", "user.login.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - _, err = dsl.WriteFile(file, []byte(` - { - "name": "::User Login", - "action": { - "process": "scripts.user.Login", - "args": [":payload"] - }, - "layout": { - "entry": "/x/Table/pet", - "slogan": "::Make Your Dream With Yao App Engine", - "site": "https://yaoapps.com/from=instance-user-login" - } - } - `), 0644) - if err != nil { - return err - } - - return nil -} - -func makeModelWidget(dsl fs.FileSystem, root string) error { - file := filepath.Join("models", "pet.mod.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - _, err := dsl.WriteFile(file, []byte(` - { - "name": "Pet", - "table": { "name": "pet", "comment": "宠物表" }, - "columns": [ - { "name": "id", "comment": "ID", "type": "ID" }, - { - "name": "name", - "comment": "昵称", - "type": "string", - "length": 80, - "index": true, - "nullable": true - }, - { - "name": "type", - "comment": "类型", - "type": "enum", - "option": ["cat", "dog", "others"], - "index": true - }, - { - "name": "status", - "comment": "入院状态", - "type": "enum", - "option": ["checked", "curing", "cured"], - "index": true - }, - { - "name": "mode", - "comment": "状态", - "type": "enum", - "option": ["enabled", "disabled"], - "index": true - }, - { - "name": "online", - "comment": "是否在线", - "type": "boolean", - "default": false, - "index": true - }, - { - "name": "curing_status", - "comment": "治疗状态", - "type": "enum", - "default": "0", - "option": ["0", "1", "2"], - "index": true - }, - { - "name": "stay", - "comment": "入院时间", - "type": "integer" - }, - { - "name": "cost", - "comment": "花费", - "type": "integer" - }, - { - "name": "doctor_id", - "type": "integer", - "comment": "相关职工", - "nullable": true - }, - { - "name": "images", - "type": "json", - "comment": "相关图片", - "nullable": true - }, - { - "name": "test_string", - "comment": "测试字段(字符串)", - "type": "string", - "nullable": true - }, - { - "name": "test_number", - "comment": "测试字段(数字)", - "type": "integer", - "nullable": true - }, - { - "name": "test_array", - "comment": "测试字段(数组)", - "type": "json", - "nullable": true - } - ], - "relations": {}, - "values": [], - "indexes": [], - "option": { "timestamps": true,"soft_deletes": true } - } - `), 0644) - - if err != nil { - return err - } - - return nil -} - -func makeTableFormWidget(dsl fs.FileSystem, root string) error { - file := filepath.Join("tables", "pet.tab.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - _, err := dsl.WriteFile(file, []byte(` - { - "name": "::Pet Admin Bind Model", - "action": { - "bind": { "model": "pet", "option": {} } - } - } - `), 0644) - - if err != nil { - return err - } - - file = filepath.Join("forms", "pet.form.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - _, err = dsl.WriteFile(file, []byte(` - { - "name": "::Pet Admin Bind Table", - "action": { - "bind": { "table": "pet", "option": {} } - } - } - `), 0644) - if err != nil { - return err - } - - return nil -} - -func makeChartWidget(dsl fs.FileSystem, root string) error { - - file := filepath.Join("charts", "dashboard.chart.json") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - - _, err := dsl.WriteFile(file, []byte(` - { - "name": "宠物医院数据图表", - - "config":{"full":false}, - - "action": { - "before:data": "scripts.stat.BeforeData", - "data": { "process": "scripts.stat.Data", "default": ["2022-09-20"] }, - "after:data": "scripts.stat.AfterData" - }, - - "layout": { - "operation": { - "actions": [ - { - "title": "跳转至大屏", - "icon": "icon-airplay", - "action": { "Common.historyPush": { "pathname": "/x/Cool/demo" } } - } - ] - }, - - "filter": { - "columns": [{ "name": "时间区间", "width": 6 }] - }, - - "chart": { - "columns": [ - { "name": "宠物数量", "width": 6 }, - { "name": "宠物类型", "width": 6 }, - { "name": "当月收入", "width": 6 }, - { "name": "医师数量", "width": 6 }, - { "name": "宠物数量_上月", "width": 6 }, - { "name": "宠物类型_上月", "width": 6 }, - { "name": "当月收入_上月", "width": 6 }, - { "name": "医师数量_上月", "width": 6 }, - { "name": "收入", "width": 8 }, - { "name": "支出", "width": 8 }, - { "name": "综合评分", "width": 8 }, - { "name": "收入_折线图", "width": 8 }, - { "name": "支出_折线图", "width": 8 }, - { "name": "综合评分_折线图", "width": 8 }, - { "name": "类型排布", "width": 12 }, - { "name": "状态分布", "width": 12 }, - { "name": "综合消费", "width": 24 } - ] - } - }, - - "fields": { - "filter": { - "时间区间": { - "bind": "range", - "edit": { "type": "RangePicker", "props": {} } - }, - "状态": { - "bind": "status", - "edit": { - "type": "Select", - "props": { - "xProps": { - "$remote": { - "process": "models.pet.Get", - "query": { "select": "name,status", "limit": 2 } - } - } - } - } +func makeInit(root string) error { + files := data.AssetNames() + for _, file := range files { + if strings.HasPrefix(file, "init/") { + dst := filepath.Join(root, strings.TrimPrefix(file, "init/")) + content, err := data.Read(file) + if err != nil { + return err } - }, - "chart": { - "收入": { - "bind": "income", - "link": "/x/Table/pet", - "out": "scripts.stat.Income", - "view": { - "type": "NumberChart", - "props": { - "chartHeight": 150, - "prefix": "¥", - "decimals": 2, - "nameKey": "date", - "valueKey": "value" - } - } - }, - "支出": { - "bind": "cost", - "link": "/x/Table/pet", - "view": { - "type": "NumberChart", - "props": { - "chartHeight": 150, - "color": "red", - "prefix": "¥", - "decimals": 2, - "nameKey": "date", - "valueKey": "value" - } - } - }, - "综合评分": { - "bind": "rate", - "link": "/x/Table/pet", - "view": { - "type": "NumberChart", - "props": { - "chartHeight": 150, - "color": "orange", - "unit": "分", - "decimals": 1, - "nameKey": "date", - "valueKey": "value" - } - } - }, - "收入_折线图": { - "bind": "income", - "link": "/x/Table/pet", - "view": { - "type": "NumberChart", - "props": { - "cardStyle": { "padding": 0 }, - "type": "line", - "chartHeight": 120, - "prefix": "¥", - "decimals": 2, - "nameKey": "date", - "valueKey": "value" - } - } - }, - "支出_折线图": { - "bind": "cost", - "link": "/x/Table/pet", - "view": { - "type": "NumberChart", - "props": { - "cardStyle": { "padding": 0 }, - "type": "line", - "chartHeight": 120, - "color": "red", - "prefix": "¥", - "decimals": 2, - "nameKey": "date", - "valueKey": "value" - } - } - }, - "综合评分_折线图": { - "bind": "rate", - "link": "/x/Table/pet", - "view": { - "type": "NumberChart", - "props": { - "cardStyle": { "padding": 0 }, - "type": "line", - "chartHeight": 120, - "color": "orange", - "unit": "分", - "decimals": 1, - "nameKey": "date", - "valueKey": "value" - } - } - }, - "宠物数量": { - "bind": "pet_count", - "link": "/x/Table/pet", - "view": { "type": "Number", "props": { "unit": "个" } } - }, - "宠物类型": { - "bind": "pet_type", - "view": { "type": "Number", "props": { "unit": "种" } } - }, - "当月收入": { - "bind": "income_monthly", - "view": { "type": "Number", "props": { "unit": "元" } } - }, - "医师数量": { - "bind": "doctor_count", - "view": { "type": "Number", "props": { "unit": "个" } } - }, - "宠物数量_上月": { - "bind": "prev_pet_count", - "link": "/x/Table/pet", - "view": { - "type": "Number", - "props": { - "cardStyle": { "padding": 0 }, - "unit": "个", - "prev_title": "上月数据" - } - } - }, - "宠物类型_上月": { - "bind": "prev_pet_type", - "link": "/x/Table/pet", - "view": { - "type": "Number", - "props": { - "cardStyle": { "padding": 0 }, - "unit": "种", - "prev_title": "上月数据" - } - } - }, - "当月收入_上月": { - "bind": "prev_income_monthly", - "link": "/x/Table/pet", - "view": { - "type": "Number", - "props": { - "cardStyle": { "padding": 0 }, - "unit": "元", - "prev_title": "上月数据" - } - } - }, - "医师数量_上月": { - "bind": "prev_doctor_count", - "link": "/x/Table/pet", - "view": { - "type": "Number", - "props": { - "cardStyle": { "padding": 0 }, - "unit": "个", - "prev_title": "上月数据" - } - } - }, - "类型排布": { - "bind": "datasource_type", - "link": "/x/Table/pet", - "view": { - "type": "Pie", - "props": { - "height": 240, - "nameKey": "type", - "series": [ - { - "valueKey": "count", - "roseType": "area", - "radius": [10, 100], - "center": ["60%", "50%"], - "itemStyle": { "borderRadius": 6 } - } - ] - } - }, - "refer": { - "type": "Table", - "props": { - "columns": [ - { "title": "类型", "dataIndex": "type" }, - { "title": "数量", "dataIndex": "count" } - ] - } - } - }, - "状态分布": { - "bind": "datasource_status", - "view": { - "type": "Bar", - "props": { - "height": 240, - "nameKey": "status", - "axisLabel": { "interval": 0, "fontSize": 12 }, - "series": [ - { - "valueKey": "count", - "type": "bar", - "colorBy": "data", - "itemStyle": { "borderRadius": 6 }, - "splitLine": { "show": false }, - "axisLabel": { "show": false } - } - ] - } - }, - "refer": { - "type": "Table", - "props": { - "columns": [ - { "title": "状态", "dataIndex": "status" }, - { "title": "数量", "dataIndex": "count" } - ] - } - } - }, - "综合消费": { - "bind": "datasource_cost", - "view": { - "type": "LineBar", - "props": { - "height": 240, - "nameKey": "name", - "axisLabel": { "interval": 0, "fontSize": 12 }, - "series": [ - { - "valueKey": "stay", - "type": "line", - "smooth": true, - "symbolSize": 8, - "itemStyle": { "borderRadius": 6 }, - "splitLine": { "show": false }, - "axisLabel": { "show": false } - }, - { - "valueKey": "cost", - "type": "bar", - "itemStyle": { "borderRadius": 6 }, - "splitLine": { "show": false }, - "axisLabel": { "show": false } - } - ] - } - } + + dir := filepath.Dir(dst) + if err := os.MkdirAll(dir, os.ModePerm); err != nil { + return err + } + + if err = os.WriteFile(dst, content, 0644); err != nil { + return err } - } } - } - `), 0644) - - if err != nil { - return err } - - return nil -} - -func makeScript(root string) error { - - fs := system.New(filepath.Join(root, "scripts")) - file := "demo.js" - if _, err := os.Stat(filepath.Join(root, "scripts", file)); err == nil { // exists - return nil - } - _, err := fs.WriteFile(file, []byte(` -/** - * Demo Data - */ -function Data() { - return Process( - "yao.table.Insert", - "pet", - ["name", "type", "status", "mode", "stay", "cost", "doctor_id"], - [ - ["Cookie", "cat", "checked", "enabled", 200, 105, 1], - ["Baby", "dog", "checked", "enabled", 186, 24, 1], - ["Poo", "others", "checked", "enabled", 199, 66, 1], - ] - ); -} - `), 0644) - - if err != nil { - return err - } - - file = filepath.Join("stat.js") - if _, err := os.Stat(filepath.Join(root, "scripts", file)); err == nil { // exists - return nil - } - _, err = fs.WriteFile(file, []byte(` -/** - * before:data hook - * @param {*} params - * @returns - */ -function BeforeData(params) { - log.Info("[chart] before data hook: %s", JSON.stringify(params)); - return [params]; -} - -/** - * after:data hook - * @param {*} data - * @returns - */ -function AfterData(data) { - log.Info("[chart] after data hook: %s", JSON.stringify(data)); - return data; -} - -/** - * Get Data - * @param {*} params - */ -function Data(params) { - log.Info("[chart] process data query: %s", JSON.stringify(params)); - return { - income: [ - { value: 40300, date: "2022-1-1" }, - { value: 50800, date: "2022-2-1" }, - { value: 31300, date: "2022-3-1" }, - { value: 48800, date: "2022-4-1" }, - { value: 69900, date: "2022-5-1" }, - { value: 37800, date: "2022-6-1" }, - ], - cost: [ - { value: 28100, date: "2022-1-1" }, - { value: 23000, date: "2022-2-1" }, - { value: 29300, date: "2022-3-1" }, - { value: 26700, date: "2022-4-1" }, - { value: 26400, date: "2022-5-1" }, - { value: 31200, date: "2022-6-1" }, - ], - rate: [ - { value: 8.0, date: "2022-1-1" }, - { value: 7.6, date: "2022-2-1" }, - { value: 9.1, date: "2022-3-1" }, - { value: 8.4, date: "2022-4-1" }, - { value: 6.9, date: "2022-5-1" }, - { value: 9.0, date: "2022-6-1" }, - ], - pet_count: 54, - pet_type: 8, - income_monthly: 68900, - doctor_count: 23, - prev_pet_count: { current: 54, prev: 45 }, - prev_pet_type: { current: 8, prev: 13 }, - prev_income_monthly: { current: 68900, prev: 92000 }, - prev_doctor_count: { current: 23, prev: 27 }, - datasource_type: [ - { type: "猫猫", count: 18 }, - { type: "狗狗", count: 6 }, - { type: "其他", count: 3 }, - ], - datasource_status: [ - { status: "已查看", count: 3 }, - { status: "治疗中", count: 12 }, - { status: "已治愈", count: 9 }, - ], - datasource_cost: [ - { name: "毛毛", stay: 3, cost: 2000 }, - { name: "阿布", stay: 6, cost: 4200 }, - { name: "咪咪", stay: 7, cost: 6000 }, - { name: "狗蛋", stay: 1, cost: 1000 }, - ], - }; -} - -/** - * Compute out - * @param {*} field - * @param {*} value - * @param {*} data - * @returns - */ -function Income(field, value, data) { - log.Info( - "[chart] Income Compute: %s", - JSON.stringify({ field: field, value: value, data: data }) - ); - return value; -} - `), 0644) - if err != nil { - return err - } - - return nil -} - -func makeLang(root string) error { - fs := system.New(filepath.Join(root, "langs")) - file := filepath.Join("zh-cn", "global.yml") - if _, err := os.Stat(filepath.Join(root, "langs", file)); err == nil { // exists - return nil - } - - _, err := fs.WriteFile(file, []byte(` -Demo: 演示 -Demo Application: 示例应用 -Another yao application: 又一个 YAO 应用`), 0644) - - if err != nil { - return err - } - - file = filepath.Join("zh-hk", "langs", "global.yml") - if _, err := os.Stat(filepath.Join(root, file)); err == nil { // exists - return nil - } - _, err = fs.WriteFile(file, []byte(` -Demo: 演示 -Demo Application: 示例應用 -Another yao application: 又一個YAO應用`), 0644) - - if err != nil { - return err - } - - return nil -} - -func makeIndexPage(root string) error { - fs := system.New(filepath.Join(root, "public")) - file := "index.html" - if _, err := os.Stat(filepath.Join(root, "public", file)); err == nil { // exists - return nil - } - - _, err := fs.WriteFile(file, []byte(` -It works!`), 0644) - - if err != nil { - return err - } - return nil } diff --git a/setup/install_test.go b/setup/install_test.go index 2d96ecb6..c4a24e3a 100644 --- a/setup/install_test.go +++ b/setup/install_test.go @@ -1,6 +1,7 @@ package setup import ( + "os" "testing" ) @@ -10,3 +11,19 @@ func TestInstall(t *testing.T) { // t.Fatal(err) // } } + +func TestMakeInit(t *testing.T) { + root := prepare(t) + err := makeInit(root) + if err != nil { + t.Fatal(err) + } +} + +func prepare(t *testing.T) string { + dir, err := os.MkdirTemp("", "-install") + if err != nil { + t.Fatal(err) + } + return dir +} From f2f43e7f968275405bc2c40e37cb9cbd02d7ff08 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Nov 2022 12:50:41 +0800 Subject: [PATCH 6/6] [remove] workfow table --- data/bindata.go | 133 ++++----- workflow/api.go | 107 -------- workflow/api_test.go | 12 - workflow/process.go | 151 ---------- workflow/process_test.go | 233 ---------------- workflow/types.go | 53 ---- workflow/workflow.go | 514 ----------------------------------- workflow/workflow_test.go | 296 -------------------- yao/models/workflow.mod.json | 133 --------- 9 files changed, 55 insertions(+), 1577 deletions(-) delete mode 100644 workflow/api.go delete mode 100644 workflow/api_test.go delete mode 100644 workflow/process.go delete mode 100644 workflow/process_test.go delete mode 100644 workflow/types.go delete mode 100644 workflow/workflow.go delete mode 100644 workflow/workflow_test.go delete mode 100644 yao/models/workflow.mod.json diff --git a/data/bindata.go b/data/bindata.go index b9c0a5ed..4bd9146d 100644 --- a/data/bindata.go +++ b/data/bindata.go @@ -49,7 +49,6 @@ // .tmp/data/yao/models/README.md // .tmp/data/yao/models/menu.mod.json // .tmp/data/yao/models/user.mod.json -// .tmp/data/yao/models/workflow.mod.json // .tmp/data/yao/tables/README.md // .tmp/data/yao/tables/menu.tab.json // .tmp/data/yao/tables/user.tab.json @@ -231,7 +230,7 @@ func initAppJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/app.json", size: 325, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/app.json", size: 325, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -251,7 +250,7 @@ func initChartsDashboardChartJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/charts/dashboard.chart.json", size: 8471, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/charts/dashboard.chart.json", size: 8471, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -271,7 +270,7 @@ func initFlowsAppMenuFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/flows/app/menu.flow.json", size: 1327, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/flows/app/menu.flow.json", size: 1327, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -291,7 +290,7 @@ func initFormsPetFormJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/forms/pet.form.json", size: 87, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/forms/pet.form.json", size: 87, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -311,7 +310,7 @@ func initLangsZhCnGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/langs/zh-cn/global.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/langs/zh-cn/global.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -331,7 +330,7 @@ func initLangsZhHkLangsGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/langs/zh-hk/langs/global.yml", size: 88, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/langs/zh-hk/langs/global.yml", size: 88, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -351,7 +350,7 @@ func initLoginsAdminLoginJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logins/admin.login.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/logins/admin.login.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -371,7 +370,7 @@ func initLoginsUserLoginJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logins/user.login.json", size: 272, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/logins/user.login.json", size: 272, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -391,7 +390,7 @@ func initModelsPetModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/models/pet.mod.json", size: 1418, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/models/pet.mod.json", size: 1418, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -411,7 +410,7 @@ func initPublicIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/index.html", size: 1373, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/public/index.html", size: 1373, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -431,7 +430,7 @@ func initScriptsDemoJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/demo.js", size: 334, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/scripts/demo.js", size: 334, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -451,7 +450,7 @@ func initScriptsStatJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/stat.js", size: 2235, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/scripts/stat.js", size: 2235, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -471,7 +470,7 @@ func initTablesPetTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/tables/pet.tab.json", size: 118, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "init/tables/pet.tab.json", size: 118, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -491,7 +490,7 @@ func publicIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -511,7 +510,7 @@ func uiIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -531,7 +530,7 @@ func xgenSetupIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/setup/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "xgen/setup/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -551,7 +550,7 @@ func xgenV09IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v0.9/index.html", size: 14, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "xgen/v0.9/index.html", size: 14, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -571,7 +570,7 @@ func xgenV10IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/index.html", size: 50, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "xgen/v1.0/index.html", size: 50, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -591,7 +590,7 @@ func xgenV10Layouts__indexAsyncJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "xgen/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -611,7 +610,7 @@ func xgenV10UmiJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "xgen/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "xgen/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -631,7 +630,7 @@ func yaoApisReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -651,7 +650,7 @@ func yaoApisChartHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -671,7 +670,7 @@ func yaoApisImportHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/import.http.json", size: 1676, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/import.http.json", size: 1676, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -691,7 +690,7 @@ func yaoApisPageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -711,7 +710,7 @@ func yaoApisStorageHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/storage.http.json", size: 1026, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/storage.http.json", size: 1026, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -731,7 +730,7 @@ func yaoApisTableHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/table.http.json", size: 3213, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/table.http.json", size: 3213, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -751,7 +750,7 @@ func yaoApisUserHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -771,7 +770,7 @@ func yaoApisXiangHttpJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -791,7 +790,7 @@ func yaoDataAppJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/app.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/data/app.json", size: 277, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -811,7 +810,7 @@ func yaoDataIcons404Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -831,7 +830,7 @@ func yaoDataIconsIconIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -851,7 +850,7 @@ func yaoDataIconsIconIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -871,7 +870,7 @@ func yaoDataIconsIconPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -891,7 +890,7 @@ func yaoDataIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -911,7 +910,7 @@ func yaoFieldsModelTransJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14959, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14959, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -931,7 +930,7 @@ func yaoFlowsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -951,7 +950,7 @@ func yaoFlowsAdminGuardFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/admin/guard.flow.json", size: 559, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/flows/admin/guard.flow.json", size: 559, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -971,7 +970,7 @@ func yaoFlowsMenuFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -991,7 +990,7 @@ func yaoFlowsUserFindFlowJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/flows/user/find.flow.json", size: 328, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/flows/user/find.flow.json", size: 328, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1011,7 +1010,7 @@ func yaoLangsEnUsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1031,7 +1030,7 @@ func yaoLangsZhCnGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1051,7 +1050,7 @@ func yaoLangsZhCnLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1071,7 +1070,7 @@ func yaoLangsZhCnLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1091,7 +1090,7 @@ func yaoLangsZhHkGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1629, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1111,7 +1110,7 @@ func yaoLangsZhHkLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1131,7 +1130,7 @@ func yaoLangsZhHkLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1151,7 +1150,7 @@ func yaoModelsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1171,7 +1170,7 @@ func yaoModelsMenuModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/menu.mod.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/models/menu.mod.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1191,27 +1190,7 @@ func yaoModelsUserModJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/user.mod.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _yaoModelsWorkflowModJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x55\xcd\x4e\xdb\x4c\x14\xdd\xe7\x29\x46\xb3\xe2\x93\xf2\x09\xa9\x12\x9b\x2c\x2b\x36\xa8\xfb\x6e\x2a\x14\x19\x3c\x31\x6e\xed\x71\x14\x8f\x0b\x28\xb2\x44\x28\xa1\x94\x90\x36\x52\x82\x50\x45\x84\x48\x5b\x4a\x54\x95\x84\xf2\x53\xd2\x40\xda\x97\xf1\xd8\xe6\x2d\x2a\x8f\x63\xc7\x49\x6d\x23\x68\x44\x55\xa9\xab\xc4\x77\xce\xcc\x39\xf7\xde\x33\x73\xf3\x09\x00\x20\xe6\x64\x04\x53\x00\xd2\x8b\x03\xa3\x57\x37\xcf\x0b\x30\xe9\x84\x09\x37\x27\x39\x71\x07\x13\x40\x2d\x89\x1c\x16\xd2\x8b\x4a\xee\x59\x46\x52\x16\x19\x14\x00\x38\xaf\xc8\x32\xc2\x64\xe8\x18\x73\xfb\xd8\x2c\xb7\xec\x46\xd3\x03\x21\x2c\x88\x98\x1d\x32\x83\xb1\x32\xfd\x10\x26\x00\xd0\x19\xd7\xbc\x22\x69\x32\x56\x61\x0a\x3c\x61\xd0\x3c\x80\x12\x37\x87\x24\x86\x9d\x86\xc9\x01\xbd\xc8\x3b\x5f\x64\x39\x8b\xfa\x6b\xee\x09\xa0\x2f\x13\x04\x36\xd2\x4a\xd9\x3a\x3c\xee\x93\x47\x68\x1c\xc5\x78\x34\xec\xd7\x8f\x7a\x74\x2a\xc9\x89\x58\x18\xc4\x25\x84\x05\xb2\x00\x53\xe0\xc1\xd4\x94\x1f\x14\x31\x8f\x96\x60\x0a\x90\x9c\x86\xfc\xe0\x73\x4e\x12\x79\x8e\x88\x4a\x20\xc9\xa0\x6a\x06\x92\x11\x59\x50\x78\x87\xc8\x21\x54\x32\x3e\x11\x5b\xe5\x72\x02\xdb\xeb\xa9\x98\x4d\x0e\xef\x55\x55\x4e\x60\x2a\xf3\x79\x11\x67\x35\xa2\xeb\xd6\x97\x4b\xba\x57\xba\xae\xbd\xb5\xdb\xed\x24\xc8\xe7\x59\x65\x74\x9d\x76\x6b\x76\xfb\xc0\xe8\x74\xe9\xd1\x8e\xf5\xf9\xa3\xd1\x39\x81\xfe\x49\x7a\xff\xdf\x2c\xfb\x8d\x2c\xad\xdb\x5a\x73\xff\xa5\xdd\x5e\x0f\x2f\x70\xf1\xd4\x2e\xd4\x82\xb0\x24\x18\x8a\x35\x1b\x74\xaf\x64\x37\x9a\xe6\xfe\x95\xd3\xe0\xd1\xfa\xf3\x1c\xe1\xd2\x4e\xaf\x47\x5b\x30\x27\x0a\x33\x98\x20\x01\xe5\x60\x7c\xc5\xb1\x26\x49\x7d\x07\x3b\xf1\xf8\x7c\xec\xcd\x55\x6b\xf5\x5b\x78\x26\xbd\x2a\x7d\x55\x76\x01\x91\x6e\x51\x78\x94\x1e\xb7\x65\xee\x90\x80\xb5\xf9\xd5\x5c\x29\xdc\x98\xc6\x28\x6c\x28\x0d\x95\x70\x44\x53\x7f\x4d\x04\x61\x4d\x1e\x44\x79\x94\xe1\x34\x89\x9d\x6c\xd6\x3f\xd1\xab\x15\x7a\x58\x1a\xac\x2a\x59\xc7\xe9\xcc\xac\x81\x55\x00\xed\x1f\xbb\x76\x63\xcb\xe8\x1c\x39\x1f\xf4\xe2\x84\xb6\xb6\xcc\x8d\xca\xc0\xc9\x7f\xf9\xdd\x49\xde\x24\x6d\xa8\x86\xc3\xc2\x6e\x55\xa7\x48\xd5\x46\xa7\x4c\xeb\x4d\xbb\xd5\xa1\x6f\xda\xf6\xd6\x0b\xba\x7b\x16\xa6\x1d\xf8\x64\x93\x3e\xd3\xe4\x80\xe6\xb6\x8f\x81\x6b\x2d\xfa\x61\xcd\xaa\xac\x1b\xdd\x6e\x8c\xfd\x42\x30\x9e\xf7\x34\x15\xe5\xee\xf1\xc2\xfb\x4a\x66\xa6\xd5\x50\xc1\xd6\x6e\x87\x16\x4f\x03\x30\xba\xb1\x63\x37\x9a\x13\x56\xad\x69\x74\x5f\x9b\xef\x57\xac\xb3\x77\xff\x45\xa6\x11\x72\x7f\xee\xe9\x21\x88\x6f\xc3\x48\x56\xe1\xfa\x43\xc4\x3f\x55\x15\x0c\xef\x26\xc8\x7d\xef\xc3\x4d\x51\x59\x73\x1f\x24\xfb\x7b\x95\x16\x0f\x5c\xe4\xc4\x23\xb4\xfc\xff\x63\x4e\xd2\x50\x48\x79\x99\xcd\xc7\x2a\xcf\xad\x85\x75\x59\x35\xf7\xea\xf1\x22\x83\xc8\x58\x91\x8a\x46\xc6\xad\xd2\xac\x96\x8d\x5e\xdd\x6e\x1d\xd3\xde\x76\xa8\xca\x70\x80\xa7\x68\x41\x54\x89\x92\x5b\xbe\xa3\xa4\x08\x4d\x31\xc3\xc6\x3c\x2f\x58\xcd\x52\xd4\x98\xf9\x03\x13\xa6\xff\x51\x3c\xbd\xde\x39\xfa\x37\x6e\x7e\xab\x68\x91\x29\x8c\x63\xf6\x4c\x0e\x08\xa3\xa6\x50\x02\x00\xa6\xc5\x6d\x1e\x62\xe9\xb8\x01\xdf\x13\x79\x00\x89\x28\x23\x95\x70\x72\x56\xf5\xda\x0b\xa0\xaa\x64\x48\x9a\x47\x12\x22\xc8\x8b\x02\x3d\xa1\x27\x7e\x06\x00\x00\xff\xff\x85\x12\x29\x3f\x05\x0d\x00\x00") - -func yaoModelsWorkflowModJsonBytes() ([]byte, error) { - return bindataRead( - _yaoModelsWorkflowModJson, - "yao/models/workflow.mod.json", - ) -} - -func yaoModelsWorkflowModJson() (*asset, error) { - bytes, err := yaoModelsWorkflowModJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "yao/models/workflow.mod.json", size: 3333, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/models/user.mod.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1231,7 +1210,7 @@ func yaoTablesReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1251,7 +1230,7 @@ func yaoTablesMenuTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/menu.tab.json", size: 10471, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/tables/menu.tab.json", size: 10471, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1271,7 +1250,7 @@ func yaoTablesUserTabJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/tables/user.tab.json", size: 2357, mode: os.FileMode(420), modTime: time.Unix(1668659457, 0)} + info := bindataFileInfo{name: "yao/tables/user.tab.json", size: 2357, mode: os.FileMode(420), modTime: time.Unix(1668660458, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1377,7 +1356,6 @@ var _bindata = map[string]func() (*asset, error){ "yao/models/README.md": yaoModelsReadmeMd, "yao/models/menu.mod.json": yaoModelsMenuModJson, "yao/models/user.mod.json": yaoModelsUserModJson, - "yao/models/workflow.mod.json": yaoModelsWorkflowModJson, "yao/tables/README.md": yaoTablesReadmeMd, "yao/tables/menu.tab.json": yaoTablesMenuTabJson, "yao/tables/user.tab.json": yaoTablesUserTabJson, @@ -1538,10 +1516,9 @@ var _bintree = &bintree{nil, map[string]*bintree{ }}, }}, "models": {nil, map[string]*bintree{ - "README.md": {yaoModelsReadmeMd, map[string]*bintree{}}, - "menu.mod.json": {yaoModelsMenuModJson, map[string]*bintree{}}, - "user.mod.json": {yaoModelsUserModJson, map[string]*bintree{}}, - "workflow.mod.json": {yaoModelsWorkflowModJson, map[string]*bintree{}}, + "README.md": {yaoModelsReadmeMd, map[string]*bintree{}}, + "menu.mod.json": {yaoModelsMenuModJson, map[string]*bintree{}}, + "user.mod.json": {yaoModelsUserModJson, map[string]*bintree{}}, }}, "tables": {nil, map[string]*bintree{ "README.md": {yaoTablesReadmeMd, map[string]*bintree{}}, diff --git a/workflow/api.go b/workflow/api.go deleted file mode 100644 index f51a98d8..00000000 --- a/workflow/api.go +++ /dev/null @@ -1,107 +0,0 @@ -package workflow - -import ( - "path/filepath" - - jsoniter "github.com/json-iterator/go" - "github.com/yaoapp/gou" -) - -// API: -// 读取工作流 GET /api/xiang/workflow/<工作流名称>/find/:id -// 读取工作流 GET /api/xiang/workflow/<工作流名称>/open/:data_id -// 读取工作流配置 GET /api/xiang/workflow/<工作流名称>/setting/:data_id -// 调用自定义API POST /api/xiang/workflow/<工作流名称>/<自定义API路由> - -// SetupAPIs 注册API -func (workflow *WorkFlow) SetupAPIs() error { - api := &gou.HTTP{ - Name: "工作流接口", - Version: "1.0.0", - Description: "工作流接口 API", - Group: "xiang/workflow", - Guard: "bearer-jwt", - Paths: []gou.Path{}, - } - - workflow.AddAPI(api, workflow.apiFind()) - workflow.AddAPI(api, workflow.apiOpen()) - workflow.AddAPI(api, workflow.apiSetting()) - - for name, custAPI := range workflow.APIs { - workflow.AddAPI(api, gou.Path{ - Label: custAPI.Label, - Description: custAPI.Description, - Path: filepath.Join("/", workflow.Name, name), - Method: "POST", - Process: custAPI.Process, - In: []string{workflow.Name, "$session.user_id", "$query.data_id", ":payload"}, - Out: gou.Out{ - Status: 200, - Type: "application/json", - }, - }) - } - - // 注册API - source, err := jsoniter.Marshal(api) - if err != nil { - return err - } - - gou.LoadAPI(string(source), "xiang.workflow."+workflow.Name) - return nil -} - -// AddAPI 添加API -func (workflow *WorkFlow) AddAPI(api *gou.HTTP, path gou.Path) { - api.Paths = append(api.Paths, path) -} - -// apiFind 使用ID读取工作流 -func (workflow *WorkFlow) apiFind() gou.Path { - return gou.Path{ - Label: "读取工作流", - Description: "使用工作流ID读取工作流", - Path: filepath.Join("/", workflow.Name, "find", ":id"), - Method: "GET", - Process: "xiang.workflow.Find", - In: []string{workflow.Name, "$param.id"}, - Out: gou.Out{ - Status: 200, - Type: "application/json", - }, - } -} - -// apiOpen 使用用户ID和数据ID 读取工作流 -func (workflow *WorkFlow) apiOpen() gou.Path { - return gou.Path{ - Label: "读取工作流", - Description: "使用数据ID读取工作流", - Path: filepath.Join("/", workflow.Name, "open", ":data_id"), - Method: "GET", - Process: "xiang.workflow.Open", - In: []string{workflow.Name, "$session.user_id", "$param.data_id"}, - Out: gou.Out{ - Status: 200, - Type: "application/json", - }, - } -} - -// apiSetting 读取工作流配置 -func (workflow *WorkFlow) apiSetting() gou.Path { - return gou.Path{ - Label: "读取工作流配置", - Description: "使用数据ID读取工作流配置", - Path: filepath.Join("/", workflow.Name, "setting", ":data_id"), - Method: "GET", - Process: "xiang.workflow.Setting", - In: []string{workflow.Name, "$session.user_id", "$param.data_id"}, - Out: gou.Out{ - Status: 200, - Type: "application/json", - }, - } -} diff --git a/workflow/api_test.go b/workflow/api_test.go deleted file mode 100644 index ae40c968..00000000 --- a/workflow/api_test.go +++ /dev/null @@ -1,12 +0,0 @@ -package workflow - -// Workflow will be removed from engine - -// func TestSetupAPIs(t *testing.T) { -// assignFlow := Select("assign") -// assignFlow.SetupAPIs() - -// api := gou.SelectAPI("xiang.workflow.assign") -// assert.Equal(t, "xiang.workflow.assign", api.Name) -// assert.Equal(t, 10, len(api.HTTP.Paths)) -// } diff --git a/workflow/process.go b/workflow/process.go deleted file mode 100644 index 25db1c76..00000000 --- a/workflow/process.go +++ /dev/null @@ -1,151 +0,0 @@ -package workflow - -import "github.com/yaoapp/gou" - -// WARNING: the Workflow widget will be removed from yao engine - -// Process -// 读取工作流 xiang.workflow.Find(name, workflow_id) -// 读取工作流 xiang.workflow.Open(name, uid, data_id) -// 保存工作流 xiang.workflow.Save(name, uid, node_name, data_id, input, ...output) -// 进入下一个节点 xiang.workflow.Next(name, uid, workflow_id, output) -// 跳转到指定节点 xiang.workflow.Goto(name, uid, workflow_id, node_name, output) -// 更新工作流状态 xiang.workflow.Status(name, uid, workflow_id, status_name, output) -// 标记结束流程 xiang.workflow.Done(name, uid, workflow_id, output) -// 标记关闭流程 xiang.workflow.Close(name, uid, workflow_id, output) -// 标记重置流程 xiang.workflow.Reset(name, uid, workflow_id, output) - -func init() { - // 注册处理器 - gou.RegisterProcessHandler("xiang.workflow.Find", ProcessFind) - gou.RegisterProcessHandler("xiang.workflow.Setting", ProcessSetting) - gou.RegisterProcessHandler("xiang.workflow.Open", ProcessOpen) - gou.RegisterProcessHandler("xiang.workflow.Save", ProcessSave) - gou.RegisterProcessHandler("xiang.workflow.Next", ProcessNext) - gou.RegisterProcessHandler("xiang.workflow.Goto", ProcessGoto) - gou.RegisterProcessHandler("xiang.workflow.Status", ProcessStatus) - gou.RegisterProcessHandler("xiang.workflow.Done", ProcessDone) - gou.RegisterProcessHandler("xiang.workflow.Close", ProcessClose) - gou.RegisterProcessHandler("xiang.workflow.Reset", ProcessReset) -} - -// ProcessFind xiang.workflow.Find 读取工作流 -// -// args: [工作流名称*, 工作流ID*] -// -// return: map[string]interface{} 工作流数据记录 -func ProcessFind(process *gou.Process) interface{} { - process.ValidateArgNums(2) - wflow := Select(process.ArgsString(0)) - return wflow.Find(process.ArgsInt(1)) -} - -// ProcessOpen xiang.workflow.Open 读取工作流 -// -// args: [工作流名称*, 当前用户ID*, 关联数据ID*] -// -// return: map[string]interface{} 工作流数据记录 -func ProcessOpen(process *gou.Process) interface{} { - process.ValidateArgNums(3) - wflow := Select(process.ArgsString(0)) - return wflow.Open(process.ArgsInt(1), process.Args[2]) -} - -// ProcessSetting xiang.workflow.Setting 读取工作流配置 -// -// args: [工作流名称*, 当前用户ID*, 关联数据ID*] -// -// return: map[string]interface{} 工作流配置 -func ProcessSetting(process *gou.Process) interface{} { - process.ValidateArgNums(3) - wflow := Select(process.ArgsString(0)) - return wflow.Setting(process.ArgsInt(1), process.Args[2]) -} - -// ProcessSave xiang.workflow.Save 保存工作流节点信息 -// -// args: [工作流名称*, 当前用户ID*, 节点名称*, 关联数据ID*, 输入数据*, 输出数据] (输入数据: {"data":{}, "form":{}} data 关联数据记录信息, form 工作流body表单信息, 输出数据: {"foo":"bar"} ) -// -// return: map[string]interface{} 工作流数据记录 -func ProcessSave(process *gou.Process) interface{} { - process.ValidateArgNums(5) - wflow := Select(process.ArgsString(0)) - input := InputOf(process.ArgsMap(4)) - output := map[string]interface{}{} - if process.NumOfArgsIs(6) { - output = process.ArgsMap(5) - } - return wflow.Save(process.ArgsInt(1), process.ArgsString(2), process.Args[3], input, output) -} - -// ProcessNext xiang.workflow.Next 进入下一个节点 -// -// args: [工作流名称*, 当前用户ID*, 工作流ID*, 输出数据*] (输出数据: {"foo":"bar"} ) -// -// return: map[string]interface{} 工作流数据记录 -func ProcessNext(process *gou.Process) interface{} { - process.ValidateArgNums(4) - wflow := Select(process.ArgsString(0)) - output := process.ArgsMap(3) - return wflow.Next(process.ArgsInt(1), process.ArgsInt(2), output) -} - -// ProcessGoto xiang.workflow.Goto 跳转到指定节点 -// -// args: [工作流名称*, 当前用户ID*, 工作流ID*, 节点名称*, 输出数据*] (输出数据: {"foo":"bar"} ) -// -// return: map[string]interface{} 工作流数据记录 -func ProcessGoto(process *gou.Process) interface{} { - process.ValidateArgNums(5) - wflow := Select(process.ArgsString(0)) - output := process.ArgsMap(4) - return wflow.Goto(process.ArgsInt(1), process.ArgsInt(2), process.ArgsString(3), output) -} - -// ProcessStatus xiang.workflow.Status 更新工作流状态 -// -// args: [工作流名称*, 当前用户ID*, 工作流ID*, 状态名称*, 输出数据*] (输出数据: {"foo":"bar"} ) -// -// return: map[string]interface{} 工作流数据记录 -func ProcessStatus(process *gou.Process) interface{} { - process.ValidateArgNums(5) - wflow := Select(process.ArgsString(0)) - output := process.ArgsMap(4) - return wflow.Status(process.ArgsInt(1), process.ArgsInt(2), process.ArgsString(3), output) -} - -// ProcessDone xiang.workflow.Done 标记结束流程 -// -// args: [工作流名称*, 当前用户ID*, 工作流ID*, 输出数据*] (输出数据: {"foo":"bar"} ) -// -// return: map[string]interface{} 工作流数据记录 -func ProcessDone(process *gou.Process) interface{} { - process.ValidateArgNums(4) - wflow := Select(process.ArgsString(0)) - output := process.ArgsMap(3) - return wflow.Done(process.ArgsInt(1), process.ArgsInt(2), output) -} - -// ProcessClose xiang.workflow.Close 标记关闭流程 -// -// args: [工作流名称*, 当前用户ID*, 工作流ID*, 输出数据*] (输出数据: {"foo":"bar"} ) -// -// return: map[string]interface{} 工作流数据记录 -func ProcessClose(process *gou.Process) interface{} { - process.ValidateArgNums(4) - wflow := Select(process.ArgsString(0)) - output := process.ArgsMap(3) - return wflow.Close(process.ArgsInt(1), process.ArgsInt(2), output) -} - -// ProcessReset xiang.workflow.Reset 标记重置流程 -// -// args: [工作流名称*, 当前用户ID*, 工作流ID*, 输出数据*] (输出数据: {"foo":"bar"} ) -// -// return: map[string]interface{} 工作流数据记录 -func ProcessReset(process *gou.Process) interface{} { - process.ValidateArgNums(4) - wflow := Select(process.ArgsString(0)) - output := process.ArgsMap(3) - return wflow.Reset(process.ArgsInt(1), process.ArgsInt(2), output) -} diff --git a/workflow/process_test.go b/workflow/process_test.go deleted file mode 100644 index 4ca12b69..00000000 --- a/workflow/process_test.go +++ /dev/null @@ -1,233 +0,0 @@ -package workflow - -// WARNING: the Workflow widget will be removed from yao engine - -// func init() { -// share.DBConnect(config.Conf.DB) -// share.Load(config.Conf) -// model.Load(config.Conf) -// engineModels := path.Join(os.Getenv("YAO_DEV"), "yao", "models") -// model.LoadFrom(engineModels, "xiang.") -// query.Load(config.Conf) -// flow.Load(config.Conf) -// Load(config.Conf) -// } - -// func TestProcessFind(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) - -// args := []interface{}{"assign", wflow["id"]} -// res := gou.NewProcess("xiang.workflow.Find", args...).Run() - -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessSetting(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// args := []interface{}{"assign", 1, 1} -// res := gou.NewProcess("xiang.workflow.Setting", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, 2, data.Get("nodes.2.source")) -// assert.Equal(t, 2, data.Get("nodes.3.source")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "指派商务负责人", data.Get("label")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessOpen(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) - -// args := []interface{}{"assign", 1, 1} -// res := gou.NewProcess("xiang.workflow.Open", args...).Run() - -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessSave(t *testing.T) { -// args := []interface{}{"assign", -// 1, "选择商务负责人", 1, -// map[string]interface{}{ -// "data": map[string]interface{}{"id": 1, "name": "云主机"}, -// "form": map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }, -// map[string]interface{}{"foo": "bar"}, -// } -// res := gou.NewProcess("xiang.workflow.Save", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, int64(1), data.Get("id")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessNext(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) - -// args := []interface{}{"assign", -// 1, wflow["id"], map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }, -// } -// res := gou.NewProcess("xiang.workflow.Next", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) -// assert.Equal(t, "项目负责人审批", data.Get("node_name")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessGoto(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// args := []interface{}{"assign", -// 2, id, "选择商务负责人", -// map[string]interface{}{"审批结果": "驳回"}, -// } -// res := gou.NewProcess("xiang.workflow.Goto", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessStatus(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// args := []interface{}{"assign", -// 2, id, "已完成", map[string]interface{}{"关闭原因": "测试完成"}, -// } -// res := gou.NewProcess("xiang.workflow.Status", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) -// assert.Equal(t, "已完成", data.Get("status")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessDone(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// args := []interface{}{"assign", -// 2, id, map[string]interface{}{"关闭原因": "测试完成"}, -// } -// res := gou.NewProcess("xiang.workflow.Done", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) -// assert.Equal(t, "已完成", data.Get("status")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessClose(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// args := []interface{}{"assign", -// 2, id, map[string]interface{}{"关闭原因": "测试关闭"}, -// } -// res := gou.NewProcess("xiang.workflow.Close", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) -// assert.Equal(t, "已关闭", data.Get("status")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestProcessReset(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// args := []interface{}{"assign", -// 2, id, map[string]interface{}{"驳回原因": "字段填写错误"}, -// } -// res := gou.NewProcess("xiang.workflow.Reset", args...).Run() -// data := any.Of(res).Map().MapStrAny.Dot() -// assert.Equal(t, wflow["id"], data.Get("id")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } diff --git a/workflow/types.go b/workflow/types.go deleted file mode 100644 index e3275a28..00000000 --- a/workflow/types.go +++ /dev/null @@ -1,53 +0,0 @@ -package workflow - -import ( - "github.com/yaoapp/yao/helper" - "github.com/yaoapp/yao/share" -) - -// WorkFlow 工作流配置结构 -type WorkFlow struct { - Name string `json:"-"` - Source []byte `json:"-"` - Version string `json:"version"` - Label string `json:"label,omitempty"` - Decription string `json:"decription,omitempty"` - Nodes []Node `json:"nodes"` - APIs map[string]API `json:"apis"` - Actions map[string]share.Render `json:"actions"` -} - -// Node 工作流节点 -type Node struct { - Name string `json:"name"` - Body share.Render `json:"body,omitempty"` - Actions []string `json:"actions,omitempty"` - User User `json:"user,omitempty"` - Next []Next `json:"next,omitempty"` -} - -// Next 下一个节点描述 -type Next struct { - Conditions []helper.Condition `json:"when,omitempty"` - Goto string `json:"goto,omitempty"` -} - -// User 工作流相关用户读取条件 -type User struct { - Process string `json:"process"` - Args []interface{} `json:"args"` -} - -// API 工作相关API -type API struct { - Label string `json:"label,omitempty"` - Description string `json:"description,omitempty"` - Process string `json:"process"` - Args []interface{} `json:"args"` -} - -// Input 用户输入数据 -type Input struct { - Data map[string]interface{} `json:"data"` // 记录数据 - Form map[string]interface{} `json:"form"` // 表单数据 -} diff --git a/workflow/workflow.go b/workflow/workflow.go deleted file mode 100644 index e54bf63a..00000000 --- a/workflow/workflow.go +++ /dev/null @@ -1,514 +0,0 @@ -package workflow - -import ( - "fmt" - "path/filepath" - "strings" - - jsoniter "github.com/json-iterator/go" - "github.com/yaoapp/gou" - gshare "github.com/yaoapp/gou/query/share" - "github.com/yaoapp/kun/any" - "github.com/yaoapp/kun/exception" - "github.com/yaoapp/kun/log" - "github.com/yaoapp/kun/maps" - "github.com/yaoapp/kun/str" - "github.com/yaoapp/yao/config" - "github.com/yaoapp/yao/helper" - "github.com/yaoapp/yao/share" -) - -// WARNING: the Workflow widget will be removed from yao engine - -// Process -// 读取工作流 xiang.workflow.Find(name, workflow_id) -// 读取工作流 xiang.workflow.Open(name, uid, data_id) -// 保存工作流 xiang.workflow.Save(name, uid, node_name, data_id, input, ...output) -// 进入下一个节点 xiang.workflow.Next(name, uid, workflow_id, output) -// 跳转到指定节点 xiang.workflow.Goto(name, uid, workflow_id, node_name, output) -// 更新工作流状态 xiang.workflow.Status(name, uid, workflow_id, status_name, output) -// 标记结束流程 xiang.workflow.Done(name, uid, workflow_id, output) -// 标记关闭流程 xiang.workflow.Close(name, uid, workflow_id, output) -// 标记重置流程 xiang.workflow.Reset(name, uid, workflow_id, output) - -// API: -// 读取工作流 GET /api/xiang/workflow/<工作流名称>/find/:id -// 读取工作流 GET /api/xiang/workflow/<工作流名称>/open -// 读取工作流配置 GET /api/xiang/workflow/<工作流名称>/setting -// 调用自定义API POST /api/xiang/workflow/<工作流名称>/<自定义API路由> - -// WorkFlows 工作流列表 -var WorkFlows = map[string]*WorkFlow{} - -// Load 加载数据表格 -func Load(cfg config.Config) { - LoadFrom(filepath.Join(cfg.Root, "workflows"), "") -} - -// LoadFrom 从特定目录加载 -func LoadFrom(dir string, prefix string) { - if share.DirNotExists(dir) { - return - } - share.Walk(dir, ".json", func(root, filename string) { - name := prefix + share.SpecName(root, filename) - content := share.ReadFile(filename) - _, err := LoadWorkFlow(content, name) - if err != nil { - log.With(log.F{"root": root, "filename": filename}).Error(err.Error()) - } - }) -} - -// LoadWorkFlow 载入工作流 -func LoadWorkFlow(source []byte, name string) (*WorkFlow, error) { - workflow := WorkFlow{Name: name, Source: source} - err := jsoniter.Unmarshal(source, &workflow) - if err != nil { - log.With(log.F{"name": name, "source": source}).Error("LoadWorkFlow: %s", err.Error()) - return nil, err - } - - workflow.SetupAPIs() - WorkFlows[workflow.Name] = &workflow - return WorkFlows[workflow.Name], nil -} - -// Select 读取已加载图表 -func Select(name string) *WorkFlow { - workflow, has := WorkFlows[name] - if !has { - exception.New( - fmt.Sprintf("工作流:%s; 尚未加载", name), - 400, - ).Throw() - } - return workflow -} - -// Reload 重新载入工作流 -func (workflow *WorkFlow) Reload() *WorkFlow { - new, err := LoadWorkFlow(workflow.Source, workflow.Name) - if err != nil { - exception.New( - fmt.Sprintf("工作流:%s; 加载失败", workflow.Name), - 400, - ).Throw() - } - WorkFlows[workflow.Name] = new - return new -} - -// Find 读取给定ID的工作流 -// uid 当前处理人ID, id 数据ID -func (workflow *WorkFlow) Find(id int) map[string]interface{} { - wflow := gou.Select("xiang.workflow") - res := wflow.MustFind(id, gou.QueryParam{ - Select: []interface{}{ - "data_id", "id", "input", "output", "name", - "user_id", "users", - "node_name", "node_status", - "status", - "updated_at", "created_at", - }}) - return res -} - -// Open 读取当前工作流(未完成的) -// uid 当前处理人ID, id 数据ID -func (workflow *WorkFlow) Open(uid int, id interface{}) map[string]interface{} { - wflow := gou.Select("xiang.workflow") - params := gou.QueryParam{ - Select: []interface{}{ - "data_id", "id", "input", "output", "name", - "user_id", "users", - "node_name", "node_status", - "status", - "updated_at", "created_at", - }, - Wheres: []gou.QueryWhere{ - {Column: "name", Value: workflow.Name}, - {Column: "data_id", Value: id}, - {Column: "user_ids", OP: "like", Value: fmt.Sprintf("%%|%d|%%", uid)}, - {Column: "status", Value: "进行中"}, - }, - Limit: 1, - } - rows := wflow.MustGet(params) - if len(rows) > 0 { - return rows[0] - } - - if workflow.Len() == 0 { - exception.New("工作流没有任何节点", 400).Throw() - } - - users := map[string]interface{}{} - users[workflow.Nodes[0].Name] = uid - return map[string]interface{}{ - "name": workflow.Name, - "data_id": id, - "node_name": workflow.Nodes[0].Name, - "user_id": uid, - "users": users, - "status": "进行中", - "node_status": "进行中", - "input": map[string]interface{}{}, - "output": map[string]interface{}{}, - } -} - -// Setting 返回配置信息 -// uid 当前处理人ID, id 数据ID -func (workflow *WorkFlow) Setting(uid int, id interface{}) map[string]interface{} { - wflow := workflow.Open(1, 1) - data := maps.MapStr{ - "$in": wflow["input"], - "$input": wflow["input"], - "$out": wflow["output"], - "$outupt": wflow["output"], - "$data": wflow["output"], - } - - nodes := workflow.FlowNodes(data.Dot()) - _, idx := workflow.pickNode(string(str.Of(wflow["node_name"]))) - return map[string]interface{}{ - "nodes": nodes, - "node": nodes[idx], - "node_index": idx, - "read": true, - "write": any.Of(wflow["user_id"]).CInt() == uid, - "actions": workflow.Actions, - "name": workflow.Name, - "version": workflow.Version, - "label": workflow.Label, - "decription": workflow.Decription, - } -} - -// Save 保存工作流节点数据 此版本使用Like实现 -// uid 当前处理人ID, id 数据ID -func (workflow *WorkFlow) Save(uid int, name string, id interface{}, input Input, outputs ...map[string]interface{}) map[string]interface{} { - wflow := gou.Select("xiang.workflow") - params := gou.QueryParam{ - Select: []interface{}{"id", "input", "output", "users"}, - Wheres: []gou.QueryWhere{ - {Column: "name", Value: workflow.Name}, - {Column: "data_id", Value: id}, - {Column: "user_ids", OP: "like", Value: fmt.Sprintf("%%|%d|%%", uid)}, - {Column: "status", Value: "进行中"}, - }, - Limit: 1, - } - - rows := wflow.MustGet(params) - data := map[string]interface{}{ - "name": workflow.Name, - "data_id": id, - "node_name": name, - "user_id": uid, - } - users := map[string]interface{}{} - users[name] = uid - output := map[string]interface{}{} - nodeInput := map[string]interface{}{} - nodeInput[name] = input - if len(outputs) > 0 { - output = outputs[0] - } - if len(rows) > 0 { - data["id"] = rows[0].Get("id") - nodeInput = workflow.MergeData(rows[0].Get("input"), nodeInput) - users = workflow.MergeUsers(rows[0].Get("users"), users) - output = workflow.MergeData(rows[0].Get("output"), output) - } else { - data["status"] = "进行中" - data["node_status"] = "进行中" - } - data["users"] = users - data["user_ids"] = workflow.UserIDs(users) - data["input"] = nodeInput - data["output"] = output - id = wflow.MustSave(data) - return wflow.MustFind(id, gou.QueryParam{}) -} - -// Done 标记完成 -// uid 当前处理人ID, id 工作流ID -func (workflow *WorkFlow) Done(uid int, id int, output map[string]interface{}) map[string]interface{} { - return workflow.Status(uid, id, "已完成", output) -} - -// Close 标记关闭 -// uid 当前处理人ID, id 工作流ID -func (workflow *WorkFlow) Close(uid int, id int, output map[string]interface{}) map[string]interface{} { - return workflow.Status(uid, id, "已关闭", output) -} - -// Status 设定状态 -// uid 当前处理人ID, id 工作流ID -func (workflow *WorkFlow) Status(uid int, id int, status string, output map[string]interface{}) map[string]interface{} { - wflow := workflow.Find(id) - mod := gou.Select("xiang.workflow") - output = workflow.MergeData(wflow["output"], output) - mod.Save(map[string]interface{}{ - "id": wflow["id"], - "output": output, - "status": status, - }) - return workflow.Find(id) -} - -// Reset 重新开始 -// uid 当前处理人ID, id 工作流ID -func (workflow *WorkFlow) Reset(uid int, id int, output map[string]interface{}) map[string]interface{} { - return workflow.Goto(uid, id, workflow.Nodes[0].Name, output) -} - -// Goto 工作流跳转 -func (workflow *WorkFlow) Goto(uid int, id int, name string, output map[string]interface{}) map[string]interface{} { - wflow := workflow.Find(id) - users := map[string]interface{}{} - curr, _ := workflow.pickNode(wflow["node_name"].(string)) - users[curr.Name] = uid - node, _ := workflow.pickNode(name) - output = workflow.MergeData(wflow["output"], output) - users = workflow.MergeUsers(wflow["users"], users) - nodeUID := node.GetUID(users) - mod := gou.Select("xiang.workflow") - mod.Save(map[string]interface{}{ - "id": wflow["id"], - "output": output, - "node_name": name, - "node_status": "进行中", - "user_id": nodeUID, - "users": users, - "user_ids": workflow.UserIDs(users), - }) - return workflow.Find(id) -} - -// Next 下一个工作流 -// uid 当前处理人ID, id 工作流ID -func (workflow *WorkFlow) Next(uid int, id int, output map[string]interface{}) map[string]interface{} { - wflow := workflow.Find(id) - currNode, ok := wflow["node_name"].(string) - if !ok { - exception.New("流程数据异常: 当前节点信息错误", 500).Ctx(currNode).Throw() - } - - users := map[string]interface{}{} - users[currNode] = uid - output = workflow.MergeData(wflow["output"], output) - - // 读取下一个节点 - data := map[string]interface{}{ - "$in": wflow["input"], - "$input": wflow["input"], - "$out": output, - "$outupt": output, - "$data": output, - } - nextNode := workflow.nextNode(currNode, data) - nextUID := nextNode.MakeUID() - users[nextNode.Name] = nextUID - - // 更新数据 - users = workflow.MergeUsers(wflow["users"], users) - mod := gou.Select("xiang.workflow") - mod.Save(map[string]interface{}{ - "id": wflow["id"], - "output": output, - "node_name": nextNode.Name, - "node_status": "进行中", - "user_id": nextUID, - "users": users, - "user_ids": workflow.UserIDs(users), - }) - return workflow.Find(id) -} - -// GetUID 读取节点相关人 -func (node *Node) GetUID(users interface{}) int { - if users, ok := users.(map[string]interface{}); ok { - if uid, has := users[node.Name]; has { - return any.Of(uid).CInt() - } - } - return node.MakeUID() -} - -// MakeUID 根据条件选择节点处理人 -func (node *Node) MakeUID() int { - res := gou.NewProcess(node.User.Process, node.User.Args...).Run() - return any.Of(res).CInt() -} - -func (workflow *WorkFlow) pickNode(name string) (*Node, int) { - for i, node := range workflow.Nodes { - if node.Name == name { - return &node, i - } - } - exception.New("流程数据异常: 未找到节点 %s", 500, name).Throw() - return nil, 0 -} - -// nextNode 查找下一个节点 -func (workflow *WorkFlow) nextNode(currentNode string, data map[string]interface{}) *Node { - curr, index := workflow.pickNode(currentNode) - nextIndex := index + 1 - if nextIndex == workflow.Len() { - exception.New("流程数据异常: 当前节点为最后一个节点", 500).Ctx(currentNode).Throw() - } - - // 未声明 Next 节点, 转到下一个节点 - if curr.Next == nil { - return &workflow.Nodes[nextIndex] - } - - // 声明 Next 节点, 按条件到指定节点 - data = maps.Of(data).Dot() - for _, next := range curr.Next { - node := workflow.GetNodeWhen(next, data) - if node != nil { - return node - } - } - - exception.New("流程数据异常: 未找到符合条件的工作流节点", 500).Ctx(map[string]interface{}{"current": currentNode, "data": data}).Throw() - return nil -} - -// GetNodeWhen 读取节点 -func (workflow *WorkFlow) GetNodeWhen(next Next, data map[string]interface{}) *Node { - nextNode := "" - conditions := workflow.Conditions(next.Conditions, data) - if helper.When(conditions) { - nextNode = next.Goto - for i := 0; i < workflow.Len(); i++ { - node := workflow.Nodes[i] - if node.Name == nextNode { - return &node - } - } - } - return nil -} - -// Conditions 处理绑定参数 -func (workflow *WorkFlow) Conditions(conds []helper.Condition, data map[string]interface{}) []helper.Condition { - conditions := []helper.Condition{} - for _, cond := range conds { - if left, ok := cond.Left.(string); ok { - cond.Left = gshare.Bind(left, data) - } - if right, ok := cond.Right.(string); ok { - cond.Right = gshare.Bind(right, data) - } - conditions = append(conditions, cond) - } - return conditions -} - -// UserIDs 读取用户ID -func (workflow *WorkFlow) UserIDs(users map[string]interface{}) string { - userIDs := []string{} - for _, u := range users { - userIDs = append(userIDs, fmt.Sprintf("|%d|", u)) - } - userIDs = helper.ArrayStringUnique(userIDs) - return strings.Join(userIDs, ",") -} - -// MergeUsers 合并数据 -func (workflow *WorkFlow) MergeUsers(data interface{}, new interface{}) map[string]interface{} { - res, ok := data.(map[string]interface{}) - if !ok { - return map[string]interface{}{} - } - if new, ok := new.(map[string]interface{}); ok { - for name, value := range new { - res[name] = value - } - } - return res -} - -// MergeData 合并数据 -func (workflow *WorkFlow) MergeData(data interface{}, new interface{}) map[string]interface{} { - - res, ok := data.(map[string]interface{}) - if !ok { - return map[string]interface{}{} - } - - if new, ok := new.(map[string]interface{}); ok { - for key, value := range new { - res[key] = value - } - } - return res -} - -// IsLastNode 检查是否为最后一个节点 -func (workflow *WorkFlow) IsLastNode(name string) bool { - length := workflow.Len() - return workflow.Nodes[length-1].Name == name -} - -// FlowNodes 转换为 flow -func (workflow *WorkFlow) FlowNodes(data map[string]interface{}) []map[string]interface{} { - res := []map[string]interface{}{} - nodes, err := jsoniter.Marshal(workflow.Nodes) - if err != nil { - exception.New("JSON解析错误 %s", 500, nodes).Throw() - } - - err = jsoniter.Unmarshal(nodes, &res) - if err != nil { - exception.New("JSON解析错误 %s", 500, nodes).Throw() - } - - nameMaps := map[string]int{} - for i, node := range workflow.Nodes { - nameMaps[node.Name] = i - } - - for i, node := range res { - v := gshare.Bind(node, data) - if v, ok := v.(map[string]interface{}); ok { - res[i] = v - } - res[i]["id"] = i + 1 - res[i]["label"] = res[i]["name"] - delete(res[i], "user") - delete(res[i], "next") - if workflow.Nodes[i].Next != nil { - for _, next := range workflow.Nodes[i].Next { - name := next.Goto - if id, has := nameMaps[name]; has { - res[id]["source"] = i + 1 - } - } - } - } - return res -} - -// Len 节点数量 -func (workflow *WorkFlow) Len() int { - return len(workflow.Nodes) -} - -// InputOf 映射表转换为Input -func InputOf(in map[string]interface{}) Input { - input := Input{Data: map[string]interface{}{}, Form: map[string]interface{}{}} - if data, ok := in["data"].(map[string]interface{}); ok { - input.Data = data - } - if form, ok := in["form"].(map[string]interface{}); ok { - input.Form = form - } - return input -} diff --git a/workflow/workflow_test.go b/workflow/workflow_test.go deleted file mode 100644 index 55a0240d..00000000 --- a/workflow/workflow_test.go +++ /dev/null @@ -1,296 +0,0 @@ -package workflow - -// WARNING: the Workflow widget will be removed from yao engine - -// func init() { -// share.DBConnect(config.Conf.DB) -// share.Load(config.Conf) -// model.Load(config.Conf) -// engineModels := path.Join(os.Getenv("YAO_DEV"), "xiang", "models") -// model.LoadFrom(engineModels, "xiang.") -// query.Load(config.Conf) -// flow.Load(config.Conf) -// Load(config.Conf) -// } - -// func TestLoad(t *testing.T) { -// share.DBConnect(config.Conf.DB) -// share.Load(config.Conf) -// model.Load(config.Conf) -// query.Load(config.Conf) -// Load(config.Conf) -// LoadFrom("not a path", "404.") -// check(t) -// } - -// func TestSave(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) - -// data := maps.Of(wflow).Dot() -// assert.Equal(t, int64(1), data.Get("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, float64(1), data.Get("input.选择商务负责人.data.id")) -// assert.Equal(t, "云主机", data.Get("input.选择商务负责人.data.name")) -// assert.Equal(t, float64(1), data.Get("input.选择商务负责人.form.biz_id")) -// assert.Equal(t, "张良明", data.Get("input.选择商务负责人.form.name")) -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestSaveUpdate(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) - -// wflow = assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云存储"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "李明博"}, -// }) - -// data := maps.Of(wflow).Dot() -// assert.Equal(t, int64(1), data.Get("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, float64(1), data.Get("input.选择商务负责人.data.id")) -// assert.Equal(t, "云存储", data.Get("input.选择商务负责人.data.name")) -// assert.Equal(t, float64(1), data.Get("input.选择商务负责人.form.biz_id")) -// assert.Equal(t, "李明博", data.Get("input.选择商务负责人.form.name")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestOpen(t *testing.T) { -// assignFlow := Select("assign") -// assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// wflow := assignFlow.Open(1, 1) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, int64(1), data.Get("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, int64(1), data.Get("user_id")) -// assert.Equal(t, float64(1), data.Get("users.选择商务负责人")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestOpenEmpty(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Open(1, 1) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, false, data.Has("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, 1, data.Get("user_id")) -// assert.Equal(t, 1, data.Get("users.选择商务负责人")) -// } - -// func TestNext(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// wflow = assignFlow.Next(1, any.Of(wflow["id"]).CInt(), map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, int64(1), data.Get("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "项目负责人审批", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, int64(2), data.Get("user_id")) -// assert.Equal(t, true, data.Has("users")) -// assert.Equal(t, "测试项目", data.Get("output.项目名称")) -// assert.Equal(t, "林明波", data.Get("output.商务负责人名称")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestNextWhen(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// // Next When -// wflow = assignFlow.Next(2, id, map[string]interface{}{"审批结果": "通过"}) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, int64(1), data.Get("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "审批通过", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, int64(1), data.Get("user_id")) -// assert.Equal(t, true, data.Has("users")) -// assert.Equal(t, "测试项目", data.Get("output.项目名称")) -// assert.Equal(t, "林明波", data.Get("output.商务负责人名称")) -// assert.Equal(t, "通过", data.Get("output.审批结果")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestGoto(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// wflow = assignFlow.Goto(2, id, "选择商务负责人", map[string]interface{}{"审批结果": "驳回"}) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, true, data.Has("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, int64(1), data.Get("user_id")) -// assert.Equal(t, float64(1), data.Get("users.选择商务负责人")) -// assert.Equal(t, float64(2), data.Get("users.项目负责人审批")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestReset(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// wflow = assignFlow.Reset(2, id, map[string]interface{}{"审批结果": "驳回"}) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, true, data.Has("id")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "选择商务负责人", data.Get("node_name")) -// assert.Equal(t, "进行中", data.Get("node_status")) -// assert.Equal(t, "进行中", data.Get("status")) -// assert.Equal(t, int64(1), data.Get("user_id")) -// assert.Equal(t, float64(1), data.Get("users.选择商务负责人")) -// assert.Equal(t, float64(2), data.Get("users.项目负责人审批")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestDone(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// wflow = assignFlow.Done(2, id, map[string]interface{}{"关闭原因": "测试完成"}) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, "已完成", data.Get("status")) -// assert.Equal(t, "测试完成", data.Get("output.关闭原因")) -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestClose(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// wflow = assignFlow.Close(2, id, map[string]interface{}{"关闭原因": "测试关闭"}) -// data := maps.Of(wflow).Dot() -// assert.Equal(t, "已关闭", data.Get("status")) -// assert.Equal(t, "测试关闭", data.Get("output.关闭原因")) -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func TestSetting(t *testing.T) { -// assignFlow := Select("assign") -// wflow := assignFlow.Save(1, "选择商务负责人", 1, Input{ -// Data: map[string]interface{}{"id": 1, "name": "云主机"}, -// Form: map[string]interface{}{"biz_id": 1, "name": "张良明"}, -// }) - -// setting := assignFlow.Setting(1, 1) -// data := maps.Of(setting).Dot() -// assert.Equal(t, true, data.Get("read")) -// assert.Equal(t, "选择商务负责人", data.Get("node.label")) -// assert.Equal(t, true, data.Get("write")) - -// id := any.Of(wflow["id"]).CInt() -// assignFlow.Next(1, id, map[string]interface{}{ -// "项目名称": "测试项目", -// "商务负责人名称": "林明波", -// }) - -// setting = assignFlow.Setting(1, 1) -// data = maps.Of(setting).Dot() -// assert.Equal(t, true, data.Get("read")) -// assert.Equal(t, false, data.Get("write")) -// assert.Equal(t, "项目负责人审批", data.Get("node.label")) -// assert.Equal(t, 2, data.Get("nodes.2.source")) -// assert.Equal(t, 2, data.Get("nodes.3.source")) -// assert.Equal(t, "assign", data.Get("name")) -// assert.Equal(t, "指派商务负责人", data.Get("label")) - -// // 清理数据 -// capsule.Query().From("xiang_workflow").Truncate() -// } - -// func check(t *testing.T) { -// keys := []string{} -// for key, workflow := range WorkFlows { -// keys = append(keys, key) -// workflow.Reload() -// } -// assert.Equal(t, 1, len(keys)) -// } diff --git a/yao/models/workflow.mod.json b/yao/models/workflow.mod.json deleted file mode 100644 index 494a11cc..00000000 --- a/yao/models/workflow.mod.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "name": "工作流", - "table": { - "name": "xiang_workflow", - "comment": "工作流数据表", - "engine": "InnoDB" - }, - "columns": [ - { "label": "ID", "name": "id", "type": "ID" }, - { - "label": "名称", - "comment": "工作流名称", - "name": "name", - "type": "string", - "length": 255, - "index": true, - "validations": [ - { - "method": "typeof", - "args": ["string"], - "message": "{{input}}类型错误, {{label}}应该为字符串" - } - ] - }, - { - "label": "数据标识", - "comment": "关联数据标识, 关联数据模型表格ID", - "name": "data_id", - "type": "bigInteger", - "index": true, - "nullable": true - }, - { - "label": "节点", - "comment": "当前节点名称", - "name": "node_name", - "type": "string", - "length": 255, - "index": true, - "nullable": true - }, - { - "label": "节点状态", - "comment": "当前节点状态", - "name": "node_status", - "type": "enum", - "default": "未开始", - "option": ["未开始", "进行中", "已完成"], - "index": true, - "validations": [ - { - "method": "typeof", - "args": ["string"], - "message": "{{input}}类型错误, {{label}}应该为字符串" - }, - { - "method": "enum", - "args": ["未开始", "进行中", "已完成"], - "message": "{{input}}不在许可范围, {{label}}应该为 未开始/进行中/已完成" - } - ] - }, - { - "label": "当前处理人", - "comment": "当前处理人", - "name": "user_id", - "type": "bigInteger", - "index": true, - "nullable": true - }, - { - "label": "处理人IDs", - "comment": "相关处理人ID列表(用于检索)", - "name": "user_ids", - "type": "string", - "length": 255, - "index": true, - "nullable": true - }, - { - "label": "处理人", - "comment": "相关处理人", - "name": "users", - "type": "json", - "nullable": true - }, - { - "label": "数据", - "comment": "各节点输入数据(Key-Value)", - "name": "input", - "type": "json", - "nullable": true - }, - { - "label": "处理结果", - "comment": "各节点处理结果(Key-Value)", - "name": "output", - "type": "json", - "nullable": true - }, - { - "label": "操作记录", - "comment": "操作记录", - "name": "history", - "type": "json", - "nullable": true - }, - - { - "label": "状态", - "comment": "流程状态", - "name": "status", - "type": "enum", - "default": "未开始", - "option": ["未开始", "进行中", "已完成", "已关闭"], - "index": true, - "validations": [ - { - "method": "typeof", - "args": ["string"], - "message": "{{input}}类型错误, {{label}}应该为字符串" - }, - { - "method": "enum", - "args": ["未开始", "进行中", "已完成", "已关闭"], - "message": "{{input}}不在许可范围, {{label}}应该为 未开始/进行中/已完成/已关闭" - } - ] - } - ], - "indexes": [], - "option": { "timestamps": true, "soft_deletes": true } -}