wujian_develop_tool/api.go

39 lines
725 B
Go
Raw Normal View History

2022-01-05 20:25:29 +08:00
package main
import (
"fmt"
"github.com/fatih/color"
"github.com/urfave/cli/v2"
)
// ActionApi API应用列表
func ActionApi(c *cli.Context) error {
2022-01-06 00:19:22 +08:00
if err := Init(c); err != nil {
2022-01-05 20:25:29 +08:00
return err
}
apiList := c.Args().Slice()
color.Green("API应用列表:")
for _, api := range config.Api.HasApp(apiList) {
color.Green("\t%s", api.Name)
color.Green("\t\t路径:\t%s", api.Root)
color.Green("\t\t类型:\t%s", api.Type)
color.Green("\t\t端口:\t%s", api.Port)
c := color.New(color.Bold)
c.EnableColor()
_, err := c.Println(healthApi(api))
if err != nil {
return err
}
fmt.Print("\n")
}
return nil
}
2022-01-06 00:19:22 +08:00
// ActionNewApi 创建API应用
func ActionNewApi(c *cli.Context) error {
return nil
}