perf:代码结构调整
This commit is contained in:
@@ -61,17 +61,21 @@ public class RoleAuthorityAspect {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isAuthorized;
|
||||
String authority = StrUtil.join("_", classAnnotation.group(), classAnnotation.value());
|
||||
RoleAuthority annotation = signature.getMethod().getAnnotation(RoleAuthority.class);
|
||||
if(annotation == null) {
|
||||
return;
|
||||
if (annotation != null) {
|
||||
// 检查是否是功能点的权限
|
||||
isAuthorized = CollUtil.contains(authorityList, StrUtil.join("_", authority, annotation.value()));
|
||||
} else {
|
||||
// 检查是否有menu的权限
|
||||
isAuthorized = !authorityList.stream().filter(it -> StrUtil.startWith(it, authority))
|
||||
.collect(Collectors.toList()).isEmpty();
|
||||
}
|
||||
|
||||
// 检查是否是功能点的权限
|
||||
if (CollUtil.contains(authorityList, StrUtil.join("_", authority, annotation.value()))) {
|
||||
if (isAuthorized) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw new ApiException(403, "您无权访问");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
package com.tiesheng.web.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.login.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogApi;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.web.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manager/log")
|
||||
@RoleAuthority(value = "log", group = "system")
|
||||
public class LogController {
|
||||
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/operation/page")
|
||||
@RoleAuthority(value = "operation")
|
||||
public ApiResp<List<CoreLogOperation>> operationPage(@Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogOperation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "user_name", "title", "subject");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogOperation> page = dto.pageObj();
|
||||
coreLogService.getBaseMapper().page(page, queryWrapper);
|
||||
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 登录日志列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/login/page")
|
||||
@RoleAuthority(value = "login")
|
||||
public ApiResp<List<CoreLogLogin>> loginPage(@Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogLogin> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "user_name", "ip", "address");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogLogin> page = dto.pageObj();
|
||||
coreLogService.getLogLoginMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 调用日志
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/api/page")
|
||||
@RoleAuthority(value = "api")
|
||||
public ApiResp<List<CoreLogApi>> apiPage(String result, @Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogApi> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
if (!StrUtil.isEmpty(result)) {
|
||||
queryWrapper.eq("result", result);
|
||||
}
|
||||
dto.likeColumns(queryWrapper, "type", "content");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogApi> page = dto.pageObj();
|
||||
coreLogService.getLogApiMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 过程日志列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/process/page")
|
||||
public ApiResp<List<CoreLogProcess>> processPage(String type, @Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogProcess> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
if (!StrUtil.isEmpty(type)) {
|
||||
queryWrapper.eq("type", type);
|
||||
}
|
||||
dto.likeColumns(queryWrapper, "title");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogProcess> page = dto.pageObj();
|
||||
coreLogService.getCoreLogProcessMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 过程日志详情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/process/detail")
|
||||
public ApiResp<ProcessDetailVo> processPage(String id) {
|
||||
ProcessDetailVo processDetail = coreLogService.getProcessDetail(id);
|
||||
return ApiResp.respOK(processDetail);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.tiesheng.web.controller.comm;
|
||||
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.IdDTO;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.web.pojos.dto.config.EnumTypeDTO;
|
||||
import com.tiesheng.web.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.web.service.CoreConfigService;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/comm/web")
|
||||
public class CommWebController {
|
||||
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
@Autowired
|
||||
CoreConfigService coreConfigService;
|
||||
|
||||
/**
|
||||
* 系统配置列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/system/page")
|
||||
@TokenIgnore
|
||||
public ApiResp<List<CoreConfigSystem>> systemPage(String keyword) {
|
||||
|
||||
Validator.validateNotEmpty(keyword, "请上传关键字");
|
||||
|
||||
QueryWrapper<CoreConfigSystem> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
queryWrapper.likeRight("config_key", keyword);
|
||||
queryWrapper.orderByAsc("config_key");
|
||||
List<CoreConfigSystem> list = coreConfigService.list(queryWrapper);
|
||||
|
||||
return ApiResp.respOK(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取枚举列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/enum/list")
|
||||
@TokenIgnore
|
||||
public ApiResp<List<CoreConfigEnum>> enumList(EnumTypeDTO dto) {
|
||||
QueryWrapper<CoreConfigEnum> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
queryWrapper.eq("type", dto.getType());
|
||||
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
||||
|
||||
return ApiResp.respOK(selectList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 过程日志详情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/process/detail")
|
||||
@TokenIgnore
|
||||
public ApiResp<ProcessDetailVo> processPage(@Valid IdDTO dto) {
|
||||
ProcessDetailVo processDetail = coreLogService.getProcessDetail(dto.getId());
|
||||
return ApiResp.respOK(processDetail);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.web.controller;
|
||||
package com.tiesheng.web.controller.comm;
|
||||
|
||||
|
||||
import cn.hutool.captcha.LineCaptcha;
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.tiesheng.web.controller.system;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.web.pojos.dto.config.EnumTypeDTO;
|
||||
import com.tiesheng.web.service.CoreConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/config")
|
||||
@RoleAuthority(value = "enum", group = "system")
|
||||
public class ConfigEnumController {
|
||||
|
||||
@Autowired
|
||||
CoreConfigService coreConfigService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取枚举列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/enum/list")
|
||||
public ApiResp<List<CoreConfigEnum>> enumList(EnumTypeDTO dto) {
|
||||
|
||||
QueryWrapper<CoreConfigEnum> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
if (!StrUtil.isEmpty(dto.getType())) {
|
||||
queryWrapper.eq("type", dto.getType());
|
||||
}
|
||||
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
||||
|
||||
return ApiResp.respOK(selectList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +1,14 @@
|
||||
package com.tiesheng.web.controller;
|
||||
package com.tiesheng.web.controller.system;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.web.pojos.dto.config.ConfigSystemDTO;
|
||||
import com.tiesheng.web.pojos.dto.config.EnumTypeDTO;
|
||||
import com.tiesheng.web.service.CoreConfigService;
|
||||
import com.tiesheng.web.service.TieshengWebConfigurer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -26,7 +22,7 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/config")
|
||||
@RoleAuthority(value = "config", group = "system")
|
||||
public class ConfigController {
|
||||
public class ConfigSystemController {
|
||||
|
||||
@Autowired
|
||||
CoreConfigService coreConfigService;
|
||||
@@ -40,7 +36,6 @@ public class ConfigController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/system/page")
|
||||
@TokenIgnore
|
||||
public ApiResp<List<CoreConfigSystem>> systemPage(PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreConfigSystem> queryWrapper = new QueryWrapper<>();
|
||||
@@ -61,7 +56,6 @@ public class ConfigController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/system/update")
|
||||
@RoleAuthority(value = "systemUpdate")
|
||||
public ApiResp<String> systemUpdate(@RequestBody ConfigSystemDTO dto) {
|
||||
|
||||
CoreConfigSystem configKey = coreConfigService.getOneByColumn("config_key", dto.getConfigKey());
|
||||
@@ -81,25 +75,4 @@ public class ConfigController {
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取枚举列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/enum/list")
|
||||
@TokenIgnore
|
||||
public ApiResp<List<CoreConfigEnum>> enumList(EnumTypeDTO dto) {
|
||||
|
||||
QueryWrapper<CoreConfigEnum> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
if (!StrUtil.isEmpty(dto.getType())) {
|
||||
queryWrapper.eq("type", dto.getType());
|
||||
}
|
||||
List<CoreConfigEnum> selectList = coreConfigService.getEnumMapper().selectList(queryWrapper);
|
||||
|
||||
return ApiResp.respOK(selectList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.tiesheng.web.controller.system;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogApi;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manager/log")
|
||||
@RoleAuthority(value = "api", group = "system")
|
||||
public class LogApiController {
|
||||
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 调用日志
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/api/page")
|
||||
public ApiResp<List<CoreLogApi>> apiPage(String result, @Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogApi> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
if (!StrUtil.isEmpty(result)) {
|
||||
queryWrapper.eq("result", result);
|
||||
}
|
||||
dto.likeColumns(queryWrapper, "type", "content");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogApi> page = dto.pageObj();
|
||||
coreLogService.getLogApiMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.tiesheng.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.login.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manager/log")
|
||||
@RoleAuthority(value = "login", group = "system")
|
||||
public class LogLoginController {
|
||||
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
|
||||
/**
|
||||
* 登录日志列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/login/page")
|
||||
public ApiResp<List<CoreLogLogin>> loginPage(@Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogLogin> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "user_name", "ip", "address");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogLogin> page = dto.pageObj();
|
||||
coreLogService.getLogLoginMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.tiesheng.web.controller.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manager/log")
|
||||
@RoleAuthority(value = "operation", group = "system")
|
||||
public class LogOperationController {
|
||||
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/operation/page")
|
||||
public ApiResp<List<CoreLogOperation>> operationPage(@Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogOperation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "user_name", "title", "subject");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogOperation> page = dto.pageObj();
|
||||
coreLogService.getBaseMapper().page(page, queryWrapper);
|
||||
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.tiesheng.web.controller.system;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manager/log")
|
||||
@RoleAuthority(value = "process", group = "system")
|
||||
public class LogProcessController {
|
||||
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
|
||||
/**
|
||||
* 过程日志列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/process/page")
|
||||
public ApiResp<List<CoreLogProcess>> processPage(String type, @Valid PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreLogProcess> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
if (!StrUtil.isEmpty(type)) {
|
||||
queryWrapper.eq("type", type);
|
||||
}
|
||||
dto.likeColumns(queryWrapper, "title");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
Page<CoreLogProcess> page = dto.pageObj();
|
||||
coreLogService.getCoreLogProcessMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user