🎨 优化项目模块.

This commit is contained in:
lijiahang
2025-01-07 17:55:22 +08:00
parent 45b3e0746a
commit c0122079c1
760 changed files with 88 additions and 29 deletions

View File

@@ -33,8 +33,6 @@ package org.dromara.visor.framework.common.constant;
*/ */
public interface AutoConfigureOrderConst { public interface AutoConfigureOrderConst {
int FRAMEWORK_COMMON = Integer.MIN_VALUE + 1000;
int FRAMEWORK_WEB = Integer.MIN_VALUE + 1100; int FRAMEWORK_WEB = Integer.MIN_VALUE + 1100;
int FRAMEWORK_SECURITY = Integer.MIN_VALUE + 1200; int FRAMEWORK_SECURITY = Integer.MIN_VALUE + 1200;
@@ -61,7 +59,9 @@ public interface AutoConfigureOrderConst {
int FRAMEWORK_JOB = Integer.MIN_VALUE + 2100; int FRAMEWORK_JOB = Integer.MIN_VALUE + 2100;
int FRAMEWORK_JOB_QUARTZ = Integer.MIN_VALUE + 2150; int FRAMEWORK_JOB_QUARTZ = Integer.MIN_VALUE + 2130;
int FRAMEWORK_JOB_ASYNC = Integer.MIN_VALUE + 2160;
int FRAMEWORK_MONITOR = Integer.MIN_VALUE + 2200; int FRAMEWORK_MONITOR = Integer.MIN_VALUE + 2200;

View File

@@ -1 +0,0 @@
org.dromara.visor.framework.common.configuration.OrionCommonAutoConfiguration

View File

@@ -20,12 +20,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.dromara.visor.framework.common.configuration; package org.dromara.visor.framework.job.configuration;
import cn.orionsec.kit.spring.SpringHolder;
import org.dromara.visor.framework.common.configuration.config.AsyncExecutorConfig;
import org.dromara.visor.framework.common.constant.AutoConfigureOrderConst; import org.dromara.visor.framework.common.constant.AutoConfigureOrderConst;
import org.dromara.visor.framework.common.thread.ThreadPoolMdcTaskExecutor; import org.dromara.visor.framework.common.thread.ThreadPoolMdcTaskExecutor;
import org.dromara.visor.framework.job.configuration.config.AsyncExecutorConfig;
import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -37,7 +36,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
/** /**
* 应用配置类 * async 异步任务
* *
* @author Jiahang Li * @author Jiahang Li
* @version 1.0.0 * @version 1.0.0
@@ -45,17 +44,9 @@ import java.util.concurrent.ThreadPoolExecutor;
*/ */
@EnableAsync @EnableAsync
@AutoConfiguration @AutoConfiguration
@AutoConfigureOrder(AutoConfigureOrderConst.FRAMEWORK_COMMON) @AutoConfigureOrder(AutoConfigureOrderConst.FRAMEWORK_JOB_ASYNC)
@EnableConfigurationProperties(AsyncExecutorConfig.class) @EnableConfigurationProperties(AsyncExecutorConfig.class)
public class OrionCommonAutoConfiguration { public class OrionAsyncAutoConfiguration {
/**
* @return spring 容器工具类
*/
@Bean
public SpringHolder.ApplicationContextAwareStore springHolderAware() {
return new SpringHolder.ApplicationContextAwareStore();
}
/** /**
* 支持 MDC 的异步线程池 * 支持 MDC 的异步线程池

View File

@@ -20,7 +20,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.dromara.visor.framework.common.configuration.config; package org.dromara.visor.framework.job.configuration.config;
import lombok.Data; import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -2,8 +2,8 @@
"groups": [ "groups": [
{ {
"name": "orion.async.executor", "name": "orion.async.executor",
"type": "org.dromara.visor.framework.common.configuration.config.AsyncExecutorConfig", "type": "org.dromara.visor.framework.job.configuration.config.AsyncExecutorConfig",
"sourceType": "org.dromara.visor.framework.common.configuration.config.AsyncExecutorConfig" "sourceType": "org.dromara.visor.framework.job.configuration.config.AsyncExecutorConfig"
} }
], ],
"properties": [ "properties": [

View File

@@ -1,2 +1,3 @@
org.dromara.visor.framework.job.configuration.OrionSchedulerAutoConfiguration org.dromara.visor.framework.job.configuration.OrionSchedulerAutoConfiguration
org.dromara.visor.framework.job.configuration.OrionQuartzAutoConfiguration org.dromara.visor.framework.job.configuration.OrionQuartzAutoConfiguration
org.dromara.visor.framework.job.configuration.OrionAsyncAutoConfiguration

View File

@@ -24,7 +24,6 @@ package org.dromara.visor.framework.test.core.base;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import org.dromara.visor.framework.common.configuration.OrionCommonAutoConfiguration;
import org.dromara.visor.framework.datasource.configuration.OrionDataSourceAutoConfiguration; import org.dromara.visor.framework.datasource.configuration.OrionDataSourceAutoConfiguration;
import org.dromara.visor.framework.mybatis.configuration.OrionMybatisAutoConfiguration; import org.dromara.visor.framework.mybatis.configuration.OrionMybatisAutoConfiguration;
import org.dromara.visor.framework.redis.configuration.OrionRedisAutoConfiguration; import org.dromara.visor.framework.redis.configuration.OrionRedisAutoConfiguration;
@@ -58,8 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
public class BaseUnitTest { public class BaseUnitTest {
@Import({ @Import({
// holder
OrionCommonAutoConfiguration.class,
// mock // mock
OrionMockBeanTestConfiguration.class, OrionMockBeanTestConfiguration.class,
OrionMockRedisTestConfiguration.class, OrionMockRedisTestConfiguration.class,
@@ -77,6 +74,7 @@ public class BaseUnitTest {
RedisAutoConfiguration.class, RedisAutoConfiguration.class,
RedissonAutoConfiguration.class, RedissonAutoConfiguration.class,
}) })
// TODO
public static class Application { public static class Application {
} }

View File

@@ -0,0 +1,47 @@
/*
* Copyright (c) 2023 - present Dromara, All rights reserved.
*
* https://visor.dromara.org
* https://visor.dromara.org.cn
* https://visor.orionsec.cn
*
* Members:
* Jiahang Li - ljh1553488six@139.com - author
*
* 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.dromara.visor.launch.configuration;
import cn.orionsec.kit.spring.SpringHolder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 应用配置类
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/20 10:34
*/
@Configuration
public class LaunchApplicationConfiguration {
/**
* @return spring 容器工具类
*/
@Bean
public SpringHolder.ApplicationContextAwareStore springHolderAware() {
return new SpringHolder.ApplicationContextAwareStore();
}
}

Some files were not shown because too many files have changed in this diff Show More