bbs/app/http/swagger/swagger.json

610 lines
18 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"swagger": "2.0",
"info": {
"description": "这个模块负责显示hade的接口",
"title": "hade",
"termsOfService": "https://github.com/swaggo/swag",
"contact": {
"name": "yejianfeng1",
"email": "yejianfeng"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.1"
},
"basePath": "/",
"paths": {
"/answer/create": {
"post": {
"description": "创建回答",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"qa"
],
"summary": "创建回答",
"parameters": [
{
"description": "创建回答参数",
"name": "answerCreateParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/qa.answerCreateParam"
}
}
],
"responses": {
"200": {
"description": "操作成功",
"schema": {
"type": "string"
}
}
}
}
},
"/answer/delete": {
"post": {
"description": "创建回答",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"qa"
],
"summary": "创建回答",
"parameters": [
{
"description": "删除id",
"name": "answerDeleteParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/qa.answerDeleteParam"
}
}
],
"responses": {
"200": {
"description": "操作成功",
"schema": {
"type": "string"
}
}
}
}
},
"/question/create": {
"post": {
"description": "创建问题",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"qa"
],
"summary": "创建问题",
"parameters": [
{
"description": "创建问题参数",
"name": "questionCreateParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/qa.questionCreateParam"
}
}
],
"responses": {
"200": {
"description": "操作成功",
"schema": {
"type": "string"
}
}
}
}
},
"/question/delete": {
"post": {
"description": "删除问题,同时删除问题中的所有答案",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"qa"
],
"summary": "删除问题",
"parameters": [
{
"description": "删除id",
"name": "questionDeleteParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/qa.questionDeleteParam"
}
}
],
"responses": {
"200": {
"description": "操作成功",
"schema": {
"type": "string"
}
}
}
}
},
"/question/detail": {
"post": {
"description": "获取问题详情,包括问题的所有回答",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"qa"
],
"summary": "获取问题详细",
"parameters": [
{
"description": "问题id",
"name": "questionDetailParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/qa.questionDetailParam"
}
}
],
"responses": {
"200": {
"description": "问题详情,带回答和作者",
"schema": {
"type": "QuestionDTO"
}
}
}
}
},
"/question/edit": {
"post": {
"description": "编辑问题",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"qa"
],
"summary": "编辑问题",
"parameters": [
{
"description": "编辑问题参数",
"name": "questionEditParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/qa.questionEditParam"
}
}
],
"responses": {
"200": {
"description": "操作成功",
"schema": {
"type": "string"
}
}
}
}
},
"/question/list": {
"post": {
"description": "获取问题列表,包含作者信息,不包含回答",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"qa"
],
"summary": "获取问题列表",
"parameters": [
{
"description": "分页查询的参数",
"name": "questionListParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/qa.questionListParam"
}
}
],
"responses": {
"200": {
"description": "问题列表",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/qa.QuestionDTO"
}
}
}
}
}
},
"/user/login": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "用户登录",
"parameters": [
{
"description": "login with param",
"name": "loginParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.loginParam"
}
}
],
"responses": {
"200": {
"description": "token",
"schema": {
"type": "string"
}
}
}
}
},
"/user/logout": {
"get": {
"description": "调用表示用户登出",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "用户登出",
"responses": {
"200": {
"description": "用户登出成功",
"schema": {
"type": "string"
}
}
}
}
},
"/user/register": {
"post": {
"description": "用户注册接口",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "用户注册",
"parameters": [
{
"description": "注册参数",
"name": "registerParam",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.registerParam"
}
}
],
"responses": {
"200": {
"description": "注册成功",
"schema": {
"type": "string"
}
}
}
}
},
"/user/register/verify": {
"get": {
"description": "使用token验证用户注册信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "验证注册信息",
"parameters": [
{
"type": "string",
"description": "注册token",
"name": "token",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "注册成功,请进入登录页面",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"qa.AnswerDTO": {
"type": "object",
"properties": {
"author": {
"description": "作者",
"allOf": [
{
"$ref": "#/definitions/user.UserDTO"
}
]
},
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
}
},
"qa.QuestionDTO": {
"type": "object",
"properties": {
"answer_num": {
"type": "integer"
},
"answers": {
"description": "回答",
"type": "array",
"items": {
"$ref": "#/definitions/qa.AnswerDTO"
}
},
"author": {
"description": "作者",
"allOf": [
{
"$ref": "#/definitions/user.UserDTO"
}
]
},
"context": {
"description": "在列表页只显示前200个字符",
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"title": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"qa.answerCreateParam": {
"type": "object",
"required": [
"context",
"questionId"
],
"properties": {
"context": {
"type": "string"
},
"questionId": {
"type": "integer"
}
}
},
"qa.answerDeleteParam": {
"type": "object",
"required": [
"answerId"
],
"properties": {
"answerId": {
"type": "integer"
}
}
},
"qa.questionCreateParam": {
"type": "object",
"required": [
"content",
"title"
],
"properties": {
"content": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"qa.questionDeleteParam": {
"type": "object",
"required": [
"questionId"
],
"properties": {
"questionId": {
"type": "integer"
}
}
},
"qa.questionDetailParam": {
"type": "object",
"required": [
"questionId"
],
"properties": {
"questionId": {
"type": "integer"
}
}
},
"qa.questionEditParam": {
"type": "object",
"required": [
"content",
"id",
"title"
],
"properties": {
"content": {
"type": "string"
},
"id": {
"type": "integer"
},
"title": {
"type": "string"
}
}
},
"qa.questionListParam": {
"type": "object",
"required": [
"size",
"start"
],
"properties": {
"size": {
"type": "integer"
},
"start": {
"type": "integer"
}
}
},
"user.UserDTO": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"user_name": {
"type": "string"
}
}
},
"user.loginParam": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"password": {
"type": "string",
"minLength": 6
},
"username": {
"type": "string"
}
}
},
"user.registerParam": {
"type": "object",
"required": [
"email",
"password",
"username"
],
"properties": {
"email": {
"type": "string",
"minLength": 6
},
"password": {
"type": "string",
"minLength": 6
},
"username": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
},
"BasicAuth": {
"type": "basic"
}
},
"x-extension-openapi": {
"example": "value on a json format"
}
}