add
This commit is contained in:
@@ -19,15 +19,15 @@ type ComprehensiveLoggerMiddleware struct {
|
||||
|
||||
// ComprehensiveLoggerConfig 全面日志配置
|
||||
type ComprehensiveLoggerConfig struct {
|
||||
EnableRequestLogging bool // 是否记录请求日志
|
||||
EnableResponseLogging bool // 是否记录响应日志
|
||||
EnableRequestBodyLogging bool // 是否记录请求体
|
||||
EnableErrorLogging bool // 是否记录错误日志
|
||||
EnableBusinessLogging bool // 是否记录业务日志
|
||||
EnablePerformanceLogging bool // 是否记录性能日志
|
||||
MaxBodySize int64 // 最大记录体大小
|
||||
ExcludePaths []string // 排除的路径
|
||||
IncludePaths []string // 包含的路径
|
||||
EnableRequestLogging bool // 是否记录请求日志
|
||||
EnableResponseLogging bool // 是否记录响应日志
|
||||
EnableRequestBodyLogging bool // 是否记录请求体
|
||||
EnableErrorLogging bool // 是否记录错误日志
|
||||
EnableBusinessLogging bool // 是否记录业务日志
|
||||
EnablePerformanceLogging bool // 是否记录性能日志
|
||||
MaxBodySize int64 // 最大记录体大小
|
||||
ExcludePaths []string // 排除的路径
|
||||
IncludePaths []string // 包含的路径
|
||||
}
|
||||
|
||||
// NewComprehensiveLoggerMiddleware 创建全面日志中间件
|
||||
@@ -439,4 +439,4 @@ func (bl *BusinessLogger) getUserIDFromContext(ctx context.Context) string {
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,10 @@ func (m *DailyRateLimitMiddleware) GetPriority() int {
|
||||
func (m *DailyRateLimitMiddleware) Handle() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
ctx := c.Request.Context()
|
||||
|
||||
if m.config.App.IsDevelopment() {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
// 检查是否在排除路径中
|
||||
if m.isExcludedPath(c.Request.URL.Path) {
|
||||
c.Next()
|
||||
|
||||
Reference in New Issue
Block a user