提交 | 用户 | 时间
|
1ac2bc
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.sys.modular.system.warpper; |
|
17 |
|
|
18 |
import cn.stylefeng.guns.sys.core.constant.factory.ConstantFactory; |
|
19 |
import cn.stylefeng.roses.core.base.warpper.BaseControllerWrapper; |
|
20 |
import cn.stylefeng.roses.kernel.model.enums.YesOrNotEnum; |
|
21 |
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
22 |
|
|
23 |
import java.util.List; |
|
24 |
import java.util.Map; |
|
25 |
|
|
26 |
/** |
|
27 |
* 菜单列表的包装类 |
|
28 |
* |
|
29 |
* @author fengshuonan |
|
30 |
* @date 2017年2月19日15:07:29 |
|
31 |
*/ |
|
32 |
public class MenuWrapper extends BaseControllerWrapper { |
|
33 |
|
|
34 |
public MenuWrapper(List<Map<String, Object>> multi) { |
|
35 |
super(multi); |
|
36 |
} |
|
37 |
|
|
38 |
public MenuWrapper(Page<Map<String, Object>> page) { |
|
39 |
super(page); |
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
protected void wrapTheMap(Map<String, Object> map) { |
|
44 |
map.put("statusName", ConstantFactory.me().getMenuStatusName((String) map.get("status"))); |
|
45 |
|
|
46 |
String menuFlag = (String) map.get("menuFlag"); |
|
47 |
for (YesOrNotEnum value : YesOrNotEnum.values()) { |
|
48 |
if (value.name().equals(menuFlag)) { |
|
49 |
map.put("isMenuName", value.getDesc()); |
|
50 |
} |
|
51 |
} |
|
52 |
|
|
53 |
//删除虚拟的父节点 |
|
54 |
if (map.get("pcode").equals("0")) { |
|
55 |
map.remove("pcode"); |
|
56 |
} |
|
57 |
|
|
58 |
} |
|
59 |
|
|
60 |
} |