فهرست منبع

fix:日志记录更完整

Roc 4 ماه پیش
والد
کامیت
85a1d54b6e
1فایلهای تغییر یافته به همراه1 افزوده شده و 21 حذف شده
  1. 1 21
      middleware/common.go

+ 1 - 21
middleware/common.go

@@ -10,6 +10,7 @@ import (
 	"strconv"
 )
 
+// Common 公共中间件
 type Common struct{}
 
 // RequestLog
@@ -61,24 +62,3 @@ func (common *Common) Page(c *gin.Context) {
 	c.Set("page_size", pageSize)
 	c.Next()
 }
-
-// Common2 公共中间件
-func Common2() gin.HandlerFunc {
-	return func(c *gin.Context) {
-		var currPage, pageSize int
-		reqPage := c.DefaultQuery("curr_page", "0")
-		currPage, _ = strconv.Atoi(reqPage)
-		if currPage <= 0 {
-			currPage = 1
-		}
-
-		reqPageSize := c.DefaultQuery("page_size", "0")
-		pageSize, _ = strconv.Atoi(reqPageSize)
-		if pageSize <= 0 {
-			pageSize = 20
-		}
-		c.Set("curr_page", currPage)
-		c.Set("page_size", pageSize)
-		c.Next()
-	}
-}