magic-boot/data/magic-api/api/系统管理/菜单管理/删除.ms

147 lines
3.6 KiB
Plaintext
Raw Normal View History

2021-10-24 20:09:53 +08:00
{
"properties" : { },
"id" : "3564ad867beb48898f85c44bd3f7aa3f",
"script" : null,
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "删除",
"createTime" : null,
"updateTime" : 1665500654624,
2021-10-24 20:09:53 +08:00
"lock" : "0",
"createBy" : null,
"updateBy" : "guyi",
2021-10-24 20:09:53 +08:00
"path" : "/delete",
"method" : "DELETE",
2022-01-04 14:56:52 +08:00
"parameters" : [ {
"name" : "id",
"value" : "b1851d1b13594e71840103c11a37a669",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : null,
"error" : null,
"expression" : null,
"children" : null
} ],
"options" : [ {
"name" : "permission",
"value" : "menu:delete",
"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}",
2021-10-24 20:09:53 +08:00
"headers" : [ ],
"paths" : [ ],
2022-01-04 14:56:52 +08:00
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1641201245421,\n \"executeTime\": 7\n}",
2021-10-24 20:09:53 +08:00
"description" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
2022-01-04 14:56:52 +08:00
"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" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1641201245421",
"description" : "",
"required" : false,
"dataType" : "Long",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "7",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
2022-02-06 12:34:56 +08:00
}
2021-10-24 20:09:53 +08:00
}
================================
2023-12-28 20:58:43 +08:00
import org.ssssssss.magicapi.modules.db.cache.SqlCache
var userIds = db.select("""
select user_id from sys_user_role where role_id in (
select role_id from sys_role_menu where menu_id = #{id}
) and user_id is not null
""")
for(item in userIds){
SqlCache.delete(`permissions:${item.userId}`)
}
SqlCache.delete('permissions:1')
db.table('sys_role_menu').where().eq("menu_id",id).delete();
var result = db.table("sys_menu").logic().where().eq("id",id).delete();
return result