From c0c140f7b4baa747fcba5febf2eb02f57e3a0ebc Mon Sep 17 00:00:00 2001 From: chenjg <17688741996@163.com> Date: Tue, 19 Dec 2023 15:57:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/label/EXTRA_MENU_MODIFY.java | 41 ++++ .../extramenu/constvalue/ExtraMenuType.java | 63 ++++++ .../framework/extramenu/dto/ExtraMenuVo.java | 201 ++++++++++++++++++ .../ExtraMenuExistChildrenException.java | 25 +++ .../ExtraMenuNameRepeatException.java | 25 +++ .../ExtraMenuNotAllowedAddException.java | 22 ++ .../exception/ExtraMenuNotFoundException.java | 25 +++ .../exception/ExtraMenuParamException.java | 25 +++ .../exception/ExtraMenuRootException.java | 25 +++ .../ExtraMenuRootNotAllowedException.java | 22 ++ .../resources/framework/sqlscript/ddl.sql | 36 ++++ 11 files changed, 510 insertions(+) create mode 100644 src/main/java/neatlogic/framework/auth/label/EXTRA_MENU_MODIFY.java create mode 100644 src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java create mode 100644 src/main/java/neatlogic/framework/extramenu/dto/ExtraMenuVo.java create mode 100644 src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuExistChildrenException.java create mode 100644 src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNameRepeatException.java create mode 100644 src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotAllowedAddException.java create mode 100644 src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotFoundException.java create mode 100644 src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuParamException.java create mode 100644 src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootException.java create mode 100644 src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootNotAllowedException.java diff --git a/src/main/java/neatlogic/framework/auth/label/EXTRA_MENU_MODIFY.java b/src/main/java/neatlogic/framework/auth/label/EXTRA_MENU_MODIFY.java new file mode 100644 index 000000000..e80b5ae33 --- /dev/null +++ b/src/main/java/neatlogic/framework/auth/label/EXTRA_MENU_MODIFY.java @@ -0,0 +1,41 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package neatlogic.framework.auth.label; + +import neatlogic.framework.auth.core.AuthBase; + +public class EXTRA_MENU_MODIFY extends AuthBase { + @Override + public String getAuthDisplayName() { + return "nfal.extra_menu_modify.getauthdisplayname"; + } + + @Override + public String getAuthIntroduction() { + return "nfal.extra_menu_modify.getauthintroduction"; + } + + @Override + public String getAuthGroup() { + return "framework"; + } + + @Override + public Integer getSort() { + return 28; + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java b/src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java new file mode 100644 index 000000000..9662f21ce --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java @@ -0,0 +1,63 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package neatlogic.framework.extramenu.constvalue; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.common.constvalue.IEnum; + +import java.util.List; + +public enum ExtraMenuType implements IEnum { + DIRECTORY("目录", 0), MENU("菜单", 1); + + private int type; + + private String name; + + ExtraMenuType(String _name, int _type) { + this.name = _name; + this.type = _type; + } + + @Override + public List getValueTextList() { + JSONArray array = new JSONArray(); + for (ExtraMenuType typeEnum : ExtraMenuType.values()) { + array.add(new JSONObject() { + { + this.put("value", typeEnum.getType()); + this.put("text", typeEnum.getName()); + } + }); + } + return array; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/dto/ExtraMenuVo.java b/src/main/java/neatlogic/framework/extramenu/dto/ExtraMenuVo.java new file mode 100644 index 000000000..af0167c1e --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/dto/ExtraMenuVo.java @@ -0,0 +1,201 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package neatlogic.framework.extramenu.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import neatlogic.framework.common.constvalue.ApiParamType; +import neatlogic.framework.common.constvalue.GroupSearch; +import neatlogic.framework.dto.AuthorityVo; +import neatlogic.framework.restful.annotation.EntityField; +import neatlogic.framework.util.SnowflakeUtil; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +public class ExtraMenuVo { + public static final Long ROOT_PARENTID = -1L; + public static final Long ROOT_ID = 0L; + public static final String ROOT_NAME = "root"; + + @EntityField(name = "id", type = ApiParamType.LONG) + private Long id; + @EntityField(name = "common.name", type = ApiParamType.STRING) + private String name; + @EntityField(name = "common.type", type = ApiParamType.INTEGER) + private Integer type; + @EntityField(name = "common.isactive", type = ApiParamType.INTEGER) + private Integer isActive; + @EntityField(name = "url", type = ApiParamType.STRING) + private String url; + @EntityField(name = "common.description", type = ApiParamType.STRING) + private String description; + @EntityField(name = "common.authlist", type = ApiParamType.JSONARRAY) + private List authorityList = new ArrayList<>(); + @EntityField(name = "common.parentid", type = ApiParamType.LONG) + private Long parentId; + @EntityField(name = "common.lft", type = ApiParamType.INTEGER) + private Integer lft; + @EntityField(name = "common.rht", type = ApiParamType.INTEGER) + private Integer rht; + @EntityField(name = "nfdd.drorganizationvo.entityfield.childcount.name", type = ApiParamType.INTEGER) + private Integer childCount; + @EntityField(name = "nfdd.drorganizationvo.entityfield.children.name", type = ApiParamType.JSONARRAY) + private List children; + @JSONField(serialize = false) + private List authorityVoList; + @JSONField(serialize = false) + private ExtraMenuVo parent; + + public Long getId() { + if (id == null) { + id = SnowflakeUtil.uniqueLong(); + } + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getIsActive() { + return isActive; + } + + public void setIsActive(Integer isActive) { + this.isActive = isActive; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getAuthorityList() { + if (CollectionUtils.isEmpty(authorityList) && CollectionUtils.isNotEmpty(authorityVoList)) { + for (AuthorityVo authorityVo : authorityVoList) { + GroupSearch groupSearch = GroupSearch.getGroupSearch(authorityVo.getType()); + if (groupSearch != null) { + authorityList.add(groupSearch.getValuePlugin() + authorityVo.getUuid()); + } + } + } + return authorityList; + } + + public void setAuthorityList(List authorityList) { + this.authorityList = authorityList; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public Integer getLft() { + return lft; + } + + public void setLft(Integer lft) { + this.lft = lft; + } + + public Integer getRht() { + return rht; + } + + public void setRht(Integer rht) { + this.rht = rht; + } + + public Integer getChildCount() { + return childCount; + } + + public void setChildCount(Integer childCount) { + this.childCount = childCount; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public List getAuthorityVoList() { + if (authorityVoList == null && CollectionUtils.isNotEmpty(authorityList)) { + authorityVoList = new ArrayList<>(); + for (String authority : authorityList) { + String[] split = authority.split("#"); + if (GroupSearch.getGroupSearch(split[0]) != null) { + AuthorityVo authorityVo = new AuthorityVo(); + authorityVo.setType(split[0]); + authorityVo.setUuid(split[1]); + authorityVoList.add(authorityVo); + } + } + } + return authorityVoList; + } + + public void setAuthorityVoList(List authorityVoList) { + this.authorityVoList = authorityVoList; + } + + public ExtraMenuVo getParent() { + return parent; + } + + public void setParent(ExtraMenuVo parent) { + if (parent != null) { + this.parent = parent; + if (parent.getChildren() == null) { + parent.setChildren(new ArrayList<>()); + } + parent.getChildren().add(this); + } + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuExistChildrenException.java b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuExistChildrenException.java new file mode 100644 index 000000000..7685a33d9 --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuExistChildrenException.java @@ -0,0 +1,25 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package neatlogic.framework.extramenu.exception; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ExtraMenuExistChildrenException extends ApiRuntimeException { + public ExtraMenuExistChildrenException(String name) { + super("nfee.extramenuexistchildrenexception.extramenuexistchildrenexception", name); + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNameRepeatException.java b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNameRepeatException.java new file mode 100644 index 000000000..fe993db33 --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNameRepeatException.java @@ -0,0 +1,25 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package neatlogic.framework.extramenu.exception; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ExtraMenuNameRepeatException extends ApiRuntimeException { + public ExtraMenuNameRepeatException (String name) { + super("nfee.extramenunamerepeatexception.extramenunamerepeatexception", name); + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotAllowedAddException.java b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotAllowedAddException.java new file mode 100644 index 000000000..e698421c3 --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotAllowedAddException.java @@ -0,0 +1,22 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package neatlogic.framework.extramenu.exception; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ExtraMenuNotAllowedAddException extends ApiRuntimeException { + public ExtraMenuNotAllowedAddException() { + super("nfee.extramenunotallowedaddexception.extramenunotallowedaddexception"); + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotFoundException.java b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotFoundException.java new file mode 100644 index 000000000..57bb1088d --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuNotFoundException.java @@ -0,0 +1,25 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package neatlogic.framework.extramenu.exception; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ExtraMenuNotFoundException extends ApiRuntimeException { + public ExtraMenuNotFoundException(Long id) { + super("nfee.extramenunotfoundexception.extramenunotfoundexception", id); + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuParamException.java b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuParamException.java new file mode 100644 index 000000000..55e6c0f4e --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuParamException.java @@ -0,0 +1,25 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package neatlogic.framework.extramenu.exception; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ExtraMenuParamException extends ApiRuntimeException { + public ExtraMenuParamException(String param) { + super("nfee.extramenuparamexception.extramenuparamexception", param); + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootException.java b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootException.java new file mode 100644 index 000000000..e25986e8b --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootException.java @@ -0,0 +1,25 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package neatlogic.framework.extramenu.exception; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ExtraMenuRootException extends ApiRuntimeException { + public ExtraMenuRootException() { + super("nfee.extramenurootexception.extramenurootexception"); + } +} diff --git a/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootNotAllowedException.java b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootNotAllowedException.java new file mode 100644 index 000000000..08ba56906 --- /dev/null +++ b/src/main/java/neatlogic/framework/extramenu/exception/ExtraMenuRootNotAllowedException.java @@ -0,0 +1,22 @@ +/* + * Copyright(c) 2023 NeatLogic Co., Ltd. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package neatlogic.framework.extramenu.exception; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ExtraMenuRootNotAllowedException extends ApiRuntimeException { + public ExtraMenuRootNotAllowedException() { + super("nfee.extramenurootnotallowedexception.extramenurootnotallowedexception"); + } +} diff --git a/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql b/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql index e5af6556e..0d69c79fd 100644 --- a/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql +++ b/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql @@ -1420,4 +1420,40 @@ CREATE TABLE IF NOT EXISTS `mail_server` ( PRIMARY KEY (`uuid`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '邮件服务器表' ROW_FORMAT = Dynamic; +-- ---------------------------- +-- Table structure for extramenu +-- ---------------------------- +CREATE TABLE IF NOT EXISTS `extramenu` +( + `id` BIGINT NOT NULL COMMENT 'id', + `name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称', + `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型,0:目录,1:菜单', + `is_active` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否激活', + `url` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '跳转链接', + `description` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述', + `parent_id` BIGINT DEFAULT NULL COMMENT '父id', + `lft` INT DEFAULT NULL COMMENT '左编码', + `rht` INT DEFAULT NULL COMMENT '右编码', + KEY `idx_lft_rht` (`lft`, `rht`), + KEY `idx_parent_id` (`parent_id`) +) ENGINE = INNODB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT ='附加菜单表'; + +-- ---------------------------- +-- Table structure for extramenu_authority +-- ---------------------------- +CREATE TABLE IF NOT EXISTS `extramenu_authority` +( + `menu_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单目录id', + `type` enum ('common','user','team','role') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '类型', + `uuid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'uuid', + PRIMARY KEY (`menu_id`, `type`, `uuid`) USING BTREE, + KEY `idx_uuid` (`uuid`) USING BTREE, + KEY `idx_menu_id` (`menu_id`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT ='附加菜单授权表'; + + SET FOREIGN_KEY_CHECKS = 1; -- Gitee From 56b0756b17000c3edc3bfcbdfc99000a53a3f6cc Mon Sep 17 00:00:00 2001 From: chenjg <17688741996@163.com> Date: Tue, 19 Dec 2023 18:17:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extramenu/constvalue/ExtraMenuType.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java b/src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java index 9662f21ce..a57542a4a 100644 --- a/src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java +++ b/src/main/java/neatlogic/framework/extramenu/constvalue/ExtraMenuType.java @@ -20,14 +20,11 @@ import neatlogic.framework.common.constvalue.IEnum; import java.util.List; public enum ExtraMenuType implements IEnum { - DIRECTORY("目录", 0), MENU("菜单", 1); + DIRECTORY(0), MENU(1); private int type; - private String name; - - ExtraMenuType(String _name, int _type) { - this.name = _name; + ExtraMenuType(int _type) { this.type = _type; } @@ -38,21 +35,13 @@ public enum ExtraMenuType implements IEnum { array.add(new JSONObject() { { this.put("value", typeEnum.getType()); - this.put("text", typeEnum.getName()); + this.put("text", typeEnum.name()); } }); } return array; } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public int getType() { return type; } -- Gitee