swagger docs update
This commit is contained in:
parent
9fe21b4b78
commit
e89efaa8b9
4 changed files with 1283 additions and 216 deletions
|
|
@ -60,16 +60,16 @@ func (h *Handler) RegisterRoutes(r *gin.RouterGroup) {
|
|||
|
||||
// create godoc
|
||||
//
|
||||
// @Summary Create new merch
|
||||
// @Description Create new merch
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param merch body newMerchDTO true "merch body"
|
||||
// @Success 201
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/create [POST]
|
||||
// @Summary Create new merch
|
||||
// @Description Create new merch
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param merch body newMerchDTO true "merch body"
|
||||
// @Success 201
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/create [POST]
|
||||
func (co *controller) create(c *gin.Context) {
|
||||
var newMerch newMerchDTO
|
||||
if err := c.ShouldBindJSON(&newMerch); err != nil {
|
||||
|
|
@ -91,16 +91,16 @@ func (co *controller) getOne(c *gin.Context) {}
|
|||
|
||||
// getMany godoc
|
||||
//
|
||||
// @Summary Get all merch
|
||||
// @Description Get all merch without origins
|
||||
// @Tags Merch
|
||||
// @Produce json
|
||||
// @Success 200 {array} ListResponse
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/list [GET]
|
||||
// @Summary Get all merch
|
||||
// @Description Get all merch without origins
|
||||
// @Tags Merch
|
||||
// @Produce json
|
||||
// @Success 200 {array} ListResponse
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/list [GET]
|
||||
func (co *controller) getMany(c *gin.Context) {
|
||||
response, err := co.service.getMany(c, getUserId(c))
|
||||
if err != nil {
|
||||
|
|
@ -119,18 +119,18 @@ func (co *controller) getMany(c *gin.Context) {
|
|||
|
||||
// updateMerch godoc
|
||||
//
|
||||
// @Summary Update merch
|
||||
// @Description Update merch general info (except extra data)
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param uuid path string true "merch uuid"
|
||||
// @Param payload body updateMerchDTO true "payload"
|
||||
// @Produce json
|
||||
// @Success 200 {object} merchDTO
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/{uuid} [PUT]
|
||||
// @Summary Update merch
|
||||
// @Description Update merch general info (except extra data)
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param uuid path string true "merch uuid"
|
||||
// @Param payload body updateMerchDTO true "payload"
|
||||
// @Produce json
|
||||
// @Success 200 {object} merchDTO
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/{uuid} [PUT]
|
||||
func (co *controller) updateMerch(c *gin.Context) {
|
||||
merchUuid := c.Param("id")
|
||||
if err := uuid.Validate(merchUuid); err != nil {
|
||||
|
|
@ -164,18 +164,18 @@ func (co *controller) updateMerch(c *gin.Context) {
|
|||
|
||||
// updateMerch godoc
|
||||
//
|
||||
// @Summary Update merch extra data
|
||||
// @Description Update ONLY merch extra data
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param uuid path string true "merch uuid"
|
||||
// @Param payload body extraDataDTO true "payload"
|
||||
// @Produce json
|
||||
// @Success 200 {object} extraDataDTO
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/extra/{uuid} [PUT]
|
||||
// @Summary Update merch extra data
|
||||
// @Description Update ONLY merch extra data
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param uuid path string true "merch uuid"
|
||||
// @Param payload body extraDataDTO true "payload"
|
||||
// @Produce json
|
||||
// @Success 200 {object} extraDataDTO
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/extra/{uuid} [PUT]
|
||||
func (co *controller) updateExtraData(c *gin.Context) {
|
||||
merchUuid := c.Param("id")
|
||||
if err := uuid.Validate(merchUuid); err != nil {
|
||||
|
|
@ -209,16 +209,16 @@ func (co *controller) updateExtraData(c *gin.Context) {
|
|||
|
||||
// deleteMerch godoc
|
||||
//
|
||||
// @Summary Delete merch
|
||||
// @Description Marks merch and all its extra data as deleted by uuid.
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param uuid path string true "merch uuid"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/{uuid} [DELETE]
|
||||
// @Summary Delete merch
|
||||
// @Description Marks merch and all its extra data as deleted by uuid.
|
||||
// @Tags Merch
|
||||
// @Accept json
|
||||
// @Param uuid path string true "merch uuid"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/{uuid} [DELETE]
|
||||
func (co *controller) deleteMerch(c *gin.Context) {
|
||||
merchUuid := c.Param("id")
|
||||
if err := uuid.Validate(merchUuid); err != nil {
|
||||
|
|
@ -238,16 +238,16 @@ func (co *controller) deleteMerch(c *gin.Context) {
|
|||
|
||||
// createOrigin godoc
|
||||
//
|
||||
// @Summary Create new origin
|
||||
// @Description Create new origin with name
|
||||
// @Tags Origins
|
||||
// @Accept json
|
||||
// @Param origin body newOriginDTO true "origin body"
|
||||
// @Success 201
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/origins [POST]
|
||||
// @Summary Create new origin
|
||||
// @Description Create new origin with name
|
||||
// @Tags Origins
|
||||
// @Accept json
|
||||
// @Param origin body newOriginDTO true "origin body"
|
||||
// @Success 201
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/origins [POST]
|
||||
func (co *controller) createOrigin(c *gin.Context) {
|
||||
var origin *newOriginDTO
|
||||
|
||||
|
|
@ -269,16 +269,16 @@ func (co *controller) createOrigin(c *gin.Context) {
|
|||
|
||||
// getOrigins godoc
|
||||
//
|
||||
// @Summary Get all origins
|
||||
// @Description Get all origins
|
||||
// @Tags Origins
|
||||
// @Produce json
|
||||
// @Success 200 {object} originsDTO
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/origins [GET]
|
||||
// @Summary Get all origins
|
||||
// @Description Get all origins
|
||||
// @Tags Origins
|
||||
// @Produce json
|
||||
// @Success 200 {object} originsDTO
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/origins [GET]
|
||||
func (co *controller) getOrigins(c *gin.Context) {
|
||||
response, err := co.service.getOrigins(c)
|
||||
if err != nil {
|
||||
|
|
@ -293,16 +293,16 @@ func (co *controller) getOrigins(c *gin.Context) {
|
|||
|
||||
// deleteOrigin godoc
|
||||
//
|
||||
// @Summary Delete origin
|
||||
// @Description Marks origin as deleted by name.
|
||||
// @Tags Origins
|
||||
// @Accept json
|
||||
// @Param origin body deleteOriginDTO true "origin body"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/origins [DELETE]
|
||||
// @Summary Delete origin
|
||||
// @Description Marks origin as deleted by name.
|
||||
// @Tags Origins
|
||||
// @Accept json
|
||||
// @Param origin body deleteOriginDTO true "origin body"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/origins [DELETE]
|
||||
func (co *controller) deleteOrigin(c *gin.Context) {
|
||||
var origin *deleteOriginDTO
|
||||
|
||||
|
|
@ -324,16 +324,16 @@ func (co *controller) deleteOrigin(c *gin.Context) {
|
|||
|
||||
// getChartsPrices godoc
|
||||
//
|
||||
// @Summary Получить цены мерча за период
|
||||
// @Description Получить цены мерча за период
|
||||
// @Tags Merch
|
||||
// @Produce json
|
||||
// @Param days query string false "period in days"
|
||||
// @Success 200 {array} PricesResponse
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /prices [get]
|
||||
// @Summary Получить цены мерча за период
|
||||
// @Description Получить цены мерча за период
|
||||
// @Tags Merch
|
||||
// @Produce json
|
||||
// @Param days query string false "period in days"
|
||||
// @Success 200 {array} PricesResponse
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /prices [get]
|
||||
func (co *controller) getChartsPrices(c *gin.Context) {
|
||||
response, err := co.service.getPrices(c, getUserId(c), getDays(c))
|
||||
if err != nil {
|
||||
|
|
@ -347,18 +347,18 @@ func (co *controller) getChartsPrices(c *gin.Context) {
|
|||
|
||||
// getDistinctPrices godoc
|
||||
//
|
||||
// @Summary Получить перепады цен мерча за период по его merch_uuid
|
||||
// @Description Получить перепады цен мерча за период по его merch_uuid
|
||||
// @Tags Merch
|
||||
// @Produce json
|
||||
// @Param uuid path string true "merch_uuid"
|
||||
// @Param days query string false "period in days"
|
||||
// @Success 200 {object} PricesResponse
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /prices/{uuid} [get]
|
||||
// @Summary Получить перепады цен мерча за период по его merch_uuid
|
||||
// @Description Получить перепады цен мерча за период по его merch_uuid
|
||||
// @Tags Merch
|
||||
// @Produce json
|
||||
// @Param uuid path string true "merch_uuid"
|
||||
// @Param days query string false "period in days"
|
||||
// @Success 200 {object} PricesResponse
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /prices/{uuid} [get]
|
||||
func (co *controller) getDistinctPrices(c *gin.Context) {
|
||||
merchUuid := c.Param("uuid")
|
||||
if merchUuid == "" {
|
||||
|
|
@ -385,15 +385,15 @@ func (co *controller) getDistinctPrices(c *gin.Context) {
|
|||
|
||||
// getZeroPrices godoc
|
||||
//
|
||||
// @Summary Получить нулевые цены
|
||||
// @Description Получить нулевые цены
|
||||
// @Tags Merch zero prices
|
||||
// @Produce json
|
||||
// @Success 200 {array} ZeroPrice
|
||||
// @Success 204
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/zeroprices [get]
|
||||
// @Summary Получить нулевые цены
|
||||
// @Description Получить нулевые цены
|
||||
// @Tags Merch zero prices
|
||||
// @Produce json
|
||||
// @Success 200 {array} ZeroPrice
|
||||
// @Success 204
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/zeroprices [get]
|
||||
func (co *controller) getZeroPrices(c *gin.Context) {
|
||||
response, err := co.service.getZeroPrices(c, getUserId(c))
|
||||
if err != nil {
|
||||
|
|
@ -411,17 +411,17 @@ func (co *controller) getZeroPrices(c *gin.Context) {
|
|||
|
||||
// deleteZeroPrices godoc
|
||||
//
|
||||
// @Summary Пометить нулевые цены как удаленные
|
||||
// @Description Пометить нулевые цены как удаленные
|
||||
// @Tags Merch zero prices
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body DeleteZeroPrices true "payload"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/zeroprices [delete]
|
||||
// @Summary Пометить нулевые цены как удаленные
|
||||
// @Description Пометить нулевые цены как удаленные
|
||||
// @Tags Merch zero prices
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body DeleteZeroPrices true "payload"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/zeroprices [delete]
|
||||
func (co *controller) deleteZeroPrices(c *gin.Context) {
|
||||
var payload []DeleteZeroPrices
|
||||
if err := c.ShouldBindJSON(&payload); err != nil {
|
||||
|
|
@ -446,17 +446,17 @@ func (co *controller) deleteZeroPrices(c *gin.Context) {
|
|||
|
||||
// deleteZeroPricesPeriod godoc
|
||||
//
|
||||
// @Summary Пометить нулевые цены как удаленные за указанный период
|
||||
// @Description Пометить нулевые цены как удаленные за указанный период
|
||||
// @Tags Merch zero prices
|
||||
// @Security BearerAuth
|
||||
// @Param start query string true "start"
|
||||
// @Param end query string true "end"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/zeroprices/period [delete]
|
||||
// @Summary Пометить нулевые цены как удаленные за указанный период
|
||||
// @Description Пометить нулевые цены как удаленные за указанный период
|
||||
// @Tags Merch zero prices
|
||||
// @Security BearerAuth
|
||||
// @Param start query string true "start"
|
||||
// @Param end query string true "end"
|
||||
// @Success 204
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/zeroprices/period [delete]
|
||||
func (co *controller) deleteZeroPricesPeriod(c *gin.Context) {
|
||||
start, err := co.utils.ParseTime(c.Query("start"))
|
||||
if err != nil {
|
||||
|
|
@ -482,17 +482,17 @@ func (co *controller) deleteZeroPricesPeriod(c *gin.Context) {
|
|||
|
||||
// createLabel godoc
|
||||
//
|
||||
// @Summary Создать новую метку для товара
|
||||
// @Description Создать новую метку для товара
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body LabelDTO true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels [post]
|
||||
// @Summary Создать новую метку для товара
|
||||
// @Description Создать новую метку для товара
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body LabelDTO true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels [post]
|
||||
func (co *controller) createLabel(c *gin.Context) {
|
||||
var payload LabelDTO
|
||||
if err := c.ShouldBindJSON(&payload); err != nil {
|
||||
|
|
@ -512,16 +512,16 @@ func (co *controller) createLabel(c *gin.Context) {
|
|||
|
||||
// getLabels godoc
|
||||
//
|
||||
// @Summary Получить все метки товаров
|
||||
// @Description Получить все метки товаров
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Produce json
|
||||
// @Success 200 {array} LabelsList
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels [get]
|
||||
// @Summary Получить все метки товаров
|
||||
// @Description Получить все метки товаров
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Produce json
|
||||
// @Success 200 {array} LabelsList
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels [get]
|
||||
func (co *controller) getLabels(c *gin.Context) {
|
||||
response, err := co.service.getLabels(c, getUserId(c))
|
||||
if err != nil {
|
||||
|
|
@ -535,18 +535,18 @@ func (co *controller) getLabels(c *gin.Context) {
|
|||
|
||||
// updateLabel godoc
|
||||
//
|
||||
// @Summary Изменить метку
|
||||
// @Description Изменить метку
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param uuid path string true "label uuid"
|
||||
// @Param payload body LabelDTO true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/{uuid} [put]
|
||||
// @Summary Изменить метку
|
||||
// @Description Изменить метку
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param uuid path string true "label uuid"
|
||||
// @Param payload body LabelDTO true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/{uuid} [put]
|
||||
func (co *controller) updateLabel(c *gin.Context) {
|
||||
labelUuid := c.Param("uuid")
|
||||
if labelUuid == "" {
|
||||
|
|
@ -573,16 +573,16 @@ func (co *controller) updateLabel(c *gin.Context) {
|
|||
|
||||
// deleteLabel godoc
|
||||
//
|
||||
// @Summary Пометить метку как удаленную
|
||||
// @Description Пометить метку как удаленную
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Param uuid path string true "label uuid"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/{uuid} [delete]
|
||||
// @Summary Пометить метку как удаленную
|
||||
// @Description Пометить метку как удаленную
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Param uuid path string true "label uuid"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/{uuid} [delete]
|
||||
func (co *controller) deleteLabel(c *gin.Context) {
|
||||
labelUuid := c.Param("uuid")
|
||||
if labelUuid == "" {
|
||||
|
|
@ -602,17 +602,17 @@ func (co *controller) deleteLabel(c *gin.Context) {
|
|||
|
||||
// attachLabel godoc
|
||||
//
|
||||
// @Summary Прикрепить метку к товару
|
||||
// @Description Прикрепить метку к товару
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body LabelLink true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/attach [post]
|
||||
// @Summary Прикрепить метку к товару
|
||||
// @Description Прикрепить метку к товару
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body LabelLink true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/attach [post]
|
||||
func (co *controller) attachLabel(c *gin.Context) {
|
||||
var payload LabelLink
|
||||
if err := c.ShouldBindJSON(&payload); err != nil {
|
||||
|
|
@ -631,17 +631,17 @@ func (co *controller) attachLabel(c *gin.Context) {
|
|||
|
||||
// detachLabel godoc
|
||||
//
|
||||
// @Summary Удалить привязку метки к товару
|
||||
// @Description Удалить привязку метки к товару
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body LabelLink true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/detach [post]
|
||||
// @Summary Удалить привязку метки к товару
|
||||
// @Description Удалить привязку метки к товару
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Accept json
|
||||
// @Param payload body LabelLink true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/detach [post]
|
||||
func (co *controller) detachLabel(c *gin.Context) {
|
||||
var payload LabelLink
|
||||
if err := c.ShouldBindJSON(&payload); err != nil {
|
||||
|
|
@ -661,17 +661,17 @@ func (co *controller) detachLabel(c *gin.Context) {
|
|||
|
||||
// getMerchLabels godoc
|
||||
//
|
||||
// @Summary Получить метки товара по его uuid
|
||||
// @Description Получить метки товара по его uuid
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Produce json
|
||||
// @Param uuid path string true "label uuid"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/{uuid} [get]
|
||||
// @Summary Получить метки товара по его uuid
|
||||
// @Description Получить метки товара по его uuid
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// @Produce json
|
||||
// @Param uuid path string true "label uuid"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.BadRequest
|
||||
// @Failure 401 {object} responses.Unauthorized
|
||||
// @Failure 500 {object} responses.InternalServerError
|
||||
// @Router /merch/labels/{uuid} [get]
|
||||
func (co *controller) getMerchLabels(c *gin.Context) {
|
||||
merchUuid := c.Param("uuid")
|
||||
if merchUuid == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue