diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 51c4be841..b8f84b3ff 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -20,7 +20,9 @@ *(MAXKEY-210819) 调整了机构显示树的样式 *(MAXKEY-210820) 企业微信扫码登录js更新wwLogin-1.2.4.js *(MAXKEY-210821) 中文切换调整为下拉菜单 - *(MAXKEY-210822) 依赖jar引用、更新和升级 + *(MAXKEY-210822) 移除原有的缓存方案 + *(MAXKEY-210823) 依赖jar引用、更新和升级 + spring 5.3.11 mybatis-jpa-extra 2.6 druid 1.2.8 caffeine 2.9.2 diff --git a/gradle.properties b/gradle.properties index 6ce1a6912..06812680a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -44,7 +44,7 @@ poiVersion =4.1.2 tomcatVersion =9.0.53 tomcatembedloggingjuliVersion =8.5.2 #spring -springVersion =5.3.10 +springVersion =5.3.11 springBootVersion =2.5.5 springSecurityVersion =5.5.2 springDataVersion =2.5.2 diff --git a/maxkey-common/src/main/java/org/maxkey/cache/AbstractCache.java b/maxkey-common/src/main/java/org/maxkey/cache/AbstractCache.java deleted file mode 100644 index b77e24aaf..000000000 --- a/maxkey-common/src/main/java/org/maxkey/cache/AbstractCache.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright [2020] [MaxKey of copyright http://www.maxkey.top] - * - * 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 org.maxkey.cache; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * AbstractCache . - * @author Crystal - * @version 1.0 - * @Date 2015/11/12 - */ -public abstract class AbstractCache extends Thread { - - protected static final Logger _logger = LoggerFactory.getLogger(AbstractCache.class); - - private int interval = 30000 / 1000; - - public AbstractCache() { - - } - - public abstract void business(); - - @Override - public void run() { - while (true) { - _logger.debug("Cache Thread Start run " + getName()); - _logger.info("Cache Thread Start run " + this.getClass()); - try { - - business(); - - _logger.debug("Cache Thread " + getName() + " Finished . "); - _logger.info("Cache Thread " + this.getClass() + " Finished . "); - - _logger.debug("Cache Thread sleep " + (interval * 1000) + " minute . "); - sleep(interval * 1000); - } catch (InterruptedException e) { - _logger.error(e.getMessage(), e); - } - - } - } - - @Override - public void start() { - this.run(); - } - - /** - * constructor. - * @param name String - */ - public AbstractCache(String name) { - super(name); - // TODO Auto-generated constructor stub - } - - public int getInterval() { - return interval; - } - - public void setInterval(int interval) { - this.interval = interval; - } - -} diff --git a/maxkey-common/src/main/java/org/maxkey/cache/CacheFactory.java b/maxkey-common/src/main/java/org/maxkey/cache/CacheFactory.java deleted file mode 100644 index c53ebdf67..000000000 --- a/maxkey-common/src/main/java/org/maxkey/cache/CacheFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright [2020] [MaxKey of copyright http://www.maxkey.top] - * - * 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 org.maxkey.cache; - -import java.util.ArrayList; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * CacheFactory. - * @author Crystal.Sea - * - */ -public class CacheFactory { - protected static final Logger _logger = LoggerFactory.getLogger(CacheFactory.class); - - private ArrayList cache; - - - /** - * CacheFactory. - */ - public CacheFactory() { - - } - - /** - * start Cache. - */ - public void start() { - - for (AbstractCache cacheable : cache) { - _logger.info("Cache " + cacheable.getClass()); - new Thread(cacheable).start(); - - } - - } - - public ArrayList getCache() { - return cache; - } - - public void setCache(ArrayList cache) { - this.cache = cache; - } - -} diff --git a/maxkey-common/src/main/java/org/maxkey/cache/package-info.java b/maxkey-common/src/main/java/org/maxkey/cache/package-info.java deleted file mode 100644 index c03b514db..000000000 --- a/maxkey-common/src/main/java/org/maxkey/cache/package-info.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright [2020] [MaxKey of copyright http://www.maxkey.top] - * - * 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. - */ - - -/** - * - */ -/** - * @author Administrator - * - */ -package org.maxkey.cache; diff --git a/maxkey-common/src/test/java/org/maxkey/cache/CacheFactoryTest.java b/maxkey-common/src/test/java/org/maxkey/cache/CacheFactoryTest.java deleted file mode 100644 index 0ce99e0c3..000000000 --- a/maxkey-common/src/test/java/org/maxkey/cache/CacheFactoryTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright [2020] [MaxKey of copyright http://www.maxkey.top] - * - * 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 org.maxkey.cache; - -import java.util.ArrayList; - -/** - * @author Crystal.sea - * - */ -public class CacheFactoryTest { - - /** - * - */ - public CacheFactoryTest() { - // TODO Auto-generated constructor stub - } - - /** - * @param args - */ - public static void main(String[] args) { - // TODO Auto-generated method stub - RandomCache randomCache=new RandomCache(); - ArrayList cacheList=new ArrayList(); - cacheList.add(randomCache); - CacheFactory cacheFactory=new CacheFactory(); - cacheFactory.setCache(cacheList); - cacheFactory.start(); - } - -} diff --git a/maxkey-common/src/test/java/org/maxkey/cache/RandomCache.java b/maxkey-common/src/test/java/org/maxkey/cache/RandomCache.java deleted file mode 100644 index aa635fd3c..000000000 --- a/maxkey-common/src/test/java/org/maxkey/cache/RandomCache.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright [2020] [MaxKey of copyright http://www.maxkey.top] - * - * 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 org.maxkey.cache; - -import java.util.Random; - -/** - * @author amarsoft - * - */ -public class RandomCache extends AbstractCache { - java.util.Random random=new Random(); - - int i; - - /** - * - */ - public RandomCache() { - // TODO Auto-generated constructor stub - this.setInterval(5); - } - - /** - * @param name - */ - public RandomCache(String name) { - super(name); - // TODO Auto-generated constructor stub - } - - - /* (non-Javadoc) - * @see com.connsec.cache.AbstractCache#business() - */ - @Override - public void business() { - // TODO Auto-generated method stub - i=random.nextInt(100); - System.out.println(i); - } - - public int getI() { - return i; - } - - public void setI(int i) { - this.i = i; - } - - - -} diff --git a/maxkey-core/src/main/java/org/maxkey/web/InitializeContext.java b/maxkey-core/src/main/java/org/maxkey/web/InitializeContext.java index 84ddb0799..d6e402fe5 100644 --- a/maxkey-core/src/main/java/org/maxkey/web/InitializeContext.java +++ b/maxkey-core/src/main/java/org/maxkey/web/InitializeContext.java @@ -30,12 +30,10 @@ import javax.servlet.http.HttpServlet; import org.apache.commons.lang.SystemUtils; import org.apache.commons.lang3.ArchUtils; import org.joda.time.DateTime; -import org.maxkey.cache.CacheFactory; import org.maxkey.configuration.ApplicationConfig; import org.maxkey.util.PathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; @@ -80,9 +78,6 @@ public class InitializeContext extends HttpServlet { // List DatabaseMetaData Variables listDataBaseVariables(); - // load caches - loadCaches(); - // Show License showLicense(); } @@ -107,26 +102,6 @@ public class InitializeContext extends HttpServlet { this.applicationContext = applicationContext; } - /** - * loadCaches. - */ - public void loadCaches() { - _logger.info("-----------------------------------------------------------"); - _logger.info("Load Caches "); - - try { - if (applicationContext.containsBean("cacheFactory")) { - CacheFactory cacheFactory = - applicationContext.getBean("cacheFactory", CacheFactory.class); - cacheFactory.start(); - } - } catch (BeansException e) { - e.printStackTrace(); - } - _logger.info("-----------------------------------------------------------"); - - } - /** * listDataBaseVariables. */ diff --git a/maxkey-gataway/src/main/java/org/gateway/controller/FallbackController.java b/maxkey-gataway/src/main/java/org/gateway/controller/FallbackController.java new file mode 100644 index 000000000..f978f13e9 --- /dev/null +++ b/maxkey-gataway/src/main/java/org/gateway/controller/FallbackController.java @@ -0,0 +1,18 @@ +package org.gateway.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +public class FallbackController { + @RequestMapping("/defaultFallback") + public Map defaultFallback() { + Map map = new HashMap<>(); + map.put("code", 1); + map.put("message", "服务异常"); + return map; + } +} diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/OrganizationsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/OrganizationsMapper.xml index 614e5ce1f..d12ff6d5a 100644 --- a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/OrganizationsMapper.xml +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/OrganizationsMapper.xml @@ -7,13 +7,13 @@ and id = #{id} - and name like '%#{name}%' + and name like '%${name}%' and parentid = #{parentId} - and parentname like '%#{parentName}%' + and parentName like '%${parentName}%'