Init: lab4 done

This commit is contained in:
2025-11-07 05:26:09 +08:00
commit b55f254d82
23 changed files with 1140 additions and 0 deletions

97
docs/swagger.json Normal file
View File

@@ -0,0 +1,97 @@
{
"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"
}
}
}
}
}