Skip to content

Instantly share code, notes, and snippets.

@btshft
Created June 18, 2020 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btshft/766a12398f4cb92916d801ce26f8c2f4 to your computer and use it in GitHub Desktop.
Save btshft/766a12398f4cb92916d801ce26f8c2f4 to your computer and use it in GitHub Desktop.
api schema
{
"openapi": "3.0.1",
"info": {
"title": "Counter API Service",
"version": "v1"
},
"paths": {
"/api/Counters/trades/{key}": {
"get": {
"tags": [
"Counters"
],
"summary": "Получить счётчики для закупки по ключу",
"parameters": [
{
"name": "key",
"in": "path",
"description": "ключ",
"required": true,
"schema": {
"type": "string",
"description": "ключ",
"nullable": true,
"example": "mykey:123"
}
}
],
"responses": {
"200": {
"description": "DTO объект со счётчиками",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CounterApi.Features.NotificationCounters.Models.TradeLotCounterResponse"
}
}
}
}
}
}
},
"/api/Counters/trades/map": {
"post": {
"tags": [
"Counters"
],
"summary": "Получить k-v список счётчики для закупок по списку ключей",
"requestBody": {
"description": "список ключей",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
},
"description": "список ключей",
"nullable": true
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
},
"description": "список ключей",
"nullable": true
}
},
"application/*+json": {
"schema": {
"type": "array",
"items": {
"type": "string"
},
"description": "список ключей",
"nullable": true
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/CounterApi.Features.NotificationCounters.Models.TradeLotCounterResponse"
}
}
}
}
}
}
}
},
"/api/Counters/{key}/increment": {
"post": {
"tags": [
"Counters"
],
"summary": "Увеличить счётчик по ключу",
"parameters": [
{
"name": "key",
"in": "path",
"description": "ключ",
"required": true,
"schema": {
"type": "string",
"description": "ключ",
"nullable": true,
"example": "mykey:123"
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/api/Counters/unique/by-source-id/{key}/increment": {
"post": {
"tags": [
"Counters"
],
"summary": "Увеличить счётчик по ключу {key} один раз для каждого уникального {sourceId}",
"description": "Счётчик по ключу {key} будет увеличен только если {sourceId} до этого никогда не увеличивал этот счётчик",
"parameters": [
{
"name": "key",
"in": "path",
"description": "ключ",
"required": true,
"schema": {
"type": "string",
"description": "ключ",
"nullable": true,
"example": "mykey:123"
}
}
],
"requestBody": {
"description": "ID источника",
"content": {
"application/json": {
"schema": {
"type": "string",
"description": "ID источника",
"nullable": true
}
},
"text/json": {
"schema": {
"type": "string",
"description": "ID источника",
"nullable": true
}
},
"application/*+json": {
"schema": {
"type": "string",
"description": "ID источника",
"nullable": true
}
}
}
},
"responses": {
"200": {
"description": "Success"
}
}
}
}
},
"components": {
"schemas": {
"CounterApi.Features.NotificationCounters.Models.TradeLotCounterResponse": {
"type": "object",
"properties": {
"documentDonwloadCount": {
"type": "integer",
"description": "Количество скачиваний документов",
"format": "int32",
"example": 15
},
"viewCount": {
"type": "integer",
"description": "Количество просмотров закупки",
"format": "int32",
"example": 23
}
},
"additionalProperties": false,
"description": "DTO-объект со счтчиками"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment