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()
|
||||
|
||||
@@ -1139,7 +1139,7 @@ func (pb *PageBuilder) addWatermark(pdf *gofpdf.Fpdf, chineseFontAvailable bool)
|
||||
// 段前缩进宽度(约两字符,mm)
|
||||
const paragraphIndentMM = 7.0
|
||||
|
||||
// drawRichTextBlock 按段落与换行绘制文本块(还原 HTML 换行),超出 maxContentY 截断并显示 …
|
||||
// drawRichTextBlock 按段落与换行绘制文本块(还原 HTML 换行)
|
||||
// align: "C" 居中;"L" 左对齐。firstLineIndent 为 true 时每段首行缩进(段前两空格效果)。
|
||||
func (pb *PageBuilder) drawRichTextBlock(pdf *gofpdf.Fpdf, text string, contentWidth, lineHeight float64, maxContentY float64, align string, firstLineIndent bool, chineseFontAvailable bool) {
|
||||
pageWidth, _ := pdf.GetPageSize()
|
||||
|
||||
Reference in New Issue
Block a user