修改初始化操作类型逻辑.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
package com.orion.ops.module.asset.define.operator;
|
||||
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.Module;
|
||||
import com.orion.ops.framework.biz.operator.log.core.factory.InitializingOperatorTypes;
|
||||
import com.orion.ops.framework.biz.operator.log.core.model.OperatorType;
|
||||
|
||||
import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel.H;
|
||||
import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel.L;
|
||||
import static com.orion.ops.framework.biz.operator.log.core.holder.OperatorTypeHolder.set;
|
||||
|
||||
/**
|
||||
* 主机身份 操作日志类型
|
||||
@@ -13,9 +14,8 @@ import static com.orion.ops.framework.biz.operator.log.core.holder.OperatorTypeH
|
||||
* @version 1.0.0
|
||||
* @since 2023/10/10 17:30
|
||||
*/
|
||||
public class HostIdentityOperatorType {
|
||||
|
||||
private static final String MODULE = "asset:host-identity";
|
||||
@Module("asset:host-identity")
|
||||
public class HostIdentityOperatorType extends InitializingOperatorTypes {
|
||||
|
||||
public static final String CREATE = "host-identity:create";
|
||||
|
||||
@@ -23,10 +23,13 @@ public class HostIdentityOperatorType {
|
||||
|
||||
public static final String DELETE = "host-identity:delete";
|
||||
|
||||
public static void init() {
|
||||
set(new OperatorType(L, MODULE, CREATE, "创建主机身份 <sb>${name}</sb>"));
|
||||
set(new OperatorType(L, MODULE, UPDATE, "修改主机身份 <sb>${name}</sb>"));
|
||||
set(new OperatorType(H, MODULE, DELETE, "删除主机身份 <sb>${name}</sb>"));
|
||||
@Override
|
||||
public OperatorType[] types() {
|
||||
return new OperatorType[]{
|
||||
new OperatorType(L, CREATE, "创建主机身份 <sb>${name}</sb>"),
|
||||
new OperatorType(L, UPDATE, "修改主机身份 <sb>${name}</sb>"),
|
||||
new OperatorType(H, DELETE, "删除主机身份 <sb>${name}</sb>"),
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.orion.ops.module.asset.define.operator;
|
||||
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.Module;
|
||||
import com.orion.ops.framework.biz.operator.log.core.factory.InitializingOperatorTypes;
|
||||
import com.orion.ops.framework.biz.operator.log.core.model.OperatorType;
|
||||
|
||||
import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel.H;
|
||||
import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel.L;
|
||||
import static com.orion.ops.framework.biz.operator.log.core.holder.OperatorTypeHolder.set;
|
||||
|
||||
/**
|
||||
* 主机秘钥 操作日志类型
|
||||
@@ -13,9 +14,8 @@ import static com.orion.ops.framework.biz.operator.log.core.holder.OperatorTypeH
|
||||
* @version 1.0.0
|
||||
* @since 2023/10/10 17:30
|
||||
*/
|
||||
public class HostKeyOperatorType {
|
||||
|
||||
private static final String MODULE = "asset:host-key";
|
||||
@Module("asset:host-key")
|
||||
public class HostKeyOperatorType extends InitializingOperatorTypes {
|
||||
|
||||
public static final String CREATE = "host-key:create";
|
||||
|
||||
@@ -23,10 +23,13 @@ public class HostKeyOperatorType {
|
||||
|
||||
public static final String DELETE = "host-key:delete";
|
||||
|
||||
public static void init() {
|
||||
set(new OperatorType(L, MODULE, CREATE, "创建主机秘钥 <sb>${name}</sb>"));
|
||||
set(new OperatorType(L, MODULE, UPDATE, "修改主机秘钥 <sb>${name}</sb>"));
|
||||
set(new OperatorType(H, MODULE, DELETE, "删除主机秘钥 <sb>${name}</sb>"));
|
||||
@Override
|
||||
public OperatorType[] types() {
|
||||
return new OperatorType[]{
|
||||
new OperatorType(L, CREATE, "创建主机秘钥 <sb>${name}</sb>"),
|
||||
new OperatorType(L, UPDATE, "修改主机秘钥 <sb>${name}</sb>"),
|
||||
new OperatorType(H, DELETE, "删除主机秘钥 <sb>${name}</sb>"),
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.orion.ops.module.asset.define.operator;
|
||||
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.Module;
|
||||
import com.orion.ops.framework.biz.operator.log.core.factory.InitializingOperatorTypes;
|
||||
import com.orion.ops.framework.biz.operator.log.core.model.OperatorType;
|
||||
|
||||
import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel.*;
|
||||
import static com.orion.ops.framework.biz.operator.log.core.holder.OperatorTypeHolder.set;
|
||||
|
||||
/**
|
||||
* 主机 操作日志类型
|
||||
@@ -12,9 +13,8 @@ import static com.orion.ops.framework.biz.operator.log.core.holder.OperatorTypeH
|
||||
* @version 1.0.0
|
||||
* @since 2023/10/10 17:30
|
||||
*/
|
||||
public class HostOperatorType {
|
||||
|
||||
private static final String MODULE = "asset:host";
|
||||
@Module("asset:host")
|
||||
public class HostOperatorType extends InitializingOperatorTypes {
|
||||
|
||||
public static final String CREATE = "host:create";
|
||||
|
||||
@@ -26,12 +26,15 @@ public class HostOperatorType {
|
||||
|
||||
public static final String UPDATE_CONFIG_STATUS = "host:update-config-status";
|
||||
|
||||
public static void init() {
|
||||
set(new OperatorType(L, MODULE, CREATE, "创建主机 <sb>${name}</sb>"));
|
||||
set(new OperatorType(L, MODULE, UPDATE, "修改主机 <sb>${name}</sb>"));
|
||||
set(new OperatorType(H, MODULE, DELETE, "删除主机 <sb>${name}</sb>"));
|
||||
set(new OperatorType(M, MODULE, UPDATE_CONFIG, "修改主机配置 <sb>${name}</sb> | <sb>${type}</sb>"));
|
||||
set(new OperatorType(M, MODULE, UPDATE_CONFIG_STATUS, "修改主机配置状态 <sb>${name}</sb> | <sb>${type}</sb> - <sb>${statusName}</sb>"));
|
||||
@Override
|
||||
public OperatorType[] types() {
|
||||
return new OperatorType[]{
|
||||
new OperatorType(L, CREATE, "创建主机 <sb>${name}</sb>"),
|
||||
new OperatorType(L, UPDATE, "修改主机 <sb>${name}</sb>"),
|
||||
new OperatorType(H, DELETE, "删除主机 <sb>${name}</sb>"),
|
||||
new OperatorType(M, UPDATE_CONFIG, "修改主机配置 <sb>${name}</sb> | <sb>${type}</sb>"),
|
||||
new OperatorType(M, UPDATE_CONFIG_STATUS, "修改主机配置状态 <sb>${name}</sb> | <sb>${type}</sb> - <sb>${statusName}</sb>"),
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.orion.ops.module.asset.runner;
|
||||
|
||||
import com.orion.ops.module.asset.define.operator.HostIdentityOperatorType;
|
||||
import com.orion.ops.module.asset.define.operator.HostKeyOperatorType;
|
||||
import com.orion.ops.module.asset.define.operator.HostOperatorType;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 资产模块 操作类型初始化
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/10/10 18:03
|
||||
*/
|
||||
@Component
|
||||
public class AssetOperatorTypeRunner implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
HostOperatorType.init();
|
||||
HostKeyOperatorType.init();
|
||||
HostIdentityOperatorType.init();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user