97 lines
2.6 KiB
JSON
97 lines
2.6 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "Golang Lab4",
|
|
"termsOfService": "http://swagger.io/terms",
|
|
"contact": {},
|
|
"license": {
|
|
"name": "0BSD"
|
|
},
|
|
"version": "0.0.1-rc1"
|
|
},
|
|
"basePath": "/",
|
|
"paths": {
|
|
"/url": {
|
|
"get": {
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "url",
|
|
"name": "url",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.UrlState"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"description": "query params",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handlers.PostUrlInput"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "url",
|
|
"name": "url",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"handlers.PostUrlInput": {
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.UrlState": {
|
|
"type": "object",
|
|
"properties": {
|
|
"isSuccess": {
|
|
"type": "boolean"
|
|
},
|
|
"latency": {
|
|
"type": "integer"
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |