修改action和模版,使用log打印日志,修复job删除问题,已经所有删除问题

This commit is contained in:
linwenxiang
2020-09-22 22:04:29 +08:00
parent f3e0e4dbc6
commit 8460b3f385
17 changed files with 319 additions and 314 deletions
+16
View File
@@ -5,6 +5,9 @@ import (
"runtime"
"strconv"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/spf13/cast"
"golang.org/x/crypto/bcrypt"
)
@@ -57,3 +60,16 @@ func HasError(err error, msg string, code ...int) {
panic("CustomError#" + strconv.Itoa(statusCode) + "#" + msg)
}
}
// GenerateMsgIDFromContext 生成msgID
func GenerateMsgIDFromContext(c *gin.Context) string {
var msgID string
data, ok := c.Get("msgID")
if !ok {
msgID = uuid.New().String()
c.Set("msgID", msgID)
return msgID
}
msgID = cast.ToString(data)
return msgID
}