Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

feat(upload): add support for file attachments and enhance image upload

LinkinStarsaac2370fe894
diff --git a/internal/schema/siteinfo_schema.go b/internal/schema/siteinfo_schema.go
index 814465d9..fee6b8cb 100644
--- a/internal/schema/siteinfo_schema.go
+++ b/internal/schema/siteinfo_schema.go
@@ -79,8 +79,8 @@ type SiteWriteReq struct {
MaxImageSize int `validate:"omitempty,gt=0" json:"max_image_size"`
MaxAttachmentSize int `validate:"omitempty,gt=0" json:"max_attachment_size"`
MaxImageMegapixel int `validate:"omitempty,gt=0" json:"max_image_megapixel"`
- AuthorizedImageExtensions []string `validate:"omitempty,dive,gt=0,lte=128" json:"authorized_image_extensions"`
- AuthorizedAttachmentExtensions []string `validate:"omitempty,dive,gt=0,lte=128" json:"authorized_attachment_extensions"`
+ AuthorizedImageExtensions []string `validate:"omitempty" json:"authorized_image_extensions"`
+ AuthorizedAttachmentExtensions []string `validate:"omitempty" json:"authorized_attachment_extensions"`
UserID string `json:"-"`
}