class ButtonView implements Serializable {
        private static final long serialVersionUID = 1L;

        @Schema(description = "按钮ID")
        private String id;

        @Schema(description = "按钮名称")
        private String name;

        @Schema(description = "说明")
        private String description;

        @Schema(description = "其他配置")
        private Map<String, Object> options;

        @Schema(description = "是否启用")
        @Deprecated
        private boolean enabled;

        @Schema(description = "是否已授权")
        private boolean granted;

        public static ButtonView of(String id, String name, String description, Map<String, Object> options) {
            return ButtonView.of(id, name, description, options, true, true);
        }


        public ButtonView copy() {
            return FastBeanCopier.copy(this, new ButtonView());
        }
    }

    public static MenuView of(MenuEntity entity) {
        return FastBeanCopier.copy(entity, new MenuView());
    }

    public static MenuView of(MenuEntity entity, List<MenuBindEntity> binds) {<FILL_FUNCTION_BODY>

        MenuView view = of(entity);
        if (binds == null) {
            return view;
        }
        view.granted = true;
        if (MapUtils.isEmpty(view.getOptions())) {
            view.setOptions(new HashMap<>());
        }
        //重新排序
        binds.sort(Comparator.comparing(MenuBindEntity::getPriority));
        Map<String, ButtonView> buttons = new LinkedHashMap<>();

        for (MenuBindEntity bind : binds) {
            //不合并则清空之前的配置
            if (!bind.getMerge()) {
                view.setOptions(new HashMap<>());
                buttons.clear();
            }
            if (MapUtils.isNotEmpty(bind.getOptions())) {
                view.getOptions().putAll(bind.getOptions());
            }
            //按钮权限
            if (CollectionUtils.isNotEmpty(bind.getButtons())) {
                for (ButtonView button : bind.getButtons()) {
                    if (button.isGranted()) {
                        buttons.put(button.getId(), button);
                    }
                }
            }

        }
        view.setButtons(new ArrayList<>(buttons.values()));
        return view;

    
<no_super_class>