优化结构

This commit is contained in:
Yvan
2026-08-28 16:23:52 +08:00
parent 9b1daaf3f6
commit 295ee5c49e
24 changed files with 128 additions and 145 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package handler
import (
"errors"
"kra/internal/biz/system"
"kra/internal/service/dto"
systemservice "kra/internal/service/system"
"net/http"
@@ -16,7 +17,7 @@ func NewMedia(service *systemservice.MediaService) *Media { return &Media{servic
func (h *Media) limitMultipartBody(c *gin.Context) int64 {
limit := h.service.MediaConfig().EffectiveMaxFileSize()
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, limit+(1<<20))
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, limit+system.UploadBodyOverhead)
return limit
}