mirror of
https://github.com/kwinH/fastApi.git
synced 2025-12-24 13:07:58 +08:00
189 lines
5.9 KiB
JSON
189 lines
5.9 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "这里写描述信息",
|
|
"title": "fastApi接口文档",
|
|
"contact": {},
|
|
"version": "1.0"
|
|
},
|
|
"host": "http://localhost:3000",
|
|
"basePath": "/api/v1",
|
|
"paths": {
|
|
"/user/login": {
|
|
"post": {
|
|
"description": "用户登录接口2",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"用户相关接口"
|
|
],
|
|
"summary": "用户登录接口1",
|
|
"parameters": [
|
|
{
|
|
"maxLength": 40,
|
|
"minLength": 8,
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"minLength": 5,
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "user_name",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.UserResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/user/register": {
|
|
"post": {
|
|
"description": "用户注册接口",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"用户相关接口"
|
|
],
|
|
"summary": "用户注册接口",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户令牌",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"minLength": 2,
|
|
"type": "string",
|
|
"description": "昵称",
|
|
"name": "nickname",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 40,
|
|
"minLength": 8,
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 40,
|
|
"minLength": 8,
|
|
"type": "string",
|
|
"description": "确认密码",
|
|
"name": "password_confirm",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"minLength": 5,
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "user_name",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/response.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"response.Response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"description": "Code 0正确",
|
|
"type": "integer"
|
|
},
|
|
"data": {},
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"msg": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"response.User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"avatar": {
|
|
"description": "头像",
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"description": "注册时间",
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"description": "ID",
|
|
"type": "integer"
|
|
},
|
|
"nickname": {
|
|
"description": "昵称",
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"description": "状态",
|
|
"type": "string"
|
|
},
|
|
"user_name": {
|
|
"description": "用户名",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"response.UserResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"description": "Code 0正确",
|
|
"type": "integer"
|
|
},
|
|
"data": {
|
|
"$ref": "#/definitions/response.User"
|
|
},
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"msg": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |