diff --git a/engine/process.go b/engine/process.go index 6f62ee27..6c2798b9 100644 --- a/engine/process.go +++ b/engine/process.go @@ -12,9 +12,14 @@ import ( func init() { // 注册处理器 gou.RegisterProcessHandler("xiang.main.Ping", processPing) + gou.AliasProcess("xiang.main.Ping", "xiang.sys.Ping") + gou.RegisterProcessHandler("xiang.main.FileContent", processFileContent) gou.RegisterProcessHandler("xiang.main.AppFileContent", processAppFileContent) + gou.RegisterProcessHandler("xiang.main.Inspect", processInspect) + gou.AliasProcess("xiang.main.Inspect", "xiang.sys.Inspect") + gou.RegisterProcessHandler("xiang.main.Favicon", processFavicon) } diff --git a/engine/process_test.go b/engine/process_test.go index 0a403708..3aff66d7 100644 --- a/engine/process_test.go +++ b/engine/process_test.go @@ -14,3 +14,15 @@ func TestProcessPing(t *testing.T) { assert.True(t, ok) assert.Equal(t, res["version"], share.VERSION) } + +func TestProcessAliasPing(t *testing.T) { + res, ok := gou.NewProcess("xiang.sys.Ping").Run().(map[string]interface{}) + assert.True(t, ok) + assert.Equal(t, res["version"], share.VERSION) +} + +func TestProcessInspect(t *testing.T) { + res, ok := gou.NewProcess("xiang.sys.Inspect").Run().(share.AppInfo) + assert.True(t, ok) + assert.NotNil(t, res.Version) +} diff --git a/helper/process.go b/helper/process.go index 0033bb14..0e572e67 100644 --- a/helper/process.go +++ b/helper/process.go @@ -41,11 +41,17 @@ func init() { gou.RegisterProcessHandler("xiang.helper.IF", ProcessIF) gou.RegisterProcessHandler("xiang.helper.EnvSet", ProcessEnvSet) + gou.AliasProcess("xiang.helper.EnvSet", "xiang.env.Set") gou.RegisterProcessHandler("xiang.helper.EnvGet", ProcessEnvGet) + gou.AliasProcess("xiang.helper.EnvGet", "xiang.env.Get") gou.RegisterProcessHandler("xiang.helper.EnvMultiSet", ProcessEnvMultiSet) + gou.AliasProcess("xiang.helper.EnvMultiSet", "xiang.env.MultiSet") gou.RegisterProcessHandler("xiang.helper.EnvMultiGet", ProcessEnvMultiGet) + gou.AliasProcess("xiang.helper.EnvMultiGet", "xiang.env.MultiGet") gou.RegisterProcessHandler("xiang.helper.Print", ProcessPrint) + gou.AliasProcess("xiang.helper.Print", "xiang.sys.Print") + gou.RegisterProcessHandler("xiang.helper.Throw", ProcessThrow) gou.RegisterProcessHandler("xiang.helper.Return", ProcessReturn)