Skip to content

Commit

Permalink
feat:update
Browse files Browse the repository at this point in the history
  • Loading branch information
gphper committed Sep 30, 2022
1 parent 0c7f590 commit d4944b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
8 changes: 4 additions & 4 deletions cmd/run/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func runFunction(cmd *cobra.Command, args []string) {
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 31, err.Error(), 0x1B)
return
}
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "install success!", 0x1B)
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "执行完成!", 0x1B)
return
}

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

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

Expand All @@ -105,7 +105,7 @@ func runFunction(cmd *cobra.Command, args []string) {
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 31, err.Error(), 0x1B)
return
}
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "stop success!", 0x1B)
fmt.Printf("%c[%d;%d;%dm%s%c[0m \n", 0x1B, 0, 40, 32, "执行完成,如未停止服务请查看日志记录!", 0x1B)
return
}
}
Expand Down
17 changes: 1 addition & 16 deletions cmd/run/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (srv *Services) Start(s service.Service) error {
}

go srv.StarServer()

return nil
}

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

// path, err := common.RootPath()
// if err != nil {
// errMsg := fmt.Sprintf("%+v", errors.WithStack(err))
// glog.Logger.Error(errMsg, zap.Error(err))
// os.Exit(0)
// }

// 创建记录日志的文件
// f, err := common.OpenFile(path + "/log/grm_error.log")
// if err != nil {
// errMsg := fmt.Sprintf("%+v", errors.WithStack(err))
// glog.Logger.Error(errMsg, zap.Error(err))
// os.Exit(0)
// }
// gin.DefaultErrorWriter = io.MultiWriter(f)
gin.DefaultWriter = io.Discard

router := router.Init()

router.StaticFS("/static", web.StaticsFs)

srv.Srv = &http.Server{
Expand Down

0 comments on commit d4944b5

Please sign in to comment.