修改action和模版,使用log打印日志,修复job删除问题,已经所有删除问题
This commit is contained in:
1 parent
f3e0e4dbc6
commit
8460b3f385
17 files changed
+319
-314
No files matched your search
+2
-1
@@ -6,7 +6,8 @@ type Response struct {
|
||||
// 数据集
|
||||
Data interface{} `json:"data"`
|
||||
// 消息
|
||||
Msg string `json:"msg"`
|
||||
Msg string `json:"msg"`
|
||||
RequestId string `json:"requestId"`
|
||||
}
|
||||
|
||||
type Page struct {
|
||||
|
||||
+7
-1
@@ -4,15 +4,20 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"go-admin/tools"
|
||||
)
|
||||
|
||||
// 失败数据处理
|
||||
func Error(c *gin.Context, code int, err error, msg string) {
|
||||
var res Response
|
||||
res.Msg = err.Error()
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
}
|
||||
if msg != "" {
|
||||
res.Msg = msg
|
||||
}
|
||||
res.RequestId = tools.GenerateMsgIDFromContext(c)
|
||||
c.JSON(http.StatusOK, res.ReturnError(code))
|
||||
}
|
||||
|
||||
@@ -23,6 +28,7 @@ func OK(c *gin.Context, data interface{}, msg string) {
|
||||
if msg != "" {
|
||||
res.Msg = msg
|
||||
}
|
||||
res.RequestId = tools.GenerateMsgIDFromContext(c)
|
||||
c.JSON(http.StatusOK, res.ReturnOK())
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user