Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
lijiahangmax
2025-03-07 22:03:52 +08:00
12 changed files with 57 additions and 66 deletions

View File

@@ -20,21 +20,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.launch.configuration;
package org.dromara.visor.common.configuration;
import cn.orionsec.kit.spring.SpringHolder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 应用配置类
* spring 配置类
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/20 10:34
*/
@Configuration
public class LaunchApplicationConfiguration {
public class SpringConfiguration {
/**
* @return spring 容器工具类

View File

@@ -8,7 +8,7 @@ const $vue.moduleConst: AppRouteRecordRaw = {
children: [
{
name: '$vue.featureEntityFirstLower',
path: '/$vue.feature',
path: '/$vue.module/$vue.feature',
component: () => import('@/views/$vue.module/$vue.feature/index.vue'),
},
],

View File

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

View File

@@ -42,7 +42,11 @@ import java.util.Optional;
* @version 1.0.0
* @since 2023/6/19 16:55
*/
@SpringBootApplication(scanBasePackages = {"org.dromara.visor.launch", "org.dromara.visor.module"})
@SpringBootApplication(scanBasePackages = {
"org.dromara.visor.launch",
"org.dromara.visor.common",
"org.dromara.visor.module"
})
public class LaunchApplication {
public static void main(String[] args) {

View File

@@ -82,6 +82,10 @@
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-job</artifactId>
</dependency>
<dependency>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -135,13 +135,6 @@ public interface HostService {
*/
void deleteHostRelByIdListAsync(List<Long> idList);
/**
* 获取当前更新配置的 hostId
*
* @return hostId
*/
Long getCurrentUpdateConfigHostId();
/**
* 清除缓存
*/

View File

@@ -83,8 +83,6 @@ import java.util.stream.Collectors;
@Service
public class HostServiceImpl implements HostService {
private static final ThreadLocal<Long> CURRENT_UPDATE_CONFIG_ID = new ThreadLocal<>();
@Resource
private HostDAO hostDAO;
@@ -185,8 +183,6 @@ public class HostServiceImpl implements HostService {
OperatorLogs.add(ExtraFieldConst.CONFIG, param);
log.info("HostService-updateHostConfig request: {}", param);
Long id = request.getId();
try {
CURRENT_UPDATE_CONFIG_ID.set(id);
// 查询主机信息
HostDO host = hostDAO.selectById(id);
Valid.notNull(host, ErrorMessage.HOST_ABSENT);
@@ -206,9 +202,6 @@ public class HostServiceImpl implements HostService {
int effect = hostDAO.updateById(updateHost);
log.info("HostService-updateHostConfig effect: {}", effect);
return effect;
} finally {
CURRENT_UPDATE_CONFIG_ID.remove();
}
}
@Override
@@ -348,11 +341,6 @@ public class HostServiceImpl implements HostService {
dataExtraApi.deleteByRelIdList(DataExtraTypeEnum.HOST, idList);
}
@Override
public Long getCurrentUpdateConfigHostId() {
return CURRENT_UPDATE_CONFIG_ID.get();
}
@Override
public void clearCache() {
RedisMaps.scanKeysDelete(HostCacheKeyDefine.HOST_INFO.format("*"));

View File

@@ -8,17 +8,17 @@ const ASSET_AUDIT: AppRouteRecordRaw = {
children: [
{
name: 'connectLog',
path: '/connect-log',
path: '/audit/connect-log',
component: () => import('@/views/asset-audit/connect-log/index.vue'),
},
{
name: 'connectSession',
path: '/connect-session',
path: '/audit/connect-session',
component: () => import('@/views/asset-audit/connect-session/index.vue'),
},
{
name: 'sftpLog',
path: '/sftp-log',
path: '/audit/sftp-log',
component: () => import('@/views/asset-audit/sftp-log/index.vue'),
},
],

View File

@@ -8,19 +8,19 @@ const ASSET: AppRouteRecordRaw = {
children: [
{
name: 'hostList',
path: '/host-list',
path: '/asset/host',
component: () => import('@/views/asset/host-list/index.vue'),
}, {
name: 'hostKey',
path: '/host-key',
path: '/asset/host-key',
component: () => import('@/views/asset/host-key/index.vue'),
}, {
name: 'hostIdentity',
path: '/host-identity',
path: '/asset/host-identity',
component: () => import('@/views/asset/host-identity/index.vue'),
}, {
name: 'assetGrant',
path: '/asset-grant',
path: '/asset/grant',
component: () => import('@/views/asset/grant/index.vue'),
},
],

View File

@@ -9,37 +9,37 @@ const EXEC: Array<AppRouteRecordRaw> = [
children: [
{
name: 'execCommand',
path: '/exec-command',
path: '/exec/command',
component: () => import('@/views/exec/exec-command/index.vue'),
},
{
name: 'execCommandLog',
path: '/exec-log',
path: '/exec/command-log',
component: () => import('@/views/exec/exec-command-log/index.vue'),
},
{
name: 'execJob',
path: '/exec-job',
path: '/exec/job',
component: () => import('@/views/exec/exec-job/index.vue'),
},
{
name: 'execJobLog',
path: '/exec-job-log',
path: '/exec/job-log',
component: () => import('@/views/exec/exec-job-log/index.vue'),
},
{
name: 'batchUpload',
path: '/batch-upload',
path: '/exec/upload',
component: () => import('@/views/exec/batch-upload/index.vue'),
},
{
name: 'uploadTask',
path: '/upload-task',
path: '/exec/upload-task',
component: () => import('@/views/exec/upload-task/index.vue'),
},
{
name: 'execTemplate',
path: '/exec-template',
path: '/exec/template',
component: () => import('@/views/exec/exec-template/index.vue'),
},
],
@@ -50,7 +50,7 @@ const EXEC: Array<AppRouteRecordRaw> = [
children: [
{
name: 'execJobLogView',
path: '/job-log-view',
path: '/exec/job-log/view',
component: () => import('@/views/exec/exec-job-log-view/index.vue'),
},
],

View File

@@ -8,17 +8,17 @@ const SYSTEM: AppRouteRecordRaw = {
children: [
{
name: 'systemMenu',
path: '/menu',
path: '/system/menu',
component: () => import('@/views/system/menu/index.vue'),
},
{
name: 'dictKey',
path: '/dict-key',
path: '/system/dict-key',
component: () => import('@/views/system/dict-key/index.vue'),
},
{
name: 'dictValue',
path: '/dict-value',
path: '/system/dict-value',
component: () => import('@/views/system/dict-value/index.vue'),
},
{

View File

@@ -8,22 +8,22 @@ const USER: AppRouteRecordRaw = {
children: [
{
name: 'role',
path: '/role',
path: '/user/role',
component: () => import('@/views/user/role/index.vue'),
},
{
name: 'user',
path: '/user',
path: '/user/list',
component: () => import('@/views/user/user/index.vue'),
},
{
name: 'userInfo',
path: '/user-info',
path: '/user/info',
component: () => import('@/views/user/info/index.vue'),
},
{
name: 'operatorLog',
path: '/operator-log',
path: '/user/operator-log',
component: () => import('@/views/user/operator-log/index.vue'),
},
],