This commit is contained in:
parent
2728051fde
commit
7fa79d770a
4 changed files with 114 additions and 54 deletions
29
docs/docs.go
29
docs/docs.go
|
|
@ -106,6 +106,9 @@ const docTemplate = `{
|
|||
}
|
||||
],
|
||||
"description": "Обновить информацию про мерч по его uuid в json-е",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch"
|
||||
],
|
||||
|
|
@ -331,6 +334,9 @@ const docTemplate = `{
|
|||
}
|
||||
],
|
||||
"description": "Создать новую метку для товара",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -373,6 +379,9 @@ const docTemplate = `{
|
|||
}
|
||||
],
|
||||
"description": "Прикрепить метку к товару",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -415,6 +424,9 @@ const docTemplate = `{
|
|||
}
|
||||
],
|
||||
"description": "Удалить привязку метки к товару",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -498,6 +510,9 @@ const docTemplate = `{
|
|||
}
|
||||
],
|
||||
"description": "Изменить метку",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -623,6 +638,9 @@ const docTemplate = `{
|
|||
}
|
||||
],
|
||||
"description": "Пометить нулевые цены как удаленные",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch zero prices"
|
||||
],
|
||||
|
|
@ -1160,13 +1178,13 @@ const docTemplate = `{
|
|||
"merch.DeleteZeroPrices": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"merch_uuids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"merch_uuid": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"merch.ImageLink": {
|
||||
"type": "object",
|
||||
|
|
@ -1342,6 +1360,9 @@ const docTemplate = `{
|
|||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"merch_uuid": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -98,6 +98,9 @@
|
|||
}
|
||||
],
|
||||
"description": "Обновить информацию про мерч по его uuid в json-е",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch"
|
||||
],
|
||||
|
|
@ -323,6 +326,9 @@
|
|||
}
|
||||
],
|
||||
"description": "Создать новую метку для товара",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -365,6 +371,9 @@
|
|||
}
|
||||
],
|
||||
"description": "Прикрепить метку к товару",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -407,6 +416,9 @@
|
|||
}
|
||||
],
|
||||
"description": "Удалить привязку метки к товару",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -490,6 +502,9 @@
|
|||
}
|
||||
],
|
||||
"description": "Изменить метку",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch labels"
|
||||
],
|
||||
|
|
@ -615,6 +630,9 @@
|
|||
}
|
||||
],
|
||||
"description": "Пометить нулевые цены как удаленные",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Merch zero prices"
|
||||
],
|
||||
|
|
@ -1152,13 +1170,13 @@
|
|||
"merch.DeleteZeroPrices": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"merch_uuids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"merch_uuid": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"merch.ImageLink": {
|
||||
"type": "object",
|
||||
|
|
@ -1334,6 +1352,9 @@
|
|||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"merch_uuid": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ definitions:
|
|||
type: object
|
||||
merch.DeleteZeroPrices:
|
||||
properties:
|
||||
merch_uuids:
|
||||
items:
|
||||
id:
|
||||
type: integer
|
||||
merch_uuid:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
merch.ImageLink:
|
||||
properties:
|
||||
|
|
@ -126,6 +126,8 @@ definitions:
|
|||
properties:
|
||||
created_at:
|
||||
type: string
|
||||
id:
|
||||
type: integer
|
||||
merch_uuid:
|
||||
type: string
|
||||
name:
|
||||
|
|
@ -254,6 +256,8 @@ paths:
|
|||
tags:
|
||||
- Merch
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Обновить информацию про мерч по его uuid в json-е
|
||||
parameters:
|
||||
- description: merch_uuid
|
||||
|
|
@ -453,6 +457,8 @@ paths:
|
|||
tags:
|
||||
- Merch labels
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Создать новую метку для товара
|
||||
parameters:
|
||||
- description: payload
|
||||
|
|
@ -529,6 +535,8 @@ paths:
|
|||
tags:
|
||||
- Merch labels
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Изменить метку
|
||||
parameters:
|
||||
- description: label uuid
|
||||
|
|
@ -560,6 +568,8 @@ paths:
|
|||
- Merch labels
|
||||
/merch/labels/attach:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Прикрепить метку к товару
|
||||
parameters:
|
||||
- description: payload
|
||||
|
|
@ -586,6 +596,8 @@ paths:
|
|||
- Merch labels
|
||||
/merch/labels/detach:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Удалить привязку метки к товару
|
||||
parameters:
|
||||
- description: payload
|
||||
|
|
@ -612,6 +624,8 @@ paths:
|
|||
- Merch labels
|
||||
/merch/zeroprices:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Пометить нулевые цены как удаленные
|
||||
parameters:
|
||||
- description: payload
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ func (co *controller) getAllMerch(c *gin.Context) {
|
|||
// @Description Обновить информацию про мерч по его uuid в json-е
|
||||
// @Tags Merch
|
||||
// @Security BearerAuth
|
||||
// Accept json
|
||||
// @Accept json
|
||||
// @Param body body UpdateMerchDTO true "merch_uuid"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
|
|
@ -182,6 +182,7 @@ func (co *controller) updateMerch(c *gin.Context) {
|
|||
log.WithError(err).Error("Merch | Failed to get single merch")
|
||||
return
|
||||
}
|
||||
c.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
// @Summary Пометить мерч как удаленный
|
||||
|
|
@ -192,6 +193,7 @@ func (co *controller) updateMerch(c *gin.Context) {
|
|||
// @Success 200 {object} MerchDTO
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
// @Failure 500 {object} responses.ErrorResponse500
|
||||
//
|
||||
// @Router /merch/{uuid} [delete]
|
||||
func (co *controller) deleteMerch(c *gin.Context) {
|
||||
merchUuid := c.Param("uuid")
|
||||
|
|
@ -226,6 +228,10 @@ func (co *controller) deleteMerch(c *gin.Context) {
|
|||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
// @Failure 500 {object} responses.ErrorResponse500
|
||||
// @Router /prices [get]
|
||||
//
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
// @Failure 500 {object} responses.ErrorResponse500
|
||||
// @Router /prices [get]
|
||||
func (co *controller) getChartsPrices(c *gin.Context) {
|
||||
daysQuery := strings.ToLower(c.DefaultQuery("days", ""))
|
||||
|
||||
|
|
@ -338,7 +344,6 @@ func (co *controller) uploadMerchImage(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
//c.Status(http.StatusOK)
|
||||
c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
||||
|
|
@ -393,7 +398,6 @@ func (co *controller) getMerchImage(c *gin.Context) {
|
|||
//}
|
||||
//
|
||||
//c.JSON(http.StatusOK, link)
|
||||
c.JSON(http.StatusNotImplemented, gin.H{"msg": "Method deprecated. Request images from image storage."})
|
||||
}
|
||||
|
||||
// @Summary Удалить (безвозвратно) картинки по merch_uuid
|
||||
|
|
@ -438,7 +442,7 @@ func (co *controller) deleteMerchImage(c *gin.Context) {
|
|||
// @Description Создать новую метку для товара
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// Accept json
|
||||
// @Accept json
|
||||
// @Param payload body LabelDTO true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
|
|
@ -503,7 +507,7 @@ func (co *controller) getLabels(c *gin.Context) {
|
|||
// @Description Изменить метку
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// Accept json
|
||||
// @Accept json
|
||||
// @Param uuid path string true "label uuid"
|
||||
// @Param payload body LabelDTO true "payload"
|
||||
// @Success 200
|
||||
|
|
@ -580,7 +584,7 @@ func (co *controller) deleteLabel(c *gin.Context) {
|
|||
// @Description Прикрепить метку к товару
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// Accept json
|
||||
// @Accept json
|
||||
// @Param payload body LabelLink true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
|
|
@ -615,7 +619,7 @@ func (co *controller) attachLabel(c *gin.Context) {
|
|||
// @Description Удалить привязку метки к товару
|
||||
// @Tags Merch labels
|
||||
// @Security BearerAuth
|
||||
// Accept json
|
||||
// @Accept json
|
||||
// @Param payload body LabelLink true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
|
|
@ -715,7 +719,7 @@ func (co *controller) getZeroPrices(c *gin.Context) {
|
|||
// @Description Пометить нулевые цены как удаленные
|
||||
// @Tags Merch zero prices
|
||||
// @Security BearerAuth
|
||||
// Accept json
|
||||
// @Accept json
|
||||
// @Param payload body DeleteZeroPrices true "payload"
|
||||
// @Success 200
|
||||
// @Failure 400 {object} responses.ErrorResponse400
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue