281 lines
6.0 KiB
JSON
281 lines
6.0 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "service_user.proto",
|
|
"version": "version not set"
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "User"
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"paths": {
|
|
"/user/answer_question": {
|
|
"post": {
|
|
"operationId": "User_AnswerQuestion",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/AnswerQuestionResp"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/AnswerQuestionReq"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"User"
|
|
]
|
|
}
|
|
},
|
|
"/user/generate_question": {
|
|
"post": {
|
|
"operationId": "User_GenerateQuestion",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/GenerateQuestionResp"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GenerateQuestionReq"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"User"
|
|
]
|
|
}
|
|
},
|
|
"/user/get_question": {
|
|
"post": {
|
|
"operationId": "User_GetQuestion",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/GetQuestionResp"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GetQuestionReq"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"User"
|
|
]
|
|
}
|
|
},
|
|
"/user/info": {
|
|
"post": {
|
|
"operationId": "User_GetUserInfo",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/GetUserInfoResp"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GetUserInfoReq"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"User"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"AnswerQuestionReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"sn": {
|
|
"type": "string",
|
|
"title": "题目唯一标识"
|
|
},
|
|
"answer": {
|
|
"type": "string",
|
|
"title": "答案"
|
|
}
|
|
},
|
|
"title": "---------- AnswerQuestion ----------"
|
|
},
|
|
"AnswerQuestionResp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"answer": {
|
|
"type": "string",
|
|
"title": "答案"
|
|
},
|
|
"explanation": {
|
|
"type": "string",
|
|
"title": "解析"
|
|
}
|
|
}
|
|
},
|
|
"GenerateQuestionReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"num": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"title": "生成数量"
|
|
},
|
|
"category": {
|
|
"type": "string",
|
|
"title": "题目类型"
|
|
}
|
|
},
|
|
"title": "---------- GenerateQuestion ----------"
|
|
},
|
|
"GenerateQuestionResp": {
|
|
"type": "object"
|
|
},
|
|
"GetQuestionReq": {
|
|
"type": "object",
|
|
"title": "---------- GetQuestion ----------"
|
|
},
|
|
"GetQuestionResp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"sn": {
|
|
"type": "string",
|
|
"title": "题目唯一标识"
|
|
},
|
|
"question": {
|
|
"type": "string",
|
|
"title": "题干"
|
|
},
|
|
"options": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"title": "选项"
|
|
}
|
|
}
|
|
},
|
|
"GetUserInfoReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"usn": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"title": "---------- GetUserInfo ----------"
|
|
},
|
|
"GetUserInfoResp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"usn": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"LoginResp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"usn": {
|
|
"type": "string",
|
|
"title": "用户ID"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"title": "用户名"
|
|
}
|
|
}
|
|
},
|
|
"protobufAny": {
|
|
"type": "object",
|
|
"properties": {
|
|
"@type": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": {}
|
|
},
|
|
"rpcStatus": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"details": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/protobufAny"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|