{
  "openapi": "3.0.3",
  "info": {
    "title": "SQL server转HTTP接口",
    "description": "可将您的SQLServer数据库接口转化为http接口，提高开发便利性。提供记录的增删查改、count、discint、建表等功能。 测试时使用的是公用测试库，数据不定期清理，请勿用于生产环境。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/1904-12": {
      "x-pointCode": 12,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "自定义查询SQL",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_12_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "sql_str": {
                    "type": "string"
                  }
                },
                "required": [
                  "ds_id",
                  "sql_str"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-11": {
      "x-pointCode": 11,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "search-pagebean",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_11_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string"
                  },
                  "order_by": {
                    "type": "string"
                  },
                  "fields": {
                    "type": "string"
                  },
                  "where": {
                    "type": "string"
                  },
                  "where_param": {
                    "type": "string"
                  },
                  "page": {
                    "type": "string"
                  },
                  "maxResult": {
                    "type": "string"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "order_by",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-10": {
      "x-pointCode": 10,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "drop-table",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_10_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "要删除的表名。"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-9": {
      "x-pointCode": 9,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "create-table",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_9_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "create_sql": {
                    "type": "string",
                    "description": "创建表的sql语句"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "create_sql",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-8": {
      "x-pointCode": 8,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "delete",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_8_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "表名"
                  },
                  "where": {
                    "type": "string",
                    "description": "可写复杂sql语句，重点要求：传入变量必须用?号代替"
                  },
                  "where_param": {
                    "type": "string",
                    "description": "一个json的lists类型字符串。对应where条件中的问号变量，区分字符串和数字。本值在替换where中的?号时，会经过反sql注射过滤。"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-7": {
      "x-pointCode": 7,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "update",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_7_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "表名"
                  },
                  "where": {
                    "type": "string",
                    "description": "可写复杂sql语句，重点要求：传入变量必须用?号代替"
                  },
                  "where_param": {
                    "type": "string",
                    "description": "一个json的lists类型字符串。对应where条件中的问号变量，区分字符串和数字。本值在替换where中的?号时，会经过反sql注射过滤。"
                  },
                  "set_data": {
                    "type": "string",
                    "description": "需要更新的字段"
                  },
                  "set_param": {
                    "type": "string",
                    "description": "字段被更新为什么值。其个数需要和update_data中的?号数量相同。"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-6": {
      "x-pointCode": 6,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "insert",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_6_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "表名"
                  },
                  "insert_data": {
                    "type": "string",
                    "description": "一个map的k=v结构，指示向哪个字段插入什么值。此map需要做json字符串处理。"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-5": {
      "x-pointCode": 5,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "show-tables",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_5_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-4": {
      "x-pointCode": 4,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "select-distinct",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_4_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "表名"
                  },
                  "where": {
                    "type": "string",
                    "description": "可写复杂sql语句，重点要求：传入变量必须用?号代替"
                  },
                  "where_param": {
                    "type": "string",
                    "description": "一个json的lists类型字符串。对应where条件中的问号变量，区分字符串和数字。本值在替换where中的?号时，会经过反sql注射过滤。"
                  },
                  "distinct": {
                    "type": "string",
                    "description": "需要distinct的字段"
                  },
                  "order_by": {
                    "type": "string",
                    "description": "排序方式"
                  },
                  "limit": {
                    "type": "string",
                    "description": "列表最大长度。"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "select-count",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "表名"
                  },
                  "where": {
                    "type": "string",
                    "description": "可写复杂sql语句，重点要求：传入变量必须用?号代替"
                  },
                  "where_param": {
                    "type": "string",
                    "description": "一个json的lists类型字符串。对应where条件中的问号变量，区分字符串和数字。本值在替换where中的?号时，会经过反sql注射过滤。"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "select-list",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_2_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "表名"
                  },
                  "fields": {
                    "type": "string",
                    "description": "需要返回的字段名"
                  },
                  "where": {
                    "type": "string",
                    "description": "可写复杂sql语句，重点要求：传入变量必须用?号代替"
                  },
                  "where_param": {
                    "type": "string",
                    "description": "一个json的lists类型字符串。对应where条件中的问号变量，区分字符串和数字。本值在替换where中的?号时，会经过反sql注射过滤。"
                  },
                  "order_by": {
                    "type": "string",
                    "description": "排序方式"
                  },
                  "limit": {
                    "type": "string",
                    "description": "列表最大长度。"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/1904-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "select-one",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {},
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1904_1_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string",
                    "description": "表名"
                  },
                  "fields": {
                    "type": "string",
                    "description": "需要返回的字段名"
                  },
                  "where": {
                    "type": "string",
                    "description": "可写复杂sql语句，重点要求：传入变量必须用?号代替"
                  },
                  "where_param": {
                    "type": "string",
                    "description": "对应where条件中的问号变量，区分字符串和数字。本值在替换where中的?号，会经过反sql注射。"
                  },
                  "order_by": {
                    "type": "string",
                    "description": "排序参数"
                  },
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "table",
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/1904?tab=book"
  },
  "x-apiCode": "1904",
  "x-is-own": false,
  "x-is-op": true
}