Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrResourceNotUploaded = dto.NewI18nError("resource not uploaded", "errors.resource_not_uploaded")
)
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(svc service.ResourceService) *Handler
func (*Handler) DownloadResource ¶
DownloadResource godoc
@Id DownloadResource
@Summary Download resource
@Description Request for getting resource. Return the resource in S3 storage.
@Tags Resource API
@Produce */*
@Param objectId path string true "Object id"
@Success 200
@Failure 404 {object} dto.ErrorResponse "Resource not found"
@Failure 500 {object} dto.ErrorResponse "Internal server error"
@Router /v0/resources/{objectId} [get]
func (*Handler) RegisterRoutes ¶
func (h *Handler) RegisterRoutes(router *gin.Engine, middlewares handler.RouteMiddlewares)
func (*Handler) UploadResource ¶
UploadResource godoc
@Id UploadResource
@Summary Upload resource
@Description Request for uploading resource. Return the object id in S3 storage.
@Tags Resource API
@Security BearerAuth
@Accept multipart/form-data
@Produce json
@Param resource formData file true "File to upload"
@Success 201 {object} dto.UploadResourceOutput "Uploaded resource"
@Failure 400 {object} dto.ErrorResponse "Validation error"
@Failure 401 {object} dto.ErrorResponse "Unauthorized error"
@Failure 403 {object} dto.ErrorResponse "User is blocked or deleted"
@Failure 500 {object} dto.ErrorResponse "Internal server error"
@Router /v0/resources/one [post]
func (*Handler) UploadResources ¶
UploadResources godoc
@Id UploadResources
@Summary Upload resources
@Description Request for uploading resources. Return the array of object ids in S3 storage for successful uploaded files.
@Tags Resource API
@Security BearerAuth
@Accept multipart/form-data
@Produce json
@Param resources formData []file true "Files to upload"
@Success 201 {object} dto.UploadResourcesOutput "Uploaded resources"
@Failure 400 {object} dto.ErrorResponse "Validation error"
@Failure 401 {object} dto.ErrorResponse "Unauthorized error"
@Failure 403 {object} dto.ErrorResponse "User is blocked or deleted"
@Failure 500 {object} dto.ErrorResponse "Internal server error"
@Router /v0/resources/many [post]
Click to show internal directories.
Click to hide internal directories.