feat: upload

This commit is contained in:
Rogee
2025-01-15 10:43:16 +08:00
parent 9bfdf0e0ea
commit ab827715fb
16 changed files with 378 additions and 161 deletions

View File

@@ -7,8 +7,9 @@ import (
"github.com/pkg/errors"
)
func File(key string) func(fiber.Ctx) (*multipart.FileHeader, error) {
func File[T any](key string) func(fiber.Ctx) (*multipart.FileHeader, error) {
return func(ctx fiber.Ctx) (*multipart.FileHeader, error) {
_ = new(T)
return ctx.FormFile(key)
}
}