✨ 添加预览模式.
This commit is contained in:
@@ -13,6 +13,7 @@ services:
|
||||
- REDIS_HOST=orion-visor-redis
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
- SECRET_KEY=uQeacXV8b3isvKLK
|
||||
- PREVIEW=false
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-service/root-orion:/root/orion
|
||||
depends_on:
|
||||
|
||||
@@ -86,6 +86,8 @@ public enum ErrorCode implements CodeInfo {
|
||||
|
||||
UNSUPPOETED(915, "不支持此操作"),
|
||||
|
||||
PREVIEW_DISABLE_API(916, "预览模式不支持此功能"),
|
||||
|
||||
;
|
||||
|
||||
ErrorCode(int code, String message) {
|
||||
|
||||
@@ -72,7 +72,7 @@ public class OrionOperatorLogAutoConfiguration {
|
||||
OperatorLogs.setSerializeFilters(serializeFilters);
|
||||
OperatorLogFiller.setSerializeFilters(serializeFilters);
|
||||
OperatorLogFiller.setOperatorLogConfig(operatorLogConfig);
|
||||
return new OperatorLogAspect(operatorLogConfig, service, serializeFilters);
|
||||
return new OperatorLogAspect(service);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.orion.visor.framework.biz.operator.log.core.aspect;
|
||||
|
||||
import com.alibaba.fastjson.serializer.SerializeFilter;
|
||||
import com.orion.lang.define.thread.ExecutorBuilder;
|
||||
import com.orion.lang.utils.Arrays1;
|
||||
import com.orion.lang.utils.Strings;
|
||||
import com.orion.visor.framework.biz.operator.log.configuration.config.OperatorLogConfig;
|
||||
import com.orion.visor.framework.biz.operator.log.core.annotation.IgnoreParameter;
|
||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.biz.operator.log.core.factory.OperatorTypeHolder;
|
||||
@@ -53,21 +51,13 @@ public class OperatorLogAspect {
|
||||
.useLinkedBlockingQueue()
|
||||
.build();
|
||||
|
||||
private final OperatorLogConfig operatorLogConfig;
|
||||
|
||||
private final OperatorLogFrameworkService operatorLogFrameworkService;
|
||||
|
||||
private final SerializeFilter[] serializeFilters;
|
||||
|
||||
@Resource
|
||||
private SecurityHolder securityHolder;
|
||||
|
||||
public OperatorLogAspect(OperatorLogConfig operatorLogConfig,
|
||||
OperatorLogFrameworkService operatorLogFrameworkService,
|
||||
SerializeFilter[] serializeFilters) {
|
||||
this.operatorLogConfig = operatorLogConfig;
|
||||
public OperatorLogAspect(OperatorLogFrameworkService operatorLogFrameworkService) {
|
||||
this.operatorLogFrameworkService = operatorLogFrameworkService;
|
||||
this.serializeFilters = serializeFilters;
|
||||
}
|
||||
|
||||
@Around("@annotation(o)")
|
||||
|
||||
@@ -27,6 +27,7 @@ public class ServerTemplate extends Template {
|
||||
table.bizPackage = bizPackage;
|
||||
table.enableUnitTest = true;
|
||||
table.enableOperatorLog = true;
|
||||
table.enablePreviewApi = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,6 +103,16 @@ public class ServerTemplate extends Template {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否生成预览 api 注解
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
public ServerTemplate disablePreviewApi() {
|
||||
table.enablePreviewApi = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 cache
|
||||
*
|
||||
|
||||
@@ -58,6 +58,11 @@ public class Table {
|
||||
*/
|
||||
protected boolean enableOperatorLog;
|
||||
|
||||
/**
|
||||
* 是否生成预览 api 注解
|
||||
*/
|
||||
protected boolean enablePreviewApi;
|
||||
|
||||
/**
|
||||
* 缓存的 key
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
#end
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
#if($meta.enablePreviewApi)
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
#end
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import ${package.Service}.*;
|
||||
@@ -51,6 +54,9 @@ public class ${table.controllerName} {
|
||||
@Resource
|
||||
private ${type}Service ${typeLower}Service;
|
||||
|
||||
#if($meta.enablePreviewApi)
|
||||
@PreviewDisableApi
|
||||
#end
|
||||
#if($meta.enableOperatorLog)
|
||||
@OperatorLog(${type}OperatorType.CREATE)
|
||||
#end
|
||||
@@ -61,6 +67,9 @@ public class ${table.controllerName} {
|
||||
return ${typeLower}Service.create${type}(request);
|
||||
}
|
||||
|
||||
#if($meta.enablePreviewApi)
|
||||
@PreviewDisableApi
|
||||
#end
|
||||
#if($meta.enableOperatorLog)
|
||||
@OperatorLog(${type}OperatorType.UPDATE)
|
||||
#end
|
||||
@@ -105,6 +114,9 @@ public class ${table.controllerName} {
|
||||
return ${typeLower}Service.get${type}Page(request);
|
||||
}
|
||||
|
||||
#if($meta.enablePreviewApi)
|
||||
@PreviewDisableApi
|
||||
#end
|
||||
#if($meta.enableOperatorLog)
|
||||
@OperatorLog(${type}OperatorType.DELETE)
|
||||
#end
|
||||
@@ -116,6 +128,9 @@ public class ${table.controllerName} {
|
||||
return ${typeLower}Service.delete${type}ById(id);
|
||||
}
|
||||
|
||||
#if($meta.enablePreviewApi)
|
||||
@PreviewDisableApi
|
||||
#end
|
||||
#if($meta.enableOperatorLog)
|
||||
@OperatorLog(${type}OperatorType.DELETE)
|
||||
#end
|
||||
|
||||
@@ -126,9 +126,11 @@ public class OrionSecurityAutoConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return security holder 代理用于内部 framework 调用
|
||||
* <p>
|
||||
* - mybatis fill
|
||||
* - operator log
|
||||
* - log printer
|
||||
*
|
||||
* @return security holder 代理用于内部 framework 调用
|
||||
*/
|
||||
@Bean
|
||||
public SecurityHolderDelegate securityHolder() {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.orion.lang.utils.collect.Lists;
|
||||
import com.orion.visor.framework.common.constant.AutoConfigureOrderConst;
|
||||
import com.orion.visor.framework.common.constant.FilterOrderConst;
|
||||
import com.orion.visor.framework.common.web.filter.FilterCreator;
|
||||
import com.orion.visor.framework.web.core.aspect.PreviewDisableApiAspect;
|
||||
import com.orion.visor.framework.web.core.filter.TraceIdFilter;
|
||||
import com.orion.visor.framework.web.core.handler.GlobalExceptionHandler;
|
||||
import com.orion.visor.framework.web.core.handler.WrapperResultHandler;
|
||||
@@ -139,4 +140,13 @@ public class OrionWebAutoConfiguration implements WebMvcConfigurer {
|
||||
return FilterCreator.create(new TraceIdFilter(), FilterOrderConst.TRICE_ID_FILTER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 预览模式禁用 api 切面
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnProperty(value = "orion.preview", havingValue = "true")
|
||||
public PreviewDisableApiAspect previewDisableApiAspect() {
|
||||
return new PreviewDisableApiAspect();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.orion.visor.framework.web.core.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 预览禁用 api
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/5/21 16:44
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface PreviewDisableApi {
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.orion.visor.framework.web.core.aspect;
|
||||
|
||||
import com.orion.visor.framework.common.constant.ErrorCode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
|
||||
/**
|
||||
* 预览禁用 api 切面
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/5/21 16:52
|
||||
*/
|
||||
@Aspect
|
||||
@Slf4j
|
||||
public class PreviewDisableApiAspect {
|
||||
|
||||
public PreviewDisableApiAspect() {
|
||||
}
|
||||
|
||||
@Around("@annotation(o)")
|
||||
public Object around(ProceedingJoinPoint joinPoint, PreviewDisableApi o) {
|
||||
throw ErrorCode.PREVIEW_DISABLE_API.exception();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,12 @@
|
||||
"type": "java.lang.String",
|
||||
"description": "项目版本."
|
||||
},
|
||||
{
|
||||
"name": "orion.preview",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "是否为预览模式.",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"name": "orion.api.prefix",
|
||||
"type": "java.lang.String",
|
||||
|
||||
@@ -41,6 +41,8 @@ knife4j:
|
||||
enable: false
|
||||
|
||||
orion:
|
||||
# 是否为预览模式
|
||||
preview: ${PREVIEW:false}
|
||||
logging:
|
||||
printer:
|
||||
mode: ROW
|
||||
|
||||
@@ -190,6 +190,8 @@ app:
|
||||
orion:
|
||||
# 版本
|
||||
version: @revision@
|
||||
# 是否为预览模式
|
||||
preview: false
|
||||
api:
|
||||
# 公共 api 前缀
|
||||
prefix: /orion-visor/api
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.orion.visor.module.asset.controller;
|
||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.asset.define.operator.HostOperatorType;
|
||||
import com.orion.visor.module.asset.entity.request.host.HostConfigUpdateRequest;
|
||||
@@ -59,6 +60,7 @@ public class HostConfigController {
|
||||
return hostConfigService.getHostConfigList(hostId);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(HostOperatorType.UPDATE_CONFIG)
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新主机配置")
|
||||
@@ -67,6 +69,7 @@ public class HostConfigController {
|
||||
return hostConfigService.updateHostConfig(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(HostOperatorType.UPDATE_CONFIG_STATUS)
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "更新主机配置状态/动态初始化配置")
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.orion.visor.framework.common.validator.group.Id;
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.asset.define.operator.HostConnectLogOperatorType;
|
||||
import com.orion.visor.module.asset.entity.request.host.HostConnectLogQueryRequest;
|
||||
@@ -88,6 +89,7 @@ public class HostConnectLogController {
|
||||
return hostConnectLogService.clearHostConnectLog(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(HostConnectLogOperatorType.FORCE_OFFLINE)
|
||||
@PutMapping("/force-offline")
|
||||
@Operation(summary = "强制断开主机连接")
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.asset.define.operator.HostOperatorType;
|
||||
import com.orion.visor.module.asset.entity.request.host.HostCreateRequest;
|
||||
@@ -83,6 +84,7 @@ public class HostController {
|
||||
return hostService.getHostPage(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(HostOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "通过 id 删除主机")
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.orion.visor.module.asset.controller;
|
||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.asset.define.operator.HostGroupOperatorType;
|
||||
import com.orion.visor.module.asset.entity.request.host.HostGroupRelUpdateRequest;
|
||||
@@ -74,6 +75,7 @@ public class HostGroupController {
|
||||
return hostGroupService.moveHostGroup(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(HostGroupOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除主机分组")
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.asset.define.operator.HostIdentityOperatorType;
|
||||
import com.orion.visor.module.asset.entity.request.host.HostIdentityCreateRequest;
|
||||
@@ -50,6 +51,7 @@ public class HostIdentityController {
|
||||
return hostIdentityService.createHostIdentity(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(HostIdentityOperatorType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "通过 id 更新主机身份")
|
||||
@@ -84,6 +86,7 @@ public class HostIdentityController {
|
||||
return hostIdentityService.getHostIdentityPage(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(HostIdentityOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "通过 id 删除主机身份")
|
||||
|
||||
@@ -4,10 +4,10 @@ Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
|
||||
{
|
||||
"key": "",
|
||||
"valueType": "",
|
||||
"extraSchema": "",
|
||||
"description": ""
|
||||
"keyName": "operatorLogType",
|
||||
"valueType": "1",
|
||||
"extraSchema": "{}",
|
||||
"description": "1"
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Authorization: {{token}}
|
||||
|
||||
{
|
||||
"id": "",
|
||||
"key": "",
|
||||
"keyName": "",
|
||||
"valueType": "",
|
||||
"extraSchema": "",
|
||||
"description": ""
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.infra.define.operator.DictKeyOperatorType;
|
||||
import com.orion.visor.module.infra.entity.request.dict.DictKeyCreateRequest;
|
||||
@@ -41,6 +42,7 @@ public class DictKeyController {
|
||||
@Resource
|
||||
private DictKeyService dictKeyService;
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictKeyOperatorType.CREATE)
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建字典配置项")
|
||||
@@ -49,6 +51,7 @@ public class DictKeyController {
|
||||
return dictKeyService.createDictKey(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictKeyOperatorType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新字典配置项")
|
||||
@@ -80,6 +83,7 @@ public class DictKeyController {
|
||||
return true;
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictKeyOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除字典配置项")
|
||||
@@ -89,6 +93,7 @@ public class DictKeyController {
|
||||
return dictKeyService.deleteDictKeyById(id);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictKeyOperatorType.DELETE)
|
||||
@DeleteMapping("/batch-delete")
|
||||
@Operation(summary = "批量删除字典配置项")
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.infra.define.operator.DictValueOperatorType;
|
||||
import com.orion.visor.module.infra.entity.request.dict.DictValueCreateRequest;
|
||||
@@ -45,6 +46,7 @@ public class DictValueController {
|
||||
@Resource
|
||||
private DictValueService dictValueService;
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictValueOperatorType.CREATE)
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建字典配置值")
|
||||
@@ -53,6 +55,7 @@ public class DictValueController {
|
||||
return dictValueService.createDictValue(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictValueOperatorType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新字典配置值")
|
||||
@@ -61,6 +64,7 @@ public class DictValueController {
|
||||
return dictValueService.updateDictValueById(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictValueOperatorType.UPDATE)
|
||||
@PutMapping("/rollback")
|
||||
@Operation(summary = "回滚字典配置值")
|
||||
@@ -84,6 +88,7 @@ public class DictValueController {
|
||||
return dictValueService.getDictValuePage(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictValueOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除字典配置值")
|
||||
@@ -93,6 +98,7 @@ public class DictValueController {
|
||||
return dictValueService.deleteDictValueById(id);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(DictValueOperatorType.DELETE)
|
||||
@DeleteMapping("/batch-delete")
|
||||
@Operation(summary = "批量删除字典配置值")
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.infra.define.operator.AuthenticationOperatorType;
|
||||
import com.orion.visor.module.infra.entity.request.operator.OperatorLogQueryRequest;
|
||||
@@ -57,6 +58,7 @@ public class MineController {
|
||||
return mineService.updateCurrentUser(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(AuthenticationOperatorType.UPDATE_PASSWORD)
|
||||
@Operation(summary = "修改当前用户密码")
|
||||
@PutMapping("/update-password")
|
||||
@@ -79,6 +81,7 @@ public class MineController {
|
||||
return mineService.getCurrentUserSessionList();
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@PutMapping("/offline-session")
|
||||
@Operation(summary = "下线当前用户会话")
|
||||
public Boolean offlineCurrentUserSession(@Validated @RequestBody UserSessionOfflineRequest request) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.orion.visor.module.infra.controller;
|
||||
import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.infra.define.operator.SystemMenuOperatorType;
|
||||
import com.orion.visor.module.infra.entity.request.menu.SystemMenuCreateRequest;
|
||||
@@ -41,6 +42,7 @@ public class SystemMenuController {
|
||||
@Resource
|
||||
private SystemMenuService systemMenuService;
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemMenuOperatorType.CREATE)
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建菜单")
|
||||
@@ -49,6 +51,7 @@ public class SystemMenuController {
|
||||
return systemMenuService.createSystemMenu(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemMenuOperatorType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "通过 id 更新菜单")
|
||||
@@ -57,6 +60,7 @@ public class SystemMenuController {
|
||||
return systemMenuService.updateSystemMenuById(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemMenuOperatorType.UPDATE_STATUS)
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "通过 id 级联更新菜单状态")
|
||||
@@ -82,6 +86,7 @@ public class SystemMenuController {
|
||||
return systemMenuService.getSystemMenuByIdList(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemMenuOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "通过 id 级联删除菜单")
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.infra.define.operator.SystemRoleOperatorType;
|
||||
import com.orion.visor.module.infra.entity.request.menu.SystemRoleGrantMenuRequest;
|
||||
@@ -64,6 +65,7 @@ public class SystemRoleController {
|
||||
return systemRoleService.updateSystemRoleById(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemRoleOperatorType.UPDATE_STATUS)
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "通过 id 更新角色状态")
|
||||
@@ -105,6 +107,7 @@ public class SystemRoleController {
|
||||
return systemRoleMenuService.getRoleMenuIdList(roleId);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemRoleOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "通过 id 删除角色")
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.visor.framework.web.core.annotation.PreviewDisableApi;
|
||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.visor.module.infra.define.operator.SystemUserOperatorType;
|
||||
import com.orion.visor.module.infra.entity.request.user.*;
|
||||
@@ -73,6 +74,7 @@ public class SystemUserController {
|
||||
|
||||
// TODO 修改头像 最后再说 可有可无的功能 要是有 http 文件需求就写
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemUserOperatorType.UPDATE_STATUS)
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "修改用户状态")
|
||||
@@ -95,6 +97,7 @@ public class SystemUserController {
|
||||
}
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemUserOperatorType.RESET_PASSWORD)
|
||||
@PutMapping("/reset-password")
|
||||
@Operation(summary = "重置用户密码")
|
||||
@@ -137,6 +140,7 @@ public class SystemUserController {
|
||||
return systemUserService.getSystemUserPage(request);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemUserOperatorType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "通过 id 删除用户")
|
||||
@@ -154,6 +158,7 @@ public class SystemUserController {
|
||||
return systemUserManagementService.getUserSessionList(id);
|
||||
}
|
||||
|
||||
@PreviewDisableApi
|
||||
@OperatorLog(SystemUserOperatorType.OFFLINE)
|
||||
@PutMapping("/session/offline")
|
||||
@Operation(summary = "下线用户会话")
|
||||
|
||||
Reference in New Issue
Block a user