diff --git a/appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java b/appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java index 408b0f88c5297fd1a98658acc6fcbd381d7dc3c3..536ef78e9631233bdb4f4d0c43b05d13786f1ba7 100644 --- a/appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java +++ b/appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java @@ -215,7 +215,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge } - if (temp.equals("menu.sql.ftl") || temp.equals("db.sql.ftl") || temp.equals("dm_db.sql.ftl") || temp.equals("api.md.ftl")|| temp.equals("apipost.md.ftl")) { + if (temp.equals("menu.sql.ftl") || temp.equals("db.sql.ftl") || temp.equals("dm_db.sql.ftl") || temp.equals("api.md.ftl") || temp.equals("apipost.md.ftl")) { try { List<GentableEntity> tableList = new ArrayList<>(); tableList.add(gentableEntity); @@ -276,7 +276,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge FreeMarkerUtils.initFreeMarker(genFreePath("api.md.ftl")); zipTemplate("api.md.ftl", "doc/api.md", data, zip); FreeMarkerUtils.initFreeMarker(genFreePath("apipost.md.ftl")); - zipTemplate("apipost.ftl", "doc/apipost.json", data, zip); + zipTemplate("apipost.ftl", String.format("doc/%s.json", gentableEntity.getName()), data, zip); IOUtils.closeQuietly(zip); return outputStream.toByteArray(); @@ -307,7 +307,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge zipTemplate("dm_db.sql.ftl", "db/dm_db.sql", data, zip); FreeMarkerUtils.initFreeMarker(genFreePath("api.md.ftl")); zipTemplate("api.md.ftl", "doc/api.md", data, zip); - zipTemplate("apipost.md.ftl", "doc/apipost.json", data, zip); + zipTemplate("apipost.md.ftl", String.format("doc/%s.json", appEntity.getName()), data, zip); IOUtils.closeQuietly(zip); return outputStream.toByteArray(); } @@ -476,6 +476,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge String temp2 = StringUtils.substringBetween(column.getColumnComment(), "锛�", "锛�"); GenUtils.checkDict(column, temp1); GenUtils.checkDict(column, temp2); + column.setColumnComment(StrUtil.removeAllLineBreaks(column.getColumnComment())); return column; }).collect(Collectors.toList()); @@ -616,7 +617,6 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge } - /** * 鐢熸垚鏂囨。 */ diff --git a/appbuild-manager/src/main/resources/template/doc/apipost.md.ftl b/appbuild-manager/src/main/resources/template/doc/apipost.md.ftl index b12fd6deb6945f901c1beaa85ca465ce4eba506e..6d0bd8a4eaf474e931336f0c51340afbe13c4506 100644 --- a/appbuild-manager/src/main/resources/template/doc/apipost.md.ftl +++ b/appbuild-manager/src/main/resources/template/doc/apipost.md.ftl @@ -1038,6 +1038,337 @@ ] } + ,{ + "target_type": "api", + "name": "鏌ヨ鍙傛暟鍒楄〃", + "mark": "developing", + "sort": 5, + "method": "POST", + "mock": "{}", + "mock_url": "${appInfo.path}/param/list", + "request": { + "url": "{{baseUrl}}${appInfo.path}/office/param/list", + "description": "瀛楀吀鍙傛暟鍒楄〃鏌ヨ", + "event": { + "pre_script": "", + "test": "" + }, + "body": { + "mode": "json", + "parameter": [], + "raw": "{\n\t\"page\": 2,\n\t\"size\": 32,\n\t\"firstOrganize\": \"firstOrganize\",\n\t\"secondOrganize\": \"secondOrganize\",\n\t\"paramKey\": \"key\"\n}", + "raw_para": [ + { + "description": "褰撳墠椤�", + "field_type": "Integer", + "is_checked": 1, + "key": "page", + "value": "1", + "not_null": -1, + "type": "Text" + }, + { + "description": "姣忛〉鏉℃暟锛屽€间负-1锛屾煡璇㈡墍鏈夎褰�", + "field_type": "Integer", + "is_checked": 1, + "key": "size", + "value": "10", + "not_null": -1, + "type": "Text" + }, + { + "description": "绗竴绾х粍缁�", + "field_type": "String", + "is_checked": 1, + "key": "firstOrganize", + "value": "Window", + "not_null": -1, + "type": "Text" + }, + { + "description": "绗簩绾х粍缁�", + "field_type": "String", + "is_checked": 1, + "key": "secondOrganize", + "value": "hongqi", + "not_null": -1, + "type": "Text" + }, + { + "description": "鍙傛暟key", + "field_type": "String", + "is_checked": 1, + "key": "key", + "value": "test", + "not_null": -1, + "type": "Text" + } + ], + "raw_schema": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "description": "褰撳墠椤�", + "mock": { + "mock": "@integer(1,10)" + } + }, + "size": { + "type": "integer", + "description": "姣忛〉鏉℃暟锛屽€间负-1锛屾煡璇㈡墍鏈夎褰�", + "mock": { + "mock": "@integer(-1,100)" + } + }, + "firstOrganize": { + "type": "string", + "description": "绗竴绾х粍缁�", + "mock": { + "mock": "firstOrganize" + } + }, + "secondOrganize": { + "type": "string", + "mock": { + "mock": "secondOrganize" + }, + "description": "绗簩闆嗙粍缁�" + }, + "paramKey": { + "type": "string", + "description": "鍙傛暟key", + "mock": { + "mock": "key" + } + } + }, + "required": [ + "page", + "size" + ], + "APIPOST_ORDERS": [ + "page", + "size", + "firstOrganize", + "secondOrganize", + "paramKey" + ], + "description": "" + } + } + }, + "response": { + "success": { + "raw": "{\n\t\"data\": {\n\t\t\"data\": [\n\t\t\t{\n\t\t\t\t\"id\": 74,\n\t\t\t\t\"name\": \"crmtb\",\n\t\t\t\t\"paramKey\": \"duodbh\",\n\t\t\t\t\"paramValue\": \"xuccnvif\"\n\t\t\t}\n\t\t]\n\t},\n\t\"code\": 1,\n\t\"msg\": \"鏌ヨ鎴愬姛\"\n}", + "parameter": [ + { + "description": "", + "field_type": "object", + "is_checked": 1, + "key": "", + "not_null": true, + "type": "object", + "value": "-" + }, + { + "description": "", + "field_type": "object", + "is_checked": 1, + "key": "data", + "not_null": true, + "type": "object", + "value": "-" + }, + { + "description": "", + "field_type": "array", + "is_checked": 1, + "key": "data.data", + "not_null": true, + "type": "array", + "value": "-" + }, + { + "description": "", + "field_type": "object", + "is_checked": 1, + "key": "data.data.0", + "not_null": true, + "type": "object", + "value": "-" + }, + { + "description": "ID", + "field_type": "integer", + "is_checked": 1, + "key": "data.data.0.id", + "not_null": true, + "type": "integer", + "value": 74 + }, + { + "description": "鍚嶇О", + "field_type": "string", + "is_checked": 1, + "key": "data.data.0.name", + "not_null": true, + "type": "string", + "value": "crmtb" + }, + { + "description": "鍙傛暟閿甼ey", + "field_type": "string", + "is_checked": 1, + "key": "data.data.0.paramKey", + "not_null": true, + "type": "string", + "value": "duodbh" + }, + { + "description": "鍙傛暟鍊�", + "field_type": "string", + "is_checked": 1, + "key": "data.data.0.paramValue", + "not_null": true, + "type": "string", + "value": "xuccnvif" + }, + { + "description": "缁撴灉鐮�", + "field_type": "integer", + "is_checked": 1, + "key": "code", + "not_null": true, + "type": "integer", + "value": 1 + }, + { + "description": "鎻忚堪娑堟伅", + "field_type": "string", + "is_checked": 1, + "key": "msg", + "not_null": true, + "type": "string", + "value": "鏌ヨ鎴愬姛" + } + ], + "expect": { + "name": "鎴愬姛", + "isDefault": 1, + "code": 200, + "contentType": "json", + "verifyType": "schema", + "mock": "", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "mock": { + "mock": "@integer(1,100)" + }, + "description": "ID" + }, + "name": { + "type": "string", + "mock": { + "mock": "@word()" + }, + "description": "鍚嶇О" + }, + "paramKey": { + "type": "string", + "mock": { + "mock": "@word()" + }, + "description": "鍙傛暟閿甼ey" + }, + "paramValue": { + "type": "string", + "mock": { + "mock": "@word()" + }, + "description": "鍙傛暟鍊�" + } + }, + "required": [ + "id", + "name", + "paramKey", + "paramValue" + ], + "APIPOST_ORDERS": [ + "id", + "name", + "paramKey", + "paramValue" + ] + } + } + }, + "required": [ + "data" + ], + "APIPOST_ORDERS": [ + "data" + ] + }, + "code": { + "type": "integer", + "mock": { + "mock": "1" + }, + "description": "缁撴灉鐮�" + }, + "msg": { + "type": "string", + "mock": { + "mock": "鏌ヨ鎴愬姛" + }, + "description": "鎻忚堪娑堟伅" + } + }, + "required": [ + "data", + "code", + "msg" + ], + "APIPOST_ORDERS": [ + "data", + "code", + "msg" + ] + } + } + }, + "error": { + "raw": "", + "parameter": [], + "expect": { + "name": "澶辫触", + "isDefault": -1, + "code": 404, + "contentType": "json", + "verifyType": "schema", + "mock": "", + "schema": { + "type": "object" + } + } + } + }, + "children": [] + } + ] }, <#list tableList as table> diff --git a/appbuild-manager/src/main/resources/template/vue/VueDrawerShow.vue.ftl b/appbuild-manager/src/main/resources/template/vue/VueDrawerShow.vue.ftl index fa913fac6bc3eb7e81a6bdc6c405bcc22ac8030f..80742296220187184c552fddf42be790445b3748 100644 --- a/appbuild-manager/src/main/resources/template/vue/VueDrawerShow.vue.ftl +++ b/appbuild-manager/src/main/resources/template/vue/VueDrawerShow.vue.ftl @@ -4,6 +4,7 @@ :title="title" :visible.sync="open" :direction="direction" + :destroy-on-close="true" size="50%"> <el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-row>