From 84b4df338bf49a9d9da559d8dacb185bcbc717c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com> Date: Sat, 5 Mar 2022 10:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/magic-api/api/后台/组件/group.json | 10 ++ data/magic-api/api/后台/组件/保存.ms | 26 +++ data/magic-api/api/后台/组件/列表.ms | 27 ++++ data/magic-api/api/后台/组件/删除.ms | 24 +++ data/magic-api/api/后台/组件/详情.ms | 192 +++++++++++++++++++++++ data/magic-api/api/后台/组件/选择组件.ms | 98 ++++++++++++ 6 files changed, 377 insertions(+) create mode 100644 data/magic-api/api/后台/组件/group.json create mode 100644 data/magic-api/api/后台/组件/保存.ms create mode 100644 data/magic-api/api/后台/组件/列表.ms create mode 100644 data/magic-api/api/后台/组件/删除.ms create mode 100644 data/magic-api/api/后台/组件/详情.ms create mode 100644 data/magic-api/api/后台/组件/选择组件.ms diff --git a/data/magic-api/api/后台/组件/group.json b/data/magic-api/api/后台/组件/group.json new file mode 100644 index 0000000..d06de0a --- /dev/null +++ b/data/magic-api/api/后台/组件/group.json @@ -0,0 +1,10 @@ +{ + "properties" : { }, + "id" : "6f106ebdee21489db34b956f7770ff03", + "name" : "组件", + "type" : "1", + "parentId" : "02df51e4d7184780a98b632f43dc5848", + "path" : "/component", + "paths" : [ ], + "options" : [ ] +} \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/保存.ms b/data/magic-api/api/后台/组件/保存.ms new file mode 100644 index 0000000..44eaead --- /dev/null +++ b/data/magic-api/api/后台/组件/保存.ms @@ -0,0 +1,26 @@ +{ + "properties" : { }, + "id" : "7879aae4cb5f40969b7de3db0dc4307c", + "script" : null, + "groupId" : "6f106ebdee21489db34b956f7770ff03", + "name" : "保存", + "createTime" : null, + "updateTime" : 1646401456776, + "lock" : "0", + "method" : "POST", + "path" : "/save", + "parameters" : [ ], + "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]", + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null, + "optionMap" : { + "wrap_request_parameter" : "data" + } +} +================================ +return db.table("sys_component").primary("id").saveOrUpdate(data) \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/列表.ms b/data/magic-api/api/后台/组件/列表.ms new file mode 100644 index 0000000..baef38d --- /dev/null +++ b/data/magic-api/api/后台/组件/列表.ms @@ -0,0 +1,27 @@ +{ + "properties" : { }, + "id" : "56ed96789b1e4b649265da83a7b3b8b4", + "script" : null, + "groupId" : "6f106ebdee21489db34b956f7770ff03", + "name" : "列表", + "createTime" : null, + "updateTime" : 1646401619732, + "lock" : "0", + "method" : "GET", + "path" : "/list", + "parameters" : [ ], + "option" : "[]", + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null, + "optionMap" : { } +} +================================ +return db.page(""" + select * from sys_component where 1=1 + ?{name, and name like concat('%',#{name},'%')} +""") \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/删除.ms b/data/magic-api/api/后台/组件/删除.ms new file mode 100644 index 0000000..91f5abd --- /dev/null +++ b/data/magic-api/api/后台/组件/删除.ms @@ -0,0 +1,24 @@ +{ + "properties" : { }, + "id" : "529cbe774ebe4565b091a30e806a5085", + "script" : null, + "groupId" : "6f106ebdee21489db34b956f7770ff03", + "name" : "删除", + "createTime" : null, + "updateTime" : 1646401575406, + "lock" : "0", + "method" : "POST", + "path" : "/delete", + "parameters" : [ ], + "option" : "[]", + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null, + "optionMap" : { } +} +================================ +return db.table("sys_component").logic().where().eq("id",id).delete() \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/详情.ms b/data/magic-api/api/后台/组件/详情.ms new file mode 100644 index 0000000..50f36b9 --- /dev/null +++ b/data/magic-api/api/后台/组件/详情.ms @@ -0,0 +1,192 @@ +{ + "properties" : { }, + "id" : "59ce5de20a8b46599cb72c164a9500d1", + "script" : null, + "groupId" : "6f106ebdee21489db34b956f7770ff03", + "name" : "详情", + "createTime" : null, + "updateTime" : 1646401567689, + "lock" : "0", + "method" : "GET", + "path" : "/get", + "parameters" : [ ], + "option" : "[]", + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"id\": \"1\",\n \"name\": \"TestCode\",\n \"code\": \"\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\",\n \"isDel\": 0,\n \"createBy\": null,\n \"createDate\": null,\n \"updateBy\": null,\n \"updateDate\": null\n },\n \"timestamp\": 1646401557066,\n \"executeTime\": 45\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "code", + "value" : "200", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "message", + "value" : "success", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "data", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "id", + "value" : "1", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "name", + "value" : "TestCode", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "code", + "value" : "\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "isDel", + "value" : "0", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "createBy", + "value" : "null", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "createDate", + "value" : "null", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "updateBy", + "value" : "null", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "updateDate", + "value" : "null", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + }, { + "name" : "timestamp", + "value" : "1646401557066", + "description" : "", + "required" : false, + "dataType" : "Long", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "executeTime", + "value" : "45", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + }, + "optionMap" : { } +} +================================ +return db.table("sys_component").where().eq("id",id).selectOne() \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/选择组件.ms b/data/magic-api/api/后台/组件/选择组件.ms new file mode 100644 index 0000000..d6d111a --- /dev/null +++ b/data/magic-api/api/后台/组件/选择组件.ms @@ -0,0 +1,98 @@ +{ + "properties" : { }, + "id" : "eb2b08bc7fe74036867e8dc5f2c0e8f8", + "script" : null, + "groupId" : "6f106ebdee21489db34b956f7770ff03", + "name" : "选择组件", + "createTime" : null, + "updateTime" : 1646402724502, + "lock" : "0", + "method" : "GET", + "path" : "/select", + "parameters" : [ ], + "option" : "[]", + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 1,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1646402708142,\n \"executeTime\": 2\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "code", + "value" : "1", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "message", + "value" : "success", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "data", + "value" : "null", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "timestamp", + "value" : "1646402708142", + "description" : "", + "required" : false, + "dataType" : "Long", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "executeTime", + "value" : "2", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + }, + "optionMap" : { } +} +================================ +return db.select(""" + select id value,name label from sys_component where is_del = 0 +""") \ No newline at end of file