package listing

import (
	filemodule "hfb_sys/backend/internal/modules/file"
)

type Handler struct {
	service                  *Service
	storage                  *filemodule.Storage
	externalUploadSecret     string
	externalUploadAllowedIPs []string
}

const maxExternalUploadBodyBytes = 256 * 1024

type HandlerOptions struct {
	ExternalUploadSecret     string
	ExternalUploadAllowedIPs []string
}

func NewHandler(service *Service, storage *filemodule.Storage, opts ...HandlerOptions) *Handler {
	handler := &Handler{service: service, storage: storage}
	if len(opts) > 0 {
		handler.externalUploadSecret = opts[0].ExternalUploadSecret
		handler.externalUploadAllowedIPs = opts[0].ExternalUploadAllowedIPs
	}
	return handler
}
