magic-boot/data/magic-api/api/后台/组织机构/列表.ms

115 lines
2.9 KiB
Plaintext
Raw Normal View History

2022-01-09 22:13:45 +08:00
{
"properties" : { },
"id" : "f7fa03a5d8b64dbaa39387c185a21adb",
"script" : null,
"groupId" : "8295fc13678d4144bf7363c465247a50",
"name" : "列表",
"createTime" : 1646490239494,
2022-03-05 10:31:35 +08:00
"updateTime" : 1645694064991,
2022-01-09 22:13:45 +08:00
"lock" : "0",
"createBy" : null,
"updateBy" : null,
2022-01-09 22:13:45 +08:00
"path" : "/tree",
"method" : "GET",
2022-01-09 22:13:45 +08:00
"parameters" : [ ],
"options" : [ {
"name" : "permission",
"value" : "office:view",
"description" : "允许拥有该权限的访问",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : null,
"error" : null,
"expression" : null,
"children" : null
} ],
2022-02-06 12:34:56 +08:00
"requestBody" : "{\n\n}",
2022-01-09 22:13:45 +08:00
"headers" : [ ],
"paths" : [ ],
2022-03-05 10:31:35 +08:00
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1645694060610,\n \"executeTime\": null\n}",
2022-01-09 22:13:45 +08:00
"description" : null,
"requestBodyDefinition" : null,
2022-01-15 00:41:37 +08:00
"responseBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "code",
2022-03-05 10:31:35 +08:00
"value" : "402",
2022-01-15 00:41:37 +08:00
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "message",
2022-03-05 10:31:35 +08:00
"value" : "凭证已过期",
2022-01-15 00:41:37 +08:00
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "data",
2022-03-05 10:31:35 +08:00
"value" : "null",
2022-01-15 00:41:37 +08:00
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
2022-03-05 10:31:35 +08:00
"children" : [ ]
2022-01-15 00:41:37 +08:00
}, {
"name" : "timestamp",
2022-03-05 10:31:35 +08:00
"value" : "1645694060610",
2022-01-15 00:41:37 +08:00
"description" : "",
"required" : false,
"dataType" : "Long",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "executeTime",
2022-03-05 10:31:35 +08:00
"value" : "null",
2022-01-15 00:41:37 +08:00
"description" : "",
"required" : false,
2022-03-05 10:31:35 +08:00
"dataType" : "Object",
2022-01-15 00:41:37 +08:00
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
2022-02-06 12:34:56 +08:00
}
2022-01-09 22:13:45 +08:00
}
================================
var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid
var list = toTree(db.select('select id,name,pid,type,sort,code from sys_office where is_del = 0 order by sort'),'0')
return {
list: list,
total: list.getLength()
}