From a2e0c6790a49291cca1083700a1d20ff0a6cb818 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Fri, 22 Dec 2023 18:45:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=85=8D=E7=BD=AE=E8=B5=84=E4=BA=A7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=AE=A1=E7=90=86=E7=9A=84=E4=BF=AE=E6=94=B9=20#[1044?= =?UTF-8?q?873413623808]=E8=87=AA=E5=8A=A8=E5=8C=96--=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=85=8D=E7=BD=AE=E8=B5=84=E4=BA=A7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=AE=A1=E7=90=86=E7=9A=84=E4=BF=AE=E6=94=B9=20http:/?= =?UTF-8?q?/192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/?= =?UTF-8?q?939050947543042/1044873413623808?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constvalue/AutoexecCombopOpType.java | 80 +++++++++++++++++++ .../dao/mapper/AutoexecCombopMapper.xml | 12 ++- .../autoexec/dto/combop/AutoexecCombopVo.java | 22 +++++ 3 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecCombopOpType.java diff --git a/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecCombopOpType.java b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecCombopOpType.java new file mode 100644 index 00000000..fe9ebc9c --- /dev/null +++ b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecCombopOpType.java @@ -0,0 +1,80 @@ +/* + * 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.autoexec.constvalue; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.common.constvalue.IEnum; +import neatlogic.framework.util.$; + +import java.util.List; + +public enum AutoexecCombopOpType implements IEnum { + READONLY("readonly", "查询类"), + AUTOEXEC("autoexec", "操作类"); + private final String value; + private final String text; + + AutoexecCombopOpType(String _value, String _name) { + this.value = _value; + this.text = _name; + } + + public String getValue() { + return value; + } + + @Override + public String getEnumName() { + return IEnum.super.getEnumName(); + } + + public String getText() { + return $.t(text); + } + + public static String getValue(String _value) { + for (AutoexecCombopOpType s : AutoexecCombopOpType.values()) { + if (s.getValue().equals(_value)) { + return s.getValue(); + } + } + return null; + } + + public static String getText(String _value) { + for (AutoexecCombopOpType s : AutoexecCombopOpType.values()) { + if (s.getValue().equals(_value)) { + return s.getText(); + } + } + return ""; + } + + @Override + public List getValueTextList() { + JSONArray resultList = new JSONArray(); + for (AutoexecCombopOpType e : values()) { + JSONObject jsonObj = new JSONObject(); + jsonObj.put("value", e.getValue()); + jsonObj.put("text", e.getText()); + resultList.add(jsonObj); + } + return resultList; + } + +} diff --git a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecCombopMapper.xml b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecCombopMapper.xml index b66a924d..3b9e70a6 100644 --- a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecCombopMapper.xml +++ b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecCombopMapper.xml @@ -42,11 +42,12 @@ limitations under the License. SELECT `id`, `name`, `description`, - `type_id` AS typeId, - `is_active` AS isActive, - `operation_type` AS operationType, + `op_type` AS opType, + `type_id` AS typeId, + `is_active` AS isActive, + `operation_type` AS operationType, `owner`, - `config` AS configStr, + `config` AS configStr, `fcd`, `fcu` FROM `autoexec_combop` @@ -320,6 +321,7 @@ limitations under the License. `name`, `description`, `type_id`, + `op_type`, `is_active`, `operation_type`, `owner`, @@ -332,6 +334,7 @@ limitations under the License. #{name}, #{description}, #{typeId}, + #{opType}, #{isActive}, #{operationType}, #{owner}, @@ -375,6 +378,7 @@ limitations under the License. SET `name` = #{name}, `description` = #{description}, `type_id` = #{typeId}, + `op_type` = #{opType}, `owner` = #{owner}, `config` = #{configStr}, `lcu` = #{lcu}, diff --git a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java index 8c30aba8..f2a3316d 100644 --- a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java +++ b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java @@ -18,12 +18,14 @@ package neatlogic.framework.autoexec.dto.combop; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; +import neatlogic.framework.autoexec.constvalue.AutoexecCombopOpType; import neatlogic.framework.autoexec.dto.AutoexecOperationVo; import neatlogic.framework.autoexec.dto.AutoexecParamVo; import neatlogic.framework.common.constvalue.ApiParamType; import neatlogic.framework.common.dto.BaseEditorVo; import neatlogic.framework.restful.annotation.EntityField; import neatlogic.framework.util.SnowflakeUtil; +import org.apache.commons.lang3.StringUtils; import java.io.Serializable; import java.util.List; @@ -44,6 +46,8 @@ public class AutoexecCombopVo extends BaseEditorVo implements Serializable { private String description; @EntityField(name = "common.typeid", type = ApiParamType.LONG) private Long typeId; + @EntityField(name = "操作类型", type = ApiParamType.STRING) + private String opType; @EntityField(name = "common.typename", type = ApiParamType.STRING) private String typeName; @EntityField(name = "common.isactive", type = ApiParamType.INTEGER) @@ -379,4 +383,22 @@ public class AutoexecCombopVo extends BaseEditorVo implements Serializable { public void setConfigExpiredReason(JSONObject configExpiredReason) { this.configExpiredReason = configExpiredReason; } + + public String getOpType() { + if (StringUtils.isBlank(opType)) { + return AutoexecCombopOpType.READONLY.getValue(); + } + return opType; + } + + public void setOpType(String opType) { + this.opType = opType; + } + + public String getOpTypeName() { + if (StringUtils.isNotBlank(opType)) { + return AutoexecCombopOpType.getText(opType); + } + return AutoexecCombopOpType.READONLY.getText(); + } } -- Gitee From 35615ef6dd429f3fbb61743c66a83b42eda93ce7 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Mon, 25 Dec 2023 19:14:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=85=8D=E7=BD=AE=E8=B5=84=E4=BA=A7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=AE=A1=E7=90=86=E7=9A=84=E4=BF=AE=E6=94=B9=20#[1044?= =?UTF-8?q?873413623808]=E8=87=AA=E5=8A=A8=E5=8C=96--=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=85=8D=E7=BD=AE=E8=B5=84=E4=BA=A7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=AE=A1=E7=90=86=E7=9A=84=E4=BF=AE=E6=94=B9=20http:/?= =?UTF-8?q?/192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/?= =?UTF-8?q?939050947543042/1044873413623808?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/autoexec/dto/combop/AutoexecCombopVo.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java index f2a3316d..f228ef71 100644 --- a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java +++ b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopVo.java @@ -21,8 +21,10 @@ import com.alibaba.fastjson.annotation.JSONField; import neatlogic.framework.autoexec.constvalue.AutoexecCombopOpType; import neatlogic.framework.autoexec.dto.AutoexecOperationVo; import neatlogic.framework.autoexec.dto.AutoexecParamVo; +import neatlogic.framework.cmdb.enums.CmdbTenantConfig; import neatlogic.framework.common.constvalue.ApiParamType; import neatlogic.framework.common.dto.BaseEditorVo; +import neatlogic.framework.config.ConfigManager; import neatlogic.framework.restful.annotation.EntityField; import neatlogic.framework.util.SnowflakeUtil; import org.apache.commons.lang3.StringUtils; @@ -401,4 +403,9 @@ public class AutoexecCombopVo extends BaseEditorVo implements Serializable { } return AutoexecCombopOpType.READONLY.getText(); } + + public String getIsResourcecenterAuth() { + return ConfigManager.getConfig(CmdbTenantConfig.IS_RESOURCECENTER_AUTH); + } + } -- Gitee