2024-07-14 14:29:59 +00:00
|
|
|
{
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
|
|
|
"description": "This is a sample server celler server.",
|
|
|
|
"title": "Swagger Example API",
|
|
|
|
"termsOfService": "http://swagger.io/terms/",
|
|
|
|
"contact": {
|
|
|
|
"name": "API Support",
|
|
|
|
"url": "http://www.swagger.io/support",
|
|
|
|
"email": "support@swagger.io"
|
|
|
|
},
|
|
|
|
"license": {
|
|
|
|
"name": "Apache 2.0",
|
|
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
|
|
},
|
|
|
|
"version": "1.0"
|
|
|
|
},
|
|
|
|
"host": "localhost:8080",
|
2024-07-14 17:22:40 +00:00
|
|
|
"basePath": "/api/v1",
|
2024-07-14 14:29:59 +00:00
|
|
|
"paths": {
|
2024-07-14 17:22:40 +00:00
|
|
|
"/library": {
|
2024-07-14 14:29:59 +00:00
|
|
|
"get": {
|
2024-07-14 17:22:40 +00:00
|
|
|
"summary": "获取当前用户的资料库",
|
2024-07-14 14:29:59 +00:00
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
2024-07-14 17:22:40 +00:00
|
|
|
"$ref": "#/definitions/models.ListLibraryResponse"
|
2024-07-14 14:29:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-14 17:22:40 +00:00
|
|
|
},
|
|
|
|
"post": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiKeyAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"summary": "创建一个资料库",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/models.CreateLibraryResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/user": {
|
|
|
|
"get": {
|
|
|
|
"summary": "获取当前用户的请求",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/models.CurrentUserResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-14 14:29:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
2024-07-14 17:22:40 +00:00
|
|
|
"ent.Library": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"created_at": {
|
|
|
|
"description": "CreatedAt holds the value of the \"created_at\" field.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"description": "ID of the ent.",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"description": "Name holds the value of the \"name\" field.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"updated_at": {
|
|
|
|
"description": "UpdatedAt holds the value of the \"updated_at\" field.",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"user_id": {
|
|
|
|
"description": "UserID holds the value of the \"user_id\" field.",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"models.CreateLibraryResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"library": {
|
|
|
|
"$ref": "#/definitions/ent.Library"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-14 14:29:59 +00:00
|
|
|
"models.CurrentUserResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"ip": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"userEmail": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"userId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"valid": {
|
|
|
|
"type": "boolean"
|
|
|
|
}
|
|
|
|
}
|
2024-07-14 17:22:40 +00:00
|
|
|
},
|
|
|
|
"models.ListLibraryResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"libraries": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/ent.Library"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-14 14:29:59 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"securityDefinitions": {
|
|
|
|
"ApiKeyAuth": {
|
|
|
|
"description": "Description for what is this security definition being used",
|
|
|
|
"type": "apiKey",
|
|
|
|
"name": "Authorization",
|
|
|
|
"in": "header"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|