增加定时任务 处理异常

This commit is contained in:
2024-08-30 11:55:19 +08:00
parent aa3f9e8711
commit bfb284c4cc
30 changed files with 945 additions and 336 deletions

View File

@@ -13,6 +13,21 @@ import (
"time"
)
func Exit(err any, str string) {
switch arg := err.(type) {
case error:
if arg != nil {
fmt.Println(str, arg.Error())
os.Exit(1)
}
case bool:
if arg {
fmt.Println(str, err)
os.Exit(1)
}
}
}
func GetReqPath(c *gin.Context) string {
return c.Request.Method + " " + c.Request.URL.String()
}