From d127f26264a9745b11e89b675c218587b2ec2b06 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Thu, 26 Sep 2019 20:29:48 +0800 Subject: [PATCH] update document --- .../com/xxl/job/admin/dao/XxlJobGroupDao.java | 4 -- .../job/admin/service/impl/AdminBizImpl.java | 41 ++++--------------- .../mybatis-mapper/XxlJobGroupMapper.xml | 13 ------ 3 files changed, 9 insertions(+), 49 deletions(-) diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobGroupDao.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobGroupDao.java index ddafaa8b..35f3cd3c 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobGroupDao.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobGroupDao.java @@ -16,10 +16,6 @@ public interface XxlJobGroupDao { public List findByAddressType(@Param("addressType") int addressType); - public List findAutoRegisterGroupByAppName(@Param("appName") String appName); - - public int updateAddressListById(@Param("id") int id, @Param("addressList") String addressList); - public int save(XxlJobGroup xxlJobGroup); public int update(XxlJobGroup xxlJobGroup); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java index 1be9a0bc..108f5df3 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.service.impl; -import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobInfo; import com.xxl.job.admin.core.model.XxlJobLog; import com.xxl.job.admin.core.thread.JobTriggerPoolHelper; @@ -18,8 +17,6 @@ import com.xxl.job.core.handler.IJobHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; import javax.annotation.Resource; import java.text.MessageFormat; @@ -132,6 +129,9 @@ public class AdminBizImpl implements AdminBiz { int ret = xxlJobRegistryDao.registryUpdate(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue()); if (ret < 1) { xxlJobRegistryDao.registrySave(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue()); + + // fresh + freshGroupRegistryInfo(registryParam); } return ReturnT.SUCCESS; } @@ -139,39 +139,16 @@ public class AdminBizImpl implements AdminBiz { @Override public ReturnT registryRemove(RegistryParam registryParam) { int ret = xxlJobRegistryDao.registryDelete(registryParam.getRegistGroup(), registryParam.getRegistryKey(), registryParam.getRegistryValue()); - if (ret == 1) { - List autoRegisterGroups = xxlJobGroupDao.findAutoRegisterGroupByAppName(registryParam.getRegistryKey()); - removeRegisterFromGroups(autoRegisterGroups, registryParam.getRegistryValue()); + if (ret > 0) { + + // fresh + freshGroupRegistryInfo(registryParam); } return ReturnT.SUCCESS; } - private void removeRegisterFromGroups(List groups, String address) { - if (StringUtils.isEmpty(address)) { - return; - } - if (CollectionUtils.isEmpty(groups)) { - return; - } - - for (XxlJobGroup group : groups) { - List addressList = group.getRegistryList(); - if (addressList == null) { - continue; - } - if (!addressList.contains(address)) { - continue; - } - - addressList.remove(address); - String newAddressListStr = StringUtils.collectionToCommaDelimitedString(addressList); - String oldAddressListStr = group.getAddressList(); - int update = xxlJobGroupDao.updateAddressListById(group.getId(), newAddressListStr); - if (logger.isDebugEnabled()) { - logger.debug("update group name [{}] title [{}] old address list [{}] new address list [{}] update result [{}]", - group.getAppName(), group.getTitle(), oldAddressListStr, newAddressListStr, update); - } - } + private void freshGroupRegistryInfo(RegistryParam registryParam){ + // Under consideration, prevent affecting core tables } } diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml index 0f588e68..561c6618 100644 --- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml +++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml @@ -27,13 +27,6 @@ ORDER BY t.order ASC - -