Skip to content

Commit d4944b5

Browse files
committed
feat:update
1 parent 0c7f590 commit d4944b5

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

cmd/run/root.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func runFunction(cmd *cobra.Command, args []string) {
7878
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 31, err.Error(), 0x1B)
7979
return
8080
}
81-
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "install success!", 0x1B)
81+
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "执行完成!", 0x1B)
8282
return
8383
}
8484

@@ -87,7 +87,7 @@ func runFunction(cmd *cobra.Command, args []string) {
8787
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 31, err.Error(), 0x1B)
8888
return
8989
}
90-
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "uninstall success!", 0x1B)
90+
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "执行完成,如服务未卸载请先确保服务已停止运行!", 0x1B)
9191
return
9292
}
9393

@@ -96,7 +96,7 @@ func runFunction(cmd *cobra.Command, args []string) {
9696
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 31, err.Error(), 0x1B)
9797
return
9898
}
99-
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "start success!", 0x1B)
99+
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "执行完成,如服务不能正常访问请查看日志记录!", 0x1B)
100100
return
101101
}
102102

@@ -105,7 +105,7 @@ func runFunction(cmd *cobra.Command, args []string) {
105105
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 31, err.Error(), 0x1B)
106106
return
107107
}
108-
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "stop success!", 0x1B)
108+
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "执行完成,如未停止服务请查看日志记录!", 0x1B)
109109
return
110110
}
111111
}

cmd/run/service.go

+1-16
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func (srv *Services) Start(s service.Service) error {
6262
}
6363

6464
go srv.StarServer()
65+
6566
return nil
6667
}
6768

@@ -79,25 +80,9 @@ func (srv *Services) StarServer() {
7980
gin.DisableConsoleColor()
8081
gin.SetMode(gin.ReleaseMode)
8182

82-
// path, err := common.RootPath()
83-
// if err != nil {
84-
// errMsg := fmt.Sprintf("%+v", errors.WithStack(err))
85-
// glog.Logger.Error(errMsg, zap.Error(err))
86-
// os.Exit(0)
87-
// }
88-
89-
// 创建记录日志的文件
90-
// f, err := common.OpenFile(path + "/log/grm_error.log")
91-
// if err != nil {
92-
// errMsg := fmt.Sprintf("%+v", errors.WithStack(err))
93-
// glog.Logger.Error(errMsg, zap.Error(err))
94-
// os.Exit(0)
95-
// }
96-
// gin.DefaultErrorWriter = io.MultiWriter(f)
9783
gin.DefaultWriter = io.Discard
9884

9985
router := router.Init()
100-
10186
router.StaticFS("/static", web.StaticsFs)
10287

10388
srv.Srv = &http.Server{

0 commit comments

Comments
 (0)