Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct { }
Provider represents an upload provider
func (*Provider) Search ¶
func (p *Provider) Search(_ *xorm.Session, _ string, _ int64) (result []*background.Image, err error)
Search is only used to implement the interface
func (*Provider) Set ¶
func (p *Provider) Set(s *xorm.Session, img *background.Image, project *models.Project, _ web.Auth) (err error)
Set handles setting a background through a file upload @Summary Upload a project background @Description Upload a project background. @tags project @Accept mpfd @Produce json @Param id path int true "Project ID" @Param background formData string true "The file as single file." @Security JWTKeyAuth @Success 200 {object} models.Message "The background was set successfully." @Failure 400 {object} models.Message "File is no image." @Failure 403 {object} models.Message "No access to the project." @Failure 403 {object} models.Message "File too large." @Failure 404 {object} models.Message "The project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/backgrounds/upload [put]