feat: 将工作流与 FAQ 上传上限扩至 20MB

- 同步管理端、用户中心与后端工作流文件校验

- 扩展 FAQ 普通及分享上传限制并补充边界测试
This commit is contained in:
2026-07-30 17:39:13 +08:00
parent 2abff304ed
commit 100d744c25
12 changed files with 93 additions and 16 deletions

View File

@@ -47,7 +47,7 @@ import java.util.Set;
@UsePermission(moduleName = "/api/v1/documentCollection")
public class FaqItemController extends BaseCurdController<FaqItemService, FaqItem> {
private static final long MAX_IMAGE_SIZE_BYTES = 5L * 1024L * 1024L;
private static final long MAX_IMAGE_SIZE_BYTES = 20L * 1024L * 1024L;
private static final Set<String> ALLOWED_IMAGE_TYPES = new HashSet<>(Arrays.asList(
"image/jpeg",
"image/png",
@@ -215,7 +215,7 @@ public class FaqItemController extends BaseCurdController<FaqItemService, FaqIte
throw new BusinessException("图片不能为空");
}
if (file.getSize() > MAX_IMAGE_SIZE_BYTES) {
throw new BusinessException("图片大小不能超过5MB");
throw new BusinessException("图片大小不能超过20MB");
}
if (!isAllowedImageType(file)) {
throw new BusinessException("仅支持 JPG/PNG/WEBP/GIF 图片");

View File

@@ -75,7 +75,7 @@ import java.util.Set;
@RequestMapping("/api/v1/share/knowledge")
public class ShareKnowledgeController {
private static final long MAX_IMAGE_SIZE_BYTES = 5L * 1024L * 1024L;
private static final long MAX_IMAGE_SIZE_BYTES = 20L * 1024L * 1024L;
private static final Set<String> ALLOWED_IMAGE_TYPES = new HashSet<>(Arrays.asList(
"image/jpeg",
"image/png",
@@ -785,7 +785,7 @@ public class ShareKnowledgeController {
throw new BusinessException("图片不能为空");
}
if (file.getSize() > MAX_IMAGE_SIZE_BYTES) {
throw new BusinessException("图片大小不能超过5MB");
throw new BusinessException("图片大小不能超过20MB");
}
if (!isAllowedImageType(file)) {
throw new BusinessException("仅支持 JPG/PNG/WEBP/GIF 图片");