新增自动迁移创建路由后重启

修改
- server/api/v1/sys_system.go
- server/config.yaml
- server/config/auto_code.go
- server/service/sys_auto_code.go
新增
- server/utils/reload.go
This commit is contained in:
songzhibin97
2021-05-12 11:53:52 +08:00
parent 8159aa1a88
commit 169205f132
5 changed files with 40 additions and 24 deletions
+18
View File
@@ -0,0 +1,18 @@
package utils
import (
"errors"
"os"
"os/exec"
"runtime"
"strconv"
)
func Reload() error {
if runtime.GOOS == "windows" {
return errors.New("系统不支持")
}
pid := os.Getpid()
cmd := exec.Command("kill", "-1", strconv.Itoa(pid))
return cmd.Run()
}