parent
79629d1263
commit
b682605762
|
@ -49,7 +49,7 @@ func ActionNewService(c *cli.Context) error {
|
||||||
if len(appList) == 0 {
|
if len(appList) == 0 {
|
||||||
appName := ""
|
appName := ""
|
||||||
for {
|
for {
|
||||||
appName = util.ReadLineWithMessage("请输入要创建的api名称: ")
|
appName = util.ReadLineWithMessage("请输入要创建的service名称: ")
|
||||||
if appName != "" {
|
if appName != "" {
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
|
@ -59,11 +59,11 @@ func ActionNewService(c *cli.Context) error {
|
||||||
appList = append(appList, appName)
|
appList = append(appList, appName)
|
||||||
}
|
}
|
||||||
for _, newApp := range appList {
|
for _, newApp := range appList {
|
||||||
color.Green("正在创建[%s]API应用...", newApp)
|
color.Green("正在创建[%s]Service应用...", newApp)
|
||||||
app := config.Config.Service.GetApp(newApp)
|
app := config.Config.Service.GetApp(newApp)
|
||||||
app = config.Service{
|
app = config.Service{
|
||||||
Name: newApp,
|
Name: newApp,
|
||||||
Root: "app/api/" + newApp,
|
Root: "app/service/" + newApp,
|
||||||
}
|
}
|
||||||
|
|
||||||
if util.ExistDir(app.Root) && !util.ReadBoolWithMessage(app.Root+"目录已存在,是否要覆盖app文件目录(y/n): ") {
|
if util.ExistDir(app.Root) && !util.ReadBoolWithMessage(app.Root+"目录已存在,是否要覆盖app文件目录(y/n): ") {
|
||||||
|
@ -109,7 +109,7 @@ func ActionNewService(c *cli.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
color.Green("[%s]API应用创建成功!!!\n\n", newApp)
|
color.Green("[%s]Service应用创建成功!!!\n\n", newApp)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue