Commit 0e60c2a2 by inrgihc

接口配置页面优化

parent d564a649
...@@ -59,6 +59,26 @@ ...@@ -59,6 +59,26 @@
├── sqlrest-dist // 基于maven-assembly-plugin插件的项目打包模块 ├── sqlrest-dist // 基于maven-assembly-plugin插件的项目打包模块
``` ```
### 4、正在规划中的功能
- (1) 接口响应出参列表及说明文档
> 通过人工配制或接口调试,以构建接口出参及其说明文档。
- (2) 支持更广泛的入参格式(如JSON入参/文件入参等)
> 支持POST/PUT等JSON格式的接口入参。
- (3) 支持接口的缓存配置功能
> 基于分布式缓存等构建支持接口的缓存配置功能。
- (4) SQL结果集的出参格式转换
> SQL查询结果集到接口出参相应的格式转换。
- (5) 接口入参的校验
> 支持接口入参的类型、是否可空等的校验功能。
- (6) 前端界面中拓扑结构美化
> 美化签到界面的拓扑结构图的展示。
## 二、编译打包 ## 二、编译打包
本工具纯Java语言开发,依赖全部来自于开源项目。 本工具纯Java语言开发,依赖全部来自于开源项目。
...@@ -190,6 +210,12 @@ MYSQLDB_PASSWORD=123456 ...@@ -190,6 +210,12 @@ MYSQLDB_PASSWORD=123456
![006.png](docs/images/006.PNG) ![006.png](docs/images/006.PNG)
![007.png](docs/images/007.PNG)
![008.png](docs/images/008.PNG)
![009.png](docs/images/009.PNG)
## 四、问题反馈 ## 四、问题反馈
如果您看到并使用了本工具,或您觉得本工具对您有价值,请为此项目**点个赞**,以表示对本项目的支持,多谢!如果您在使用时遇到了bug,欢迎在issue中反馈。 如果您看到并使用了本工具,或您觉得本工具对您有价值,请为此项目**点个赞**,以表示对本项目的支持,多谢!如果您在使用时遇到了bug,欢迎在issue中反馈。
docs/images/001.PNG

59.3 KB | W: | H:

docs/images/001.PNG

93.3 KB | W: | H:

docs/images/001.PNG
docs/images/001.PNG
docs/images/001.PNG
docs/images/001.PNG
  • 2-up
  • Swipe
  • Onion skin
docs/images/002.PNG

59.3 KB | W: | H:

docs/images/002.PNG

70 KB | W: | H:

docs/images/002.PNG
docs/images/002.PNG
docs/images/002.PNG
docs/images/002.PNG
  • 2-up
  • Swipe
  • Onion skin
docs/images/003.PNG

77 KB | W: | H:

docs/images/003.PNG

83.2 KB | W: | H:

docs/images/003.PNG
docs/images/003.PNG
docs/images/003.PNG
docs/images/003.PNG
  • 2-up
  • Swipe
  • Onion skin
docs/images/004.PNG

58.7 KB | W: | H:

docs/images/004.PNG

58.1 KB | W: | H:

docs/images/004.PNG
docs/images/004.PNG
docs/images/004.PNG
docs/images/004.PNG
  • 2-up
  • Swipe
  • Onion skin
docs/images/005.PNG

56.9 KB | W: | H:

docs/images/005.PNG

51.9 KB | W: | H:

docs/images/005.PNG
docs/images/005.PNG
docs/images/005.PNG
docs/images/005.PNG
  • 2-up
  • Swipe
  • Onion skin
docs/images/006.PNG

62.6 KB | W: | H:

docs/images/006.PNG

58.7 KB | W: | H:

docs/images/006.PNG
docs/images/006.PNG
docs/images/006.PNG
docs/images/006.PNG
  • 2-up
  • Swipe
  • Onion skin
