- 文件分析
- 知识库管理
- 工作流
- MCP管理
- 数据库开发
- mineruPOST
all
开发中
开发环境
http://172.29.50.10:2333
开发环境
http://172.29.50.10:2333
POST
/sql_run_and_draw
此接口输入数据库config以及执行语句,返回结果以及图数据#
请求参数
Body 参数application/json
database_config
object
必需
type
string
必需
url
string
必需
port
string
必需
user
string
必需
password
string
必需
database
string
必需
text
string
自然语言
sql_code
string
SQL语句
示例
{
"database_config": {
"type": "mysql",
"url": "172.29.50.10",
"port": "3306",
"user": "root",
"password": "root",
"database": "DB_sql_test"
},
"text": "找到名字为李红梅的人,要求返回名字、id、性别、地址"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'http://172.29.50.10:2333/sql_run_and_draw' \
--header 'Content-Type: application/json' \
--data-raw '{
"database_config": {
"type": "mysql",
"url": "172.29.50.10",
"port": "3306",
"user": "root",
"password": "root",
"database": "DB_sql_test"
},
"text": "找到名字为李红梅的人,要求返回名字、id、性别、地址"
}'
返回响应
🟢200成功
application/json
Body
charts
array[string]
图数据列表
message
string
必需
sql_result
object
必需
data
object
必需
metadata
object
必需
status
string
必需
status
string
必需
示例
{
"charts": ["\n <div><!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <title>Awesome-pyecharts</title>\n <script type=\"text/javascript\" src=\"https://assets.pyecharts.org/assets/v5/echarts.min.js\"></script>\n\n \n</head>\n<body >\n <div id=\"chart_861afdcded854b57876a7102ea53f0a7\" class=\"chart-container\" style=\"width:600px; height:400px; \"></div>\n <script>\n var chart_chart_861afdcded854b57876a7102ea53f0a7 = echarts.init(\n document.getElementById('chart_861afdcded854b57876a7102ea53f0a7'), 'white', {renderer: 'canvas'});\n var option_chart_861afdcded854b57876a7102ea53f0a7 = {\n \"animation\": true,\n \"animationThreshold\": 2000,\n \"animationDuration\": 1000,\n \"animationEasing\": \"cubicOut\",\n \"animationDelay\": 0,\n \"animationDurationUpdate\": 300,\n \"animationEasingUpdate\": \"cubicOut\",\n \"animationDelayUpdate\": 0,\n \"aria\": {\n \"enabled\": false\n },\n \"color\": [\n \"#5470c6\",\n \"#91cc75\",\n \"#fac858\",\n \"#ee6666\",\n \"#73c0de\",\n \"#3ba272\",\n \"#fc8452\",\n \"#9a60b4\",\n \"#ea7ccc\"\n ],\n \"series\": [\n {\n \"type\": \"pie\",\n \"colorBy\": \"data\",\n \"legendHoverLink\": true,\n \"selectedMode\": false,\n \"selectedOffset\": 10,\n \"clockwise\": true,\n \"startAngle\": 90,\n \"minAngle\": 0,\n \"minShowLabelAngle\": 0,\n \"avoidLabelOverlap\": true,\n \"stillShowZeroSum\": true,\n \"percentPrecision\": 2,\n \"showEmptyCircle\": true,\n \"emptyCircleStyle\": {\n \"color\": \"lightgray\",\n \"borderColor\": \"#000\",\n \"borderWidth\": 0,\n \"borderType\": \"solid\",\n \"borderDashOffset\": 0,\n \"borderCap\": \"butt\",\n \"borderJoin\": \"bevel\",\n \"borderMiterLimit\": 10,\n \"opacity\": 1\n },\n \"data\": [\n {\n \"name\": \"\男\",\n \"value\": 16\n },\n {\n \"name\": \"\女\",\n \"value\": 24\n }\n ],\n \"radius\": [\n \"0%\",\n \"75%\"\n ],\n \"center\": [\n \"50%\",\n \"50%\"\n ],\n \"label\": {\n \"show\": true,\n \"margin\": 8,\n \"formatter\": \"{b}: {c}\",\n \"valueAnimation\": false\n },\n \"labelLine\": {\n \"show\": true,\n \"showAbove\": false,\n \"length\": 15,\n \"length2\": 15,\n \"smooth\": false,\n \"minTurnAngle\": 90,\n \"maxSurfaceAngle\": 90\n },\n \"rippleEffect\": {\n \"show\": true,\n \"brushType\": \"stroke\",\n \"scale\": 2.5,\n \"period\": 4\n }\n }\n ],\n \"legend\": [\n {\n \"data\": [\n \"\男\",\n \"\女\"\n ],\n \"selected\": {},\n \"show\": true,\n \"padding\": 5,\n \"itemGap\": 10,\n \"itemWidth\": 25,\n \"itemHeight\": 14,\n \"backgroundColor\": \"transparent\",\n \"borderColor\": \"#ccc\",\n \"borderRadius\": 0,\n \"pageButtonItemGap\": 5,\n \"pageButtonPosition\": \"end\",\n \"pageFormatter\": \"{current}/{total}\",\n \"pageIconColor\": \"#2f4554\",\n \"pageIconInactiveColor\": \"#aaa\",\n \"pageIconSize\": 15,\n \"animationDurationUpdate\": 800,\n \"selector\": false,\n \"selectorPosition\": \"auto\",\n \"selectorItemGap\": 7,\n \"selectorButtonGap\": 10\n }\n ],\n \"tooltip\": {\n \"show\": true,\n \"trigger\": \"item\",\n \"triggerOn\": \"mousemove|click\",\n \"axisPointer\": {\n \"type\": \"line\"\n },\n \"showContent\": true,\n \"alwaysShowContent\": false,\n \"showDelay\": 0,\n \"hideDelay\": 100,\n \"enterable\": false,\n \"confine\": false,\n \"appendToBody\": false,\n \"transitionDuration\": 0.4,\n \"textStyle\": {\n \"fontSize\": 14\n },\n \"borderWidth\": 0,\n \"padding\": 5,\n \"order\": \"seriesAsc\"\n },\n \"title\": [\n {\n \"show\": true,\n \"text\": \"\性\别\分\布\",\n \"target\": \"blank\",\n \"subtarget\": \"blank\",\n \"padding\": 5,\n \"itemGap\": 10,\n \"textAlign\": \"auto\",\n \"textVerticalAlign\": \"auto\",\n \"triggerEvent\": false\n }\n ]\n};\n chart_chart_861afdcded854b57876a7102ea53f0a7.setOption(option_chart_861afdcded854b57876a7102ea53f0a7);\n </script>\n</body>\n</html>\n</div>\n <script src=\"https://assets.pyecharts.org/assets/v5/echarts.min.js\"></script>\n ","\n <div><!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <title>Awesome-pyecharts</title>\n <script type=\"text/javascript\" src=\"https://assets.pyecharts.org/assets/v5/echarts.min.js\"></script>\n\n \n</head>\n<body >\n <div id=\"chart_13bfcb833139422f9a545678364d725b\" class=\"chart-container\" style=\"width:600px; height:400px; \"></div>\n <script>\n var chart_chart_13bfcb833139422f9a545678364d725b = echarts.init(\n document.getElementById('chart_13bfcb833139422f9a545678364d725b'), 'white', {renderer: 'canvas'});\n var option_chart_13bfcb833139422f9a545678364d725b = {\n \"animation\": true,\n \"animationThreshold\": 2000,\n \"animationDuration\": 1000,\n \"animationEasing\": \"cubicOut\",\n \"animationDelay\": 0,\n \"animationDurationUpdate\": 300,\n \"animationEasingUpdate\": \"cubicOut\",\n \"animationDelayUpdate\": 0,\n \"aria\": {\n \"enabled\": false\n },\n \"color\": [\n \"#5470c6\",\n \"#91cc75\",\n \"#fac858\",\n \"#ee6666\",\n \"#73c0de\",\n \"#3ba272\",\n \"#fc8452\",\n \"#9a60b4\",\n \"#ea7ccc\"\n ],\n \"series\": [\n {\n \"type\": \"bar\",\n \"legendHoverLink\": true,\n \"data\": [\n 8,\n 7,\n 13,\n 12\n ],\n \"realtimeSort\": false,\n \"showBackground\": false,\n \"stackStrategy\": \"samesign\",\n \"cursor\": \"pointer\",\n \"barMinHeight\": 0,\n \"barCategoryGap\": \"20%\",\n \"barGap\": \"30%\",\n \"large\": false,\n \"largeThreshold\": 400,\n \"seriesLayoutBy\": \"column\",\n \"datasetIndex\": 0,\n \"clip\": true,\n \"zlevel\": 0,\n \"z\": 2,\n \"label\": {\n \"show\": true,\n \"margin\": 8,\n \"valueAnimation\": false\n }\n }\n ],\n \"legend\": [\n {\n \"data\": [\n \"\"\n ],\n \"selected\": {},\n \"show\": true,\n \"padding\": 5,\n \"itemGap\": 10,\n \"itemWidth\": 25,\n \"itemHeight\": 14,\n \"backgroundColor\": \"transparent\",\n \"borderColor\": \"#ccc\",\n \"borderRadius\": 0,\n \"pageButtonItemGap\": 5,\n \"pageButtonPosition\": \"end\",\n \"pageFormatter\": \"{current}/{total}\",\n \"pageIconColor\": \"#2f4554\",\n \"pageIconInactiveColor\": \"#aaa\",\n \"pageIconSize\": 15,\n \"animationDurationUpdate\": 800,\n \"selector\": false,\n \"selectorPosition\": \"auto\",\n \"selectorItemGap\": 7,\n \"selectorButtonGap\": 10\n }\n ],\n \"tooltip\": {\n \"show\": true,\n \"trigger\": \"item\",\n \"triggerOn\": \"mousemove|click\",\n \"axisPointer\": {\n \"type\": \"line\"\n },\n \"showContent\": true,\n \"alwaysShowContent\": false,\n \"showDelay\": 0,\n \"hideDelay\": 100,\n \"enterable\": false,\n \"confine\": false,\n \"appendToBody\": false,\n \"transitionDuration\": 0.4,\n \"textStyle\": {\n \"fontSize\": 14\n },\n \"borderWidth\": 0,\n \"padding\": 5,\n \"order\": \"seriesAsc\"\n },\n \"xAxis\": [\n {\n \"show\": true,\n \"scale\": false,\n \"nameLocation\": \"end\",\n \"nameGap\": 15,\n \"gridIndex\": 0,\n \"inverse\": false,\n \"offset\": 0,\n \"splitNumber\": 5,\n \"minInterval\": 0,\n \"splitLine\": {\n \"show\": true,\n \"lineStyle\": {\n \"show\": true,\n \"width\": 1,\n \"opacity\": 1,\n \"curveness\": 0,\n \"type\": \"solid\"\n }\n },\n \"animation\": true,\n \"animationThreshold\": 2000,\n \"animationDuration\": 1000,\n \"animationEasing\": \"cubicOut\",\n \"animationDelay\": 0,\n \"animationDurationUpdate\": 300,\n \"animationEasingUpdate\": \"cubicOut\",\n \"animationDelayUpdate\": 0,\n \"data\": [\n \"\政\务\区\",\n \"\蜀\山\区\",\n \"\瑶\海\区\",\n \"\高\新\区\"\n ]\n }\n ],\n \"yAxis\": [\n {\n \"show\": true,\n \"scale\": false,\n \"nameLocation\": \"end\",\n \"nameGap\": 15,\n \"gridIndex\": 0,\n \"inverse\": false,\n \"offset\": 0,\n \"splitNumber\": 5,\n \"minInterval\": 0,\n \"splitLine\": {\n \"show\": true,\n \"lineStyle\": {\n \"show\": true,\n \"width\": 1,\n \"opacity\": 1,\n \"curveness\": 0,\n \"type\": \"solid\"\n }\n },\n \"animation\": true,\n \"animationThreshold\": 2000,\n \"animationDuration\": 1000,\n \"animationEasing\": \"cubicOut\",\n \"animationDelay\": 0,\n \"animationDurationUpdate\": 300,\n \"animationEasingUpdate\": \"cubicOut\",\n \"animationDelayUpdate\": 0\n }\n ],\n \"title\": [\n {\n \"show\": true,\n \"text\": \"\地\址\分\布\",\n \"target\": \"blank\",\n \"subtarget\": \"blank\",\n \"padding\": 5,\n \"itemGap\": 10,\n \"textAlign\": \"auto\",\n \"textVerticalAlign\": \"auto\",\n \"triggerEvent\": false\n }\n ]\n};\n chart_chart_13bfcb833139422f9a545678364d725b.setOption(option_chart_13bfcb833139422f9a545678364d725b);\n </script>\n</body>\n</html>\n</div>\n <script src=\"https://assets.pyecharts.org/assets/v5/echarts.min.js\"></script>\n "
],
"message": "SQL查询和图表生成成功",
"sql_result": {
"data": {
"exc_data": [
[
"李红梅",
"02305627-a1d7-4a02-a40d-b46567299cfa",
"男",
"政务区"
],
[
"李红梅",
"064ad8c8-7213-4bd3-816d-5c590938d495",
"女",
"蜀山区"
],
[
"李红梅",
"1127096c-af08-4e46-972c-e78e61c3c0f0",
"女",
"瑶海区"
],
[
"李红梅",
"18d14b62-f65f-45c1-9990-db64da981406",
"女",
"瑶海区"
],
[
"李红梅",
"21a83803-3989-4ab2-b8f7-729c85ac88b5",
"女",
"瑶海区"
],
[
"李红梅",
"21c25518-9d42-4a41-958a-c8d3d01e3a65",
"女",
"高新区"
],
[
"李红梅",
"288550e9-02d1-491c-8770-2919f2a9c1f3",
"男",
"政务区"
],
[
"李红梅",
"2be66d6e-8a63-433c-ae49-c1ae76ddafab",
"女",
"瑶海区"
],
[
"李红梅",
"2e586d5d-d42e-45d1-9fd7-0e6cb99a4f37",
"男",
"高新区"
],
[
"李红梅",
"35a255ae-c0d8-4b20-8c9a-e50d2b489c3e",
"女",
"瑶海区"
],
[
"李红梅",
"3f1391c0-b013-4eba-939c-0940952679b8",
"女",
"瑶海区"
],
[
"李红梅",
"3f41736a-8e14-4e6d-ab98-e9c87f839140",
"男",
"蜀山区"
],
[
"李红梅",
"3fe6d6a0-4d7b-4ca0-9ccf-c586f136a562",
"男",
"蜀山区"
],
[
"李红梅",
"4226d2d4-3a6f-4053-861d-026ec610e082",
"男",
"瑶海区"
],
[
"李红梅",
"43f81b1a-b82b-4f9d-9ca1-2bb2c18ff7e9",
"女",
"瑶海区"
],
[
"李红梅",
"4f3a32c2-f3dc-40e7-9721-a2176c4d12cf",
"女",
"蜀山区"
],
[
"李红梅",
"4f5add51-4225-4a5d-a9bc-970209558ab6",
"女",
"瑶海区"
],
[
"李红梅",
"6a92ffad-89dd-46c3-a6b2-2d74e563e7da",
"女",
"蜀山区"
],
[
"李红梅",
"72686ee8-29d2-4415-b579-4557dbbf50a1",
"男",
"政务区"
],
[
"李红梅",
"7283d309-a668-45d5-9b04-cbf3deed7af8",
"男",
"政务区"
],
[
"李红梅",
"762176af-a04d-4a00-9bcd-b23147fd4f1a",
"男",
"高新区"
],
[
"李红梅",
"7da35a4c-6ec6-46fa-b25f-9662f00e8684",
"女",
"政务区"
],
[
"李红梅",
"81e09451-ba28-4adb-bdb5-6b79d3134060",
"男",
"蜀山区"
],
[
"李红梅",
"84d999b5-eb2c-47db-8145-a4e8770bdb5b",
"女",
"高新区"
],
[
"李红梅",
"8cb15c40-1c9a-416f-8315-c8fc3a90c7e7",
"男",
"高新区"
],
[
"李红梅",
"955ec004-6256-4d9a-99e6-827389070653",
"男",
"蜀山区"
],
[
"李红梅",
"9e6415b8-f59a-40b4-91bb-06de7dd208a1",
"男",
"政务区"
],
[
"李红梅",
"9f3d3b37-76c9-4e90-8ea9-bb31041f99aa",
"女",
"蜀山区"
],
[
"李红梅",
"b6e3ebf9-aea3-44aa-b6e2-0f8f77c46a4b",
"男",
"政务区"
],
[
"李红梅",
"bd3a272f-da74-419f-8a07-825080df497b",
"男",
"高新区"
],
[
"李红梅",
"c0abc8c3-13ee-41e2-b9e9-11ebb4f36e43",
"女",
"高新区"
],
[
"李红梅",
"c1206cad-9534-465d-a2c7-1e0321e44514",
"女",
"瑶海区"
],
[
"李红梅",
"cdc6871e-5b2f-48b0-9d65-1f36a1344b85",
"女",
"蜀山区"
],
[
"李红梅",
"daaaf94c-d012-486f-923b-7524bd01a959",
"男",
"高新区"
],
[
"李红梅",
"dccf87c3-1172-4c8c-a70e-47250436f642",
"女",
"高新区"
],
[
"李红梅",
"e96a64c8-8687-4f47-9a67-b7f80c9358d8",
"女",
"政务区"
],
[
"李红梅",
"ee14aa01-f4e4-44dd-b4b4-03c91b596713",
"男",
"瑶海区"
],
[
"李红梅",
"f300dcce-0fcb-427e-b875-065f8aea4529",
"男",
"瑶海区"
],
[
"李红梅",
"fa28378c-6c29-47a9-b10a-3631ce326575",
"男",
"瑶海区"
],
[
"李红梅",
"fd1dd221-ae68-4261-ac31-f7220689eca4",
"女",
"蜀山区"
]
],
"field": [
"name",
"id",
"gender",
"address"
]
},
"metadata": {
"database_config": {
"database": "DB_sql_test",
"password": "root",
"port": "3306",
"type": "mysql",
"url": "172.29.50.10",
"user": "root"
},
"database_type": "mysql",
"explanation": "无",
"query": "SELECT name, id, gender, address FROM feihe_man WHERE name = '李红梅';",
"summary": "无总结"
},
"status": "success"
},
"status": "success"
}
修改于 2025-06-11 00:52:36