⚡ 修改空返回值类型.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.orion.ops.module.asset.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.ops.framework.log.core.enums.IgnoreLogMode;
|
||||
@@ -48,9 +47,9 @@ public class AssetDataGrantServiceController {
|
||||
@PutMapping("/grant-host-group")
|
||||
@Operation(summary = "主机分组授权")
|
||||
@PreAuthorize("@ss.hasPermission('asset:host-group:grant')")
|
||||
public HttpWrapper<?> grantHostGroup(@RequestBody AssetDataGrantRequest request) {
|
||||
public Boolean grantHostGroup(@RequestBody AssetDataGrantRequest request) {
|
||||
assetDataGrantService.grantHostGroup(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@@ -65,9 +64,9 @@ public class AssetDataGrantServiceController {
|
||||
@PutMapping("/grant-host-key")
|
||||
@Operation(summary = "主机秘钥授权")
|
||||
@PreAuthorize("@ss.hasPermission('asset:host-key:grant')")
|
||||
public HttpWrapper<?> grantHostKey(@RequestBody AssetDataGrantRequest request) {
|
||||
public Boolean grantHostKey(@RequestBody AssetDataGrantRequest request) {
|
||||
assetDataGrantService.grantHostKey(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@@ -82,9 +81,9 @@ public class AssetDataGrantServiceController {
|
||||
@PutMapping("/grant-host-identity")
|
||||
@Operation(summary = "主机身份授权")
|
||||
@PreAuthorize("@ss.hasPermission('asset:host-identity:grant')")
|
||||
public HttpWrapper<?> grantHostIdentity(@RequestBody AssetDataGrantRequest request) {
|
||||
public Boolean grantHostIdentity(@RequestBody AssetDataGrantRequest request) {
|
||||
assetDataGrantService.grantHostIdentity(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.asset.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.common.utils.Valid;
|
||||
import com.orion.ops.framework.common.validator.group.Page;
|
||||
@@ -159,24 +158,24 @@ public class ExecCommandLogController {
|
||||
execLogService.downloadLogFile(id, SOURCE, response);
|
||||
}
|
||||
|
||||
@OperatorLog(ExecCommandLogOperatorType.INTERRUPT)
|
||||
@OperatorLog(value = ExecCommandLogOperatorType.INTERRUPT)
|
||||
@PutMapping("/interrupt")
|
||||
@Operation(summary = "中断批量执行命令")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-command-log:interrupt')")
|
||||
public HttpWrapper<?> interruptExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
public Boolean interruptExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
Long logId = Valid.notNull(request.getLogId());
|
||||
execLogService.interruptExec(logId, SOURCE);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@OperatorLog(ExecCommandLogOperatorType.INTERRUPT_HOST)
|
||||
@OperatorLog(value = ExecCommandLogOperatorType.INTERRUPT_HOST)
|
||||
@PutMapping("/interrupt-host")
|
||||
@Operation(summary = "中断批量执行主机命令")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-command-log:interrupt')")
|
||||
public HttpWrapper<?> interruptHostExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
public Boolean interruptHostExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
Long hostLogId = Valid.notNull(request.getHostLogId());
|
||||
execLogService.interruptHostExec(hostLogId, SOURCE);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.asset.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.common.validator.group.Page;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
@@ -103,9 +102,9 @@ public class ExecJobController {
|
||||
@PostMapping("/trigger")
|
||||
@Operation(summary = "手动触发计划任务")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job:trigger')")
|
||||
public HttpWrapper<?> triggerExecJob(@Validated @RequestBody ExecJobTriggerRequest request) {
|
||||
public Boolean triggerExecJob(@Validated @RequestBody ExecJobTriggerRequest request) {
|
||||
execJobService.manualTriggerExecJob(request.getId());
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.asset.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.common.utils.Valid;
|
||||
import com.orion.ops.framework.common.validator.group.Page;
|
||||
@@ -152,20 +151,20 @@ public class ExecJobLogController {
|
||||
@PutMapping("/interrupt")
|
||||
@Operation(summary = "中断计划任务命令")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:interrupt')")
|
||||
public HttpWrapper<?> interruptExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
public Boolean interruptExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
Long logId = Valid.notNull(request.getLogId());
|
||||
execLogService.interruptExec(logId, SOURCE);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@OperatorLog(ExecJobLogOperatorType.INTERRUPT_HOST)
|
||||
@PutMapping("/interrupt-host")
|
||||
@Operation(summary = "中断计划任务主机命令")
|
||||
@PreAuthorize("@ss.hasPermission('asset:exec-job-log:interrupt')")
|
||||
public HttpWrapper<?> interruptHostExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
public Boolean interruptHostExecCommand(@RequestBody ExecInterruptRequest request) {
|
||||
Long hostLogId = Valid.notNull(request.getHostLogId());
|
||||
execLogService.interruptHostExec(hostLogId, SOURCE);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.orion.ops.module.asset.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.ops.framework.log.core.enums.IgnoreLogMode;
|
||||
@@ -96,9 +95,9 @@ public class HostGroupController {
|
||||
@PutMapping("/update-rel")
|
||||
@Operation(summary = "修改分组内主机")
|
||||
@PreAuthorize("@ss.hasPermission('asset:host-group:update')")
|
||||
public HttpWrapper<?> updateHostGroupRel(@Validated @RequestBody HostGroupRelUpdateRequest request) {
|
||||
public Boolean updateHostGroupRel(@Validated @RequestBody HostGroupRelUpdateRequest request) {
|
||||
hostGroupService.updateHostGroupRel(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,8 +4,35 @@ Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
|
||||
{
|
||||
"remotePath": "",
|
||||
"description": ""
|
||||
"remotePath": "/root/batch",
|
||||
"description": "",
|
||||
"hostIdList": [
|
||||
1,
|
||||
7,
|
||||
8
|
||||
],
|
||||
"files": [
|
||||
{
|
||||
"fileId": "1",
|
||||
"filePath": "qr.txt",
|
||||
"fileSize": 3
|
||||
},
|
||||
{
|
||||
"fileId": "2",
|
||||
"filePath": "dir/key.txt",
|
||||
"fileSize": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
### 开始上传
|
||||
POST {{baseUrl}}/asset/upload-task/start
|
||||
Content-Type: application/json
|
||||
Authorization: {{token}}
|
||||
|
||||
{
|
||||
"id": 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.asset.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.common.validator.group.Page;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
@@ -57,18 +56,18 @@ public class UploadTaskController {
|
||||
@PostMapping("/start")
|
||||
@Operation(summary = "开始上传")
|
||||
@PreAuthorize("@ss.hasPermission('asset:upload-task:upload')")
|
||||
public HttpWrapper<?> startUploadTask(@Validated @RequestBody UploadTaskRequest request) {
|
||||
public Boolean startUploadTask(@Validated @RequestBody UploadTaskRequest request) {
|
||||
uploadTaskService.startUploadTask(request.getId());
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@OperatorLog(UploadTaskOperatorType.CANCEL)
|
||||
@PostMapping("/cancel")
|
||||
@Operation(summary = "取消上传")
|
||||
@PreAuthorize("@ss.hasPermission('asset:upload-task:upload')")
|
||||
public HttpWrapper<?> cancelUploadTask(@Validated @RequestBody UploadTaskRequest request) {
|
||||
public Boolean cancelUploadTask(@Validated @RequestBody UploadTaskRequest request) {
|
||||
uploadTaskService.cancelUploadTask(request.getId());
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
@@ -41,6 +42,7 @@ public class UploadTaskCreateRequest implements Serializable {
|
||||
@Schema(description = "上传主机id")
|
||||
private List<Long> hostIdList;
|
||||
|
||||
@Valid
|
||||
@NotEmpty
|
||||
@Schema(description = "上传文件")
|
||||
private List<UploadTaskFileRequest> files;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class UploadTaskFileRequest implements Serializable {
|
||||
private String filePath;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "文件发小")
|
||||
@Schema(description = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.orion.ops.module.infra.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.ops.framework.log.core.enums.IgnoreLogMode;
|
||||
@@ -52,9 +51,9 @@ public class AuthenticationController {
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@Operation(summary = "登出")
|
||||
@GetMapping("/logout")
|
||||
public HttpWrapper<?> logout(HttpServletRequest servletRequest) {
|
||||
public Boolean logout(HttpServletRequest servletRequest) {
|
||||
authenticationService.logout(servletRequest);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.infra.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.ops.framework.log.core.enums.IgnoreLogMode;
|
||||
@@ -76,9 +75,9 @@ public class DictKeyController {
|
||||
@PutMapping("/refresh-cache")
|
||||
@Operation(summary = "刷新字典缓存")
|
||||
@PreAuthorize("@ss.hasPermission('infra:dict-key:management:refresh-cache')")
|
||||
public HttpWrapper<?> refreshCache() {
|
||||
public Boolean refreshCache() {
|
||||
dictKeyService.refreshCache();
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@OperatorLog(DictKeyOperatorType.DELETE)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.infra.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.common.validator.group.Page;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
@@ -61,9 +60,9 @@ public class MineController {
|
||||
@OperatorLog(AuthenticationOperatorType.UPDATE_PASSWORD)
|
||||
@Operation(summary = "修改当前用户密码")
|
||||
@PutMapping("/update-password")
|
||||
public HttpWrapper<?> updateCurrentUserPassword(@Validated @RequestBody UserUpdatePasswordRequest request) {
|
||||
public Boolean updateCurrentUserPassword(@Validated @RequestBody UserUpdatePasswordRequest request) {
|
||||
mineService.updateCurrentUserPassword(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@@ -82,9 +81,9 @@ public class MineController {
|
||||
|
||||
@PutMapping("/offline-session")
|
||||
@Operation(summary = "下线当前用户会话")
|
||||
public HttpWrapper<?> offlineCurrentUserSession(@Validated @RequestBody UserSessionOfflineRequest request) {
|
||||
public Boolean offlineCurrentUserSession(@Validated @RequestBody UserSessionOfflineRequest request) {
|
||||
mineService.offlineCurrentUserSession(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.orion.ops.module.infra.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.log.core.annotation.IgnoreLog;
|
||||
import com.orion.ops.framework.log.core.enums.IgnoreLogMode;
|
||||
import com.orion.ops.framework.web.core.annotation.RestWrapper;
|
||||
@@ -42,9 +41,9 @@ public class PermissionController {
|
||||
@PutMapping("/refresh-cache")
|
||||
@Operation(summary = "刷新角色权限缓存")
|
||||
@PreAuthorize("@ss.hasPermission('infra:system-menu:management:refresh-cache')")
|
||||
public HttpWrapper<?> refreshCache() {
|
||||
public Boolean refreshCache() {
|
||||
permissionService.initPermissionCache();
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.orion.ops.module.infra.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.ops.framework.web.core.annotation.RestWrapper;
|
||||
import com.orion.ops.module.infra.entity.request.preference.PreferenceUpdatePartialRequest;
|
||||
import com.orion.ops.module.infra.entity.request.preference.PreferenceUpdateRequest;
|
||||
@@ -43,9 +42,9 @@ public class PreferenceController {
|
||||
|
||||
@PutMapping("/update-partial")
|
||||
@Operation(summary = "更新用户偏好-部分")
|
||||
public HttpWrapper<?> updatePreferencePartial(@Validated @RequestBody PreferenceUpdatePartialRequest request) {
|
||||
public Boolean updatePreferencePartial(@Validated @RequestBody PreferenceUpdatePartialRequest request) {
|
||||
preferenceService.updatePreferencePartial(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.infra.controller;
|
||||
|
||||
import com.orion.lang.define.wrapper.DataGrid;
|
||||
import com.orion.lang.define.wrapper.HttpWrapper;
|
||||
import com.orion.lang.utils.collect.Lists;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||
import com.orion.ops.framework.common.validator.group.Page;
|
||||
@@ -100,9 +99,9 @@ public class SystemUserController {
|
||||
@PutMapping("/reset-password")
|
||||
@Operation(summary = "重置用户密码")
|
||||
@PreAuthorize("@ss.hasPermission('infra:system-user:management:reset-password')")
|
||||
public HttpWrapper<?> resetUserPassword(@Validated @RequestBody UserResetPasswordRequest request) {
|
||||
public Boolean resetUserPassword(@Validated @RequestBody UserResetPasswordRequest request) {
|
||||
systemUserService.resetPassword(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@@ -159,9 +158,9 @@ public class SystemUserController {
|
||||
@PutMapping("/session/offline")
|
||||
@Operation(summary = "下线用户会话")
|
||||
@PreAuthorize("@ss.hasPermission('infra:system-user:management:offline-session')")
|
||||
public HttpWrapper<?> offlineUserSession(@Validated @RequestBody UserSessionOfflineRequest request) {
|
||||
public Boolean offlineUserSession(@Validated @RequestBody UserSessionOfflineRequest request) {
|
||||
systemUserManagementService.offlineUserSession(request);
|
||||
return HttpWrapper.ok();
|
||||
return true;
|
||||
}
|
||||
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
|
||||
@@ -8,7 +8,6 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 字典配置项 缓存对象
|
||||
|
||||
@@ -4,8 +4,6 @@ import com.orion.ops.framework.common.entity.PageRequest;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收藏 查询请求对象
|
||||
*
|
||||
|
||||
@@ -7,7 +7,6 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 字典配置项 视图响应对象
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.orion.ops.module.infra.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色 视图响应对象
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.orion.ops.module.infra.service;
|
||||
|
||||
import com.orion.ops.module.infra.entity.request.data.DataPermissionUpdateRequest;
|
||||
import com.orion.ops.module.infra.enums.DataPermissionTypeEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user