...@@ -33,8 +33,12 @@ public class SqlExecutorService extends AbstractExecutorEngine { ...@@ -33,8 +33,12 @@ public class SqlExecutorService extends AbstractExecutorEngine {
for (ApiContextEntity sql : scripts) { for (ApiContextEntity sql : scripts) {
SqlTemplate template = cfg.getTemplate(sql.getSqlText()); SqlTemplate template = cfg.getTemplate(sql.getSqlText());
SqlMeta sqlMeta = template.process(params); SqlMeta sqlMeta = template.process(params);
int page = NumberUtil.parseInt(params.getOrDefault(Constants.PARAM_PAGE_NUMBER, 1).toString()); int page = (null == params.get(Constants.PARAM_PAGE_NUMBER))
int size = NumberUtil.parseInt(params.getOrDefault(Constants.PARAM_PAGE_SIZE, 10).toString()); ? 1
: NumberUtil.parseInt(params.get(Constants.PARAM_PAGE_NUMBER).toString());
int size = (null == params.get(Constants.PARAM_PAGE_SIZE))
? 10
: NumberUtil.parseInt(params.get(Constants.PARAM_PAGE_SIZE).toString());
dataList.add(SqlJdbcUtils.execute(connection, sqlMeta, page, size)); dataList.add(SqlJdbcUtils.execute(connection, sqlMeta, page, size));
} }
connection.commit(); connection.commit();
......
...@@ -90,8 +90,12 @@ public class DbVarModule { ...@@ -90,8 +90,12 @@ public class DbVarModule {
SqlMeta sqlMeta = template.process(params); SqlMeta sqlMeta = template.process(params);
String pageSql = productType.getPageSql(sqlMeta.getSql()); String pageSql = productType.getPageSql(sqlMeta.getSql());
List<Object> parameters = sqlMeta.getParameter(); List<Object> parameters = sqlMeta.getParameter();
int page = NumberUtil.parseInt(params.getOrDefault(Constants.PARAM_PAGE_NUMBER, 1).toString()); int page = (null == params.get(Constants.PARAM_PAGE_NUMBER))
int size = NumberUtil.parseInt(params.getOrDefault(Constants.PARAM_PAGE_SIZE, 10).toString()); ? 1
: NumberUtil.parseInt(params.get(Constants.PARAM_PAGE_NUMBER).toString());
int size = (null == params.get(Constants.PARAM_PAGE_SIZE))
? 10
: NumberUtil.parseInt(params.get(Constants.PARAM_PAGE_SIZE).toString());
parameters.add(((page - 1) * size) < 0 ? 0 : (page - 1) * size); parameters.add(((page - 1) * size) < 0 ? 0 : (page - 1) * size);
parameters.add(size); parameters.add(size);
return jdbcTemplate.queryForList(pageSql, parameters.toArray()); return jdbcTemplate.queryForList(pageSql, parameters.toArray());
......
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
methods: { methods: {
onCmReady (cm) { onCmReady (cm) {
this.cmMapper.set(this.currentTabName, cm) this.cmMapper.set(this.currentTabName, cm)
cm.setSize('100%', '200px') cm.setSize('100%', '300px')
}, },
onCmFocus (cm) { onCmFocus (cm) {
}, },
...@@ -131,10 +131,6 @@ export default { ...@@ -131,10 +131,6 @@ export default {
this.currentTabName = newTabName; this.currentTabName = newTabName;
}, },
removeTab: function (targetName) { removeTab: function (targetName) {
if (this.editableTabs.length === 1) {
alert("最后一个SQL窗口禁止关闭")
return
}
let tabs = this.editableTabs; let tabs = this.editableTabs;
let activeName = this.currentTabName; let activeName = this.currentTabName;
if (activeName === targetName) { if (activeName === targetName) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
@init="editorInit" @init="editorInit"
lang="groovy" lang="groovy"
theme="vibrant_ink" theme="vibrant_ink"
height="200" height="300"
:options="options"></editor> :options="options"></editor>
</div> </div>
</template> </template>
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>SQLREST工具</title><link href=/static/css/app.ca40fc8269b428e8762bbd3028de33d9.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.e707a97f388d19a32b5e.js></script><script type=text/javascript src=/static/js/vendor.b8089f9fd73f8896df25.js></script><script type=text/javascript src=/static/js/app.907b2e3813e3bdcda00d.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>SQLREST工具</title><link href=/static/css/app.b00ebac3d2add7487e4a6432cef8d975.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.255d24ba50ec0408e7ae.js></script><script type=text/javascript src=/static/js/vendor.b8089f9fd73f8896df25.js></script><script type=text/javascript src=/static/js/app.907b2e3813e3bdcda00d.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(n&&n(r,c,a);b.length;)b.shift()();if(a)for(u=0;u<a.length;u++)i=o(o.s=a[u]);return i};var r={},t={22:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"13ff46be1994a329d393",1:"347dcbee299ce37dade6",2:"140338f6a5528feea1a3",3:"712d5b861100b5e0b704",4:"f8494b8dd039413f79c8",5:"f69840e8bd74f4d4e92b",6:"8f85de06573e2a5f9562",7:"7ea6008d16a44e79a428",8:"7483ee6d3a25506eb489",9:"1f165c58c9933d0da8a7",10:"cdd03027e5c73f31170c",11:"cdde61370dec5108c322",12:"57d1188c7336fe654844",13:"2865b5654b1d3bdf6e13",14:"42cdbd66a7803b30c641",15:"3b3f0c03ff4fed9903cc",16:"4de955682c1f7710c7ea",17:"819547b2361d544d3b8b",18:"5e7f065a8d031847e833",19:"3936346cb7e30aa279e2"}[e]+".js";var f=setTimeout(d,12e4);function d(){a.onerror=a.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=d,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="/",o.oe=function(e){throw console.error(e),e}}([]); !function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var f,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(n&&n(r,c,a);b.length;)b.shift()();if(a)for(u=0;u<a.length;u++)i=o(o.s=a[u]);return i};var r={},t={22:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"f553862d2c4a87a9b53f",1:"347dcbee299ce37dade6",2:"140338f6a5528feea1a3",3:"712d5b861100b5e0b704",4:"f8494b8dd039413f79c8",5:"f69840e8bd74f4d4e92b",6:"8f85de06573e2a5f9562",7:"7ea6008d16a44e79a428",8:"7483ee6d3a25506eb489",9:"1f165c58c9933d0da8a7",10:"cdd03027e5c73f31170c",11:"cdde61370dec5108c322",12:"57d1188c7336fe654844",13:"2865b5654b1d3bdf6e13",14:"42cdbd66a7803b30c641",15:"3b3f0c03ff4fed9903cc",16:"4de955682c1f7710c7ea",17:"819547b2361d544d3b8b",18:"5e7f065a8d031847e833",19:"3936346cb7e30aa279e2"}[e]+".js";var f=setTimeout(d,12e4);function d(){a.onerror=a.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=d,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="/",o.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.e707a97f388d19a32b5e.js.map //# sourceMappingURL=manifest.255d24ba50ec0408e7ae.js.map
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment