refactor: 优化系统日志、在线用户、存储管理、部门管理相关代码
This commit is contained in:
parent
e2d0be1ba0
commit
a2e4f9a28b
@ -51,7 +51,7 @@ public class DeptResp extends BaseDetailResp {
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "名称", example = "测试部")
|
||||
@ExcelProperty(value = "名称")
|
||||
@ExcelProperty(value = "名称", order = 2)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
@ -60,41 +60,42 @@ public class DeptResp extends BaseDetailResp {
|
||||
@Schema(description = "上级部门 ID", example = "2")
|
||||
@ConditionOnExpression(value = "#target.parentId != 0")
|
||||
@AssembleMethod(targetType = DeptService.class, method = @ContainerMethod(bindMethod = "get", resultType = DeptResp.class), props = @Mapping(src = "name", ref = "parentName"))
|
||||
@ExcelProperty(value = "上级部门 ID", order = 3)
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 上级部门
|
||||
*/
|
||||
@Schema(description = "上级部门", example = "天津总部")
|
||||
@ExcelProperty(value = "上级部门")
|
||||
@ExcelProperty(value = "上级部门", order = 4)
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
|
||||
@ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class)
|
||||
@ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class, order = 5)
|
||||
private DisEnableStatusEnum status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序", example = "3")
|
||||
@ExcelProperty(value = "排序")
|
||||
@ExcelProperty(value = "排序", order = 6)
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否为系统内置数据
|
||||
*/
|
||||
@Schema(description = "是否为系统内置数据", example = "false")
|
||||
@ExcelProperty(value = "系统内置")
|
||||
@ExcelProperty(value = "系统内置", order = 7)
|
||||
private Boolean isSystem;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述", example = "测试部描述信息")
|
||||
@ExcelProperty(value = "描述")
|
||||
@ExcelProperty(value = "描述", order = 8)
|
||||
private String description;
|
||||
|
||||
@Override
|
||||
|
@ -96,7 +96,10 @@ public class StorageServiceImpl extends BaseServiceImpl<StorageMapper, StorageDO
|
||||
List<StorageDO> storageList = baseMapper.lambdaQuery().in(StorageDO::getId, ids).list();
|
||||
storageList.forEach(s -> {
|
||||
CheckUtils.throwIfEqual(Boolean.TRUE, s.getIsDefault(), "[{}] 是默认存储,不允许禁用", s.getName());
|
||||
this.unload(BeanUtil.copyProperties(s, StorageReq.class));
|
||||
// 卸载启用状态的存储
|
||||
if (DisEnableStatusEnum.ENABLE.equals(s.getStatus())) {
|
||||
this.unload(BeanUtil.copyProperties(s, StorageReq.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -46,13 +46,13 @@ import top.continew.starter.web.model.R;
|
||||
@Tag(name = "在线用户 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/monitor/online/user")
|
||||
@RequestMapping("/monitor/online")
|
||||
public class OnlineUserController {
|
||||
|
||||
private final OnlineUserService onlineUserService;
|
||||
|
||||
@Operation(summary = "分页查询列表", description = "分页查询列表")
|
||||
@SaCheckPermission("monitor:online:user:list")
|
||||
@SaCheckPermission("monitor:online:list")
|
||||
@GetMapping
|
||||
public R<PageResp<OnlineUserResp>> page(OnlineUserQuery query, @Validated PageQuery pageQuery) {
|
||||
return R.ok(onlineUserService.page(query, pageQuery));
|
||||
@ -60,7 +60,7 @@ public class OnlineUserController {
|
||||
|
||||
@Operation(summary = "强退在线用户", description = "强退在线用户")
|
||||
@Parameter(name = "token", description = "令牌", example = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjEsInJuU3RyIjoiTUd6djdyOVFoeHEwdVFqdFAzV3M5YjVJRzh4YjZPSEUifQ.7q7U3ouoN7WPhH2kUEM7vPe5KF3G_qavSG-vRgIxKvE", in = ParameterIn.PATH)
|
||||
@SaCheckPermission("monitor:online:user:delete")
|
||||
@SaCheckPermission("monitor:online:kickout")
|
||||
@DeleteMapping("/{token}")
|
||||
public R<Void> kickout(@PathVariable String token) {
|
||||
String currentToken = StpUtil.getTokenValue();
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package top.continew.admin.webapi.system;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
@ -51,6 +52,7 @@ public class LogController {
|
||||
private final LogService baseService;
|
||||
|
||||
@Operation(summary = "分页查询列表", description = "分页查询列表")
|
||||
@SaCheckPermission("monitor:log:list")
|
||||
@GetMapping
|
||||
public R<PageResp<LogResp>> page(LogQuery query, @Validated PageQuery pageQuery) {
|
||||
return R.ok(baseService.page(query, pageQuery));
|
||||
@ -58,18 +60,21 @@ public class LogController {
|
||||
|
||||
@Operation(summary = "查询详情", description = "查询详情")
|
||||
@Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH)
|
||||
@SaCheckPermission("monitor:log:list")
|
||||
@GetMapping("/{id}")
|
||||
public R<LogDetailResp> get(@PathVariable Long id) {
|
||||
return R.ok(baseService.get(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "导出登录日志", description = "导出登录日志")
|
||||
@SaCheckPermission("monitor:log:export")
|
||||
@GetMapping("/export/login")
|
||||
public void exportLoginLog(LogQuery query, SortQuery sortQuery, HttpServletResponse response) {
|
||||
baseService.exportLoginLog(query, sortQuery, response);
|
||||
}
|
||||
|
||||
@Operation(summary = "导出操作日志", description = "导出操作日志")
|
||||
@SaCheckPermission("monitor:log:export")
|
||||
@GetMapping("/export/operation")
|
||||
public void exportOperationLog(LogQuery query, SortQuery sortQuery, HttpServletResponse response) {
|
||||
baseService.exportOperationLog(query, sortQuery, response);
|
||||
|
Loading…
Reference in New Issue
Block a user