packs

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPackContentNotFound = errors.New("pack content not found")

ErrPackContentNotFound is returned when no item are found in a given pack

View Source
var ErrPackNotFound = errors.New("pack not found")

ErrPackNotFound is returned when a pack is not found

Functions

func DeleteMyPackByID

func DeleteMyPackByID(c *gin.Context)

Delete a pack by ID @Summary Delete a pack by ID @Description Delete a pack by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} dataset.OkResponse "Pack deleted" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [delete]

func DeleteMyPackContentByID

func DeleteMyPackContentByID(c *gin.Context)

Delete a pack content ID by Pack ID @Summary Delete a pack content by ID @Description Delete a pack content by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Param item_id path int true "Item ID" @Success 200 {object} dataset.OkResponse "Pack Item deleted" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/packcontent/{item_id} [delete]

func DeletePackByID

func DeletePackByID(c *gin.Context)

func DeletePackContentByID

func DeletePackContentByID(c *gin.Context)

Delete a pack content by ID @Summary [ADMIN] Delete a pack content by ID @Description Delete a pack content by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} map[string]string "message" @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents/{id} [delete]

func GetMyPackByID

func GetMyPackByID(c *gin.Context)

Get My pack by ID @Summary Get My pack by ID @Description Get pack by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack ID" @Success 200 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [get]

func GetMyPackContentsByPackID

func GetMyPackContentsByPackID(c *gin.Context)

Get pack content by ID @Summary Get pack content by ID @Description Get pack content by ID @Security Bearer @Tags Packs @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} dataset.PackContent "Pack Item" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypackcontent/{id} [get]

func GetMyPacks

func GetMyPacks(c *gin.Context)

Get My packs @Summary Get My Packs @Description Get my packs @Security Bearer @Tags Packs @Produce json @Success 200 {object} dataset.Packs "Packs" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 404 {object} dataset.ErrorResponse "No pack found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypacks [get]

func GetPackByID

func GetPackByID(c *gin.Context)

Get pack by ID @Summary [ADMIN] Get pack by ID @Description Get pack by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack ID" @Success 200 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /admin/packs/{id} [get]

func GetPackContentByID

func GetPackContentByID(c *gin.Context)

Get pack content by ID @Summary [ADMIN] Get pack content by ID @Description Get pack content by ID - for admin use only @Security Bearer @Tags Internal @Produce json @Param id path int true "Pack Content ID" @Success 200 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 404 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents/{id} [get]

func GetPackContents

func GetPackContents(c *gin.Context)

Get all pack contents @Summary [ADMIN] Get all pack contents @Description Get all pack contents - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.PackContents @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents [get]

func GetPackContentsByPackID

func GetPackContentsByPackID(c *gin.Context)

Get all pack contents @Summary [ADMIN] Get all pack contents @Description Get all pack contents - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.PackContents @Failure 400 {object} dataset.ErrorResponse @Failure 404 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs/:id/packcontents [get]

func GetPacks

func GetPacks(c *gin.Context)

Get all packs @Summary [ADMIN] Get all packs @Description Get all packs - for admin use only @Security Bearer @Tags Internal @Produce json @Success 200 {object} dataset.Packs @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs [get]

func ImportFromLighterPack

func ImportFromLighterPack(c *gin.Context)

Import from lighterpack @Summary Import from lighterpack csv pack file @Description Import from lighterpack csv pack file @Security Bearer @Tags Packs @Accept multipart/form-data @Produce json @Param file formData file true "CSV file" @Success 200 {object} dataset.OkResponse "CSV data imported successfully" @Failure 400 {object} dataset.ErrorResponse "Invalid CSV format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/import [post]

func PostMyPack

func PostMyPack(c *gin.Context)

Create a new pack @Summary Create a new pack @Description Create a new pack @Security Bearer @Tags Packs @Accept json @Produce json @Param pack body dataset.Pack true "Pack" @Success 201 {object} dataset.Pack "Pack created" @Failure 400 {object} dataset.ErrorResponse "Invalid Body format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack [post]

func PostMyPackContent

func PostMyPackContent(c *gin.Context)

Create a new pack content @Summary Create a new pack content @Description Create a new pack content @Security Bearer @Tags Packs @Accept json @Produce json @Param packcontent body dataset.PackContent true "Pack Content" @Success 201 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 401 {object} dataset.ErrorResponse @Failure 403 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /v1/mypackcontent [post]

func PostPack

func PostPack(c *gin.Context)

Create a new pack @Summary [ADMIN] Create a new pack @Description Create a new pack - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param pack body dataset.Pack true "Pack" @Success 201 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs [post]

func PostPackContent

func PostPackContent(c *gin.Context)

Create a new pack content @Summary [ADMIN] Create a new pack content @Description Create a new pack content - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param packcontent body dataset.PackContent true "Pack Content" @Success 201 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents [post]

func PutMyPackByID

func PutMyPackByID(c *gin.Context)

Update a pack by ID @Summary Update a pack by ID @Description Update a pack by ID @Security Bearer @Tags Packs @Accept json @Produce json @Param id path int true "Pack ID" @Param pack body dataset.Pack true "Pack" @Success 200 {object} dataset.Pack "Pack updated" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 400 {object} dataset.ErrorResponse "Invalid Payload" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id} [put]

func PutMyPackContentByID

func PutMyPackContentByID(c *gin.Context)

Update My pack content ID by Pack ID @Summary Update My pack content ID by Pack ID @Description Update My pack content ID by Pack ID @Security Bearer @Tags Packs @Accept json @Produce json @Param id path int true "Pack ID" @Param item_id path int true "Item ID" @Param packcontent body dataset.PackContent true "Pack Content" @Success 200 {object} dataset.PackContent "Pack Content updated" @Failure 400 {object} dataset.ErrorResponse "Invalid ID format" @Failure 400 {object} dataset.ErrorResponse "Invalid Body format" @Failure 401 {object} dataset.ErrorResponse "Unauthorized" @Failure 403 {object} dataset.ErrorResponse "This pack does not belong to you" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /v1/mypack/{id}/packcontent/{item_id} [put]

func PutPackByID

func PutPackByID(c *gin.Context)

Update a pack by ID @Summary [ADMIN] Update a pack by ID @Description Update a pack by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Pack ID" @Param pack body dataset.Pack true "Pack" @Success 200 {object} dataset.Pack @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packs/{id} [put]

func PutPackContentByID

func PutPackContentByID(c *gin.Context)

Update a pack content by ID @Summary [ADMIN] Update a pack content by ID @Description Update a pack content by ID - for admin use only @Security Bearer @Tags Internal @Accept json @Produce json @Param id path int true "Pack Content ID" @Param packcontent body dataset.PackContent true "Pack Content" @Success 200 {object} dataset.PackContent @Failure 400 {object} dataset.ErrorResponse @Failure 500 {object} dataset.ErrorResponse @Router /admin/packcontents/{id} [put]

func SharedList added in v0.4.0

func SharedList(c *gin.Context)

Get pack content for a given sharing code @Summary Get pack content for a given sharing code @Description Get pack content for a given sharing code @Tags Public @Produce json @Param sharing_code path string true "Sharing Code" @Success 200 {object} dataset.PackContents "Pack Contents" @Failure 404 {object} dataset.ErrorResponse "Pack not found" @Failure 500 {object} dataset.ErrorResponse "Internal Server Error" @Router /public/packs/{sharing_code} [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL