From 1484c0d8c79b31e732fb416bcc14a12c10b762dc Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 10 Nov 2022 12:36:59 +0800 Subject: [PATCH] [optimize] engine load & start cmd --- cmd/start.go | 7 ++++++- engine/load.go | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/start.go b/cmd/start.go index a4249774..3598b3b1 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -320,7 +320,12 @@ func printApis(silent bool) { continue } - fmt.Printf(color.CyanString("\n%s(%d)\n", api.Name, len(api.HTTP.Paths))) + deprecated := "" + if strings.HasPrefix(api.Name, "xiang.") { + deprecated = " WILL BE DEPRECATED" + } + + fmt.Printf("%s%s\n", color.CyanString("\n%s(%d)", api.Name, len(api.HTTP.Paths)), color.RedString(deprecated)) for _, p := range api.HTTP.Paths { fmt.Println( colorMehtod(p.Method), diff --git a/engine/load.go b/engine/load.go index 2060d03e..6df2dd71 100644 --- a/engine/load.go +++ b/engine/load.go @@ -156,6 +156,11 @@ func Load(cfg config.Config) (err error) { } delete(gou.APIs, "xiang.table") + delete(gou.APIs, "xiang.page") + delete(gou.APIs, "xiang.chart") + delete(gou.APIs, "xiang.xiang") + delete(gou.APIs, "xiang.user") + delete(gou.APIs, "xiang.storage") } else { // old version err = table.Load(cfg) // 加载数据表格 table