操作日志管理
修改 system-domain 模块在 com.it6666.dto 中添加 OperLogDto
package com.it6666.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
(value = "com-it6666-dto-OperLogDto")
(callSuper = true)
public class OperLogDto extends BaseDto {
/**
* 模块标题
*/
(value = "模块标题")
private String title;
/**
* 业务类型(0其它 1新增 2修改 3删除)
*/
(value = "业务类型(0其它 1新增 2修改 3删除)")
private String businessType;
/**
* 操作人员
*/
(value = "操作人员")
private String operName;
/**
* 操作状态(0正常 1异常)
*/
(value = "操作状态(0成功 1失败)")
private String status;
}
修改 system-api 模块中的 OperLogService
package com.it6666.service;
import com.it6666.domain.OperLog;
import com.it6666.dto.OperLogDto;
import com.it6666.vo.DataGridView;
/**
* @author BNTang
*/
public interface OperLogService {
/**
* 插入操作日志
*
* @param operLog
*/
void insertOperLog(OperLog operLog);
/**
* 分页查询操作日志
*
* @param operLogDto
* @return
*/
DataGridView listForPage(OperLogDto operLogDto);
/**
* 根据ID删除操作日志
*
* @param infoIds
* @return
*/
int deleteOperLogByIds(Long[] infoIds);
/**
* 清空操作日志
*
* @return
*/
int clearAllOperLog();
}
修改 system-service 模块中的 OperLogServiceImpl
public class OperLogServiceImpl implements OperLogService {
private OperLogMapper operLogMapper;
public void insertOperLog(OperLog operLog) {
operLogMapper.insert(operLog);
}
public DataGridView listForPage(OperLogDto operLogDto) {
Page<OperLog> page = new Page<>(operLogDto.getPageNum(), operLogDto.getPageSize());
QueryWrapper<OperLog> qw = new QueryWrapper<>();
qw.like(StringUtils.isNotBlank(operLogDto.getOperName()), OperLog.COL_OPER_NAME, operLogDto.getOperName());
qw.like(StringUtils.isNotBlank(operLogDto.getTitle()), OperLog.COL_TITLE, operLogDto.getTitle());
qw.eq(StringUtils.isNotBlank(operLogDto.getBusinessType()), OperLog.COL_BUSINESS_TYPE, operLogDto.getBusinessType());
qw.eq(StringUtils.isNotBlank(operLogDto.getStatus()), OperLog.COL_STATUS, operLogDto.getStatus());
qw.ge(null != operLogDto.getBeginTime(), OperLog.COL_OPER_TIME, operLogDto.getBeginTime());
qw.le(null != operLogDto.getEndTime(), OperLog.COL_OPER_TIME, operLogDto.getEndTime());
qw.orderByDesc(OperLog.COL_OPER_TIME);
this.operLogMapper.selectPage(page, qw);
return new DataGridView(page.getTotal(), page.getRecords());
}
public int deleteOperLogByIds(Long[] infoIds) {
if (null != infoIds && infoIds.length > 0) {
return this.operLogMapper.deleteBatchIds(Arrays.asList(infoIds));
}
return 0;
}
public int clearAllOperLog() {
return this.operLogMapper.delete(null);
}
}
编写操作切面相关代码
his-commons 模块 在 com.it6666.aspectj.enums 中 创建 BusinessStatus 枚举
package com.it6666.aspectj.enums;
/**
* description: 操作状态
* date: 2020-09-12 10:07
* author: 30315
* version: 1.0
*/
public enum BusinessStatus {
/**
* 成功
*/
SUCCESS,
/**
* 失败
*/
FAIL,
}
his-commons 模块 在 com.it6666.aspectj.enums 中 创建 BusinessType 枚举
package com.it6666.aspectj.enums;
/**
* description: BusinessType
* date: 2020-09-12 10:09
* author: 30315
* version: 1.0
*/
public enum BusinessType {
/**
* 其它
*/
OTHER,
/**
* 新增
*/
INSERT,
/**
* 修改
*/
UPDATE,
/**
* 删除
*/
DELETE,
/**
* 授权
*/
GRANT,
/**
* 导出
*/
EXPORT,
/**
* 导入
*/
IMPORT,
/**
* 强退
*/
FORCE,
/**
* 生成代码
*/
GENCODE,
/**
* 清空数据
*/
CLEAN,
}
his-commons 模块 在 com.it6666.aspectj.enums 中 创建 OperatorType 枚举
package com.it6666.aspectj.enums;
/**
* 操作人类别
*/
public enum OperatorType {
/**
* 其它
*/
OTHER,
/**
* 后台用户
*/
MANAGE,
/**
* 手机端用户
*/
MOBILE
}
system-web 模块中创建 Log 注解 在 com.it6666.aspectj.annotation 中创建
package com.it6666.aspectj.annotation;
import com.it6666.aspectj.enums.BusinessType;
import com.it6666.aspectj.enums.OperatorType;
import java.lang.annotation.*;
/**
* description: 自定义操作日志记录注解
* date: 2020-09-12 10:05
* author: 30315
* version: 1.0
*/
({ElementType.PARAMETER, ElementType.METHOD})
(RetentionPolicy.RUNTIME)
public @interface Log {
/**
* 模块
*/
public String title() default "";
/**
* 功能
*/
public BusinessType businessType() default BusinessType.OTHER;
/**
* 操作人类别
*/
public OperatorType operatorType() default OperatorType.MANAGE;
/**
* 是否保存请求的参数
*/
public boolean isSaveRequestData() default true;
}
system-web 模块在 com.it6666.utils 创建 ServletUtils工具类
package com.it6666.utils;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* description: 客户端工具类
* date: 2020-09-12 10:15
* author: 30315
* version: 1.0
*/
public class ServletUtils {
/**
* 获取request
*/
public static HttpServletRequest getRequest() {
return getRequestAttributes().getRequest();
}
/**
* 获取response
*/
public static HttpServletResponse getResponse() {
return getRequestAttributes().getResponse();
}
public static ServletRequestAttributes getRequestAttributes() {
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
return (ServletRequestAttributes) attributes;
}
}
system-web 模块在 com.it6666.aspectj 中创建 OperLogAspect 切面类用来记录操作日志
package com.it6666.aspectj;
import com.alibaba.fastjson.JSON;
import com.it6666.aspectj.annotation.Log;
import com.it6666.aspectj.enums.BusinessStatus;
import com.it6666.domain.OperLog;
import com.it6666.domain.User;
import com.it6666.service.OperLogService;
import com.it6666.utils.AddressUtils;
import com.it6666.utils.IpUtils;
import com.it6666.utils.ServletUtils;
import com.it6666.utils.ShiroSecurityUtils;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.HandlerMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.Map;
/**
* description: 操作日志记录处理
* date: 2020-09-12 10:17
* author: 30315
* version: 1.0
*/
public class OperLogAspect {
private OperLogService operLogService;
// 配置织入点
("@annotation(com.it6666.aspectj.annotation.Log)")
public void logPointCut() {
}
/**
* 处理完请求后执行
*
* @param joinPoint 切点
*/
(pointcut = "logPointCut()", returning = "jsonResult")
public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) {
handleLog(joinPoint, null, jsonResult);
}
/**
* 拦截异常操作
*
* @param joinPoint 切点
* @param e 异常
*/
(value = "logPointCut()", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, Exception e) {
handleLog(joinPoint, e, null);
}
protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult) {
try {
// 获得注解
Log controllerLog = getAnnotationLog(joinPoint);
if (controllerLog == null) {
return;
}
// 获取当前的用户
User loginUser = ShiroSecurityUtils.getCurrentUser();
// *========数据库日志=========* //
OperLog operLog = new OperLog();
operLog.setStatus(String.valueOf(BusinessStatus.SUCCESS.ordinal()));
// 请求的地址
String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
operLog.setOperIp(ip);
String address = AddressUtils.getRealAddressByIP(ip);
operLog.setOperLocation(address);
// 返回参数
operLog.setJsonResult(JSON.toJSONString(jsonResult));
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
if (loginUser != null) {
operLog.setOperName(loginUser.getUserName());
}
if (e != null) {
operLog.setStatus(String.valueOf(BusinessStatus.FAIL.ordinal()));
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
}
// 设置方法名称
String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
operLog.setMethod(className + "." + methodName + "()");
// 设置请求方式
operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
// 处理设置注解上的参数
getControllerMethodDescription(joinPoint, controllerLog, operLog);
//设置操作时间
operLog.setOperTime(new Date());
// 保存数据库
operLogService.insertOperLog(operLog);
} catch (Exception exp) {
// 记录本地异常日志
log.error("==前置通知异常==");
log.error("异常信息:{}", exp.getMessage());
exp.printStackTrace();
}
}
/**
* 获取注解中对方法的描述信息 用于Controller层注解
*
* @param log 日志
* @param operLog 操作日志
* @throws Exception
*/
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLog operLog) throws Exception {
// 设置action动作
operLog.setBusinessType(String.valueOf(log.businessType().ordinal()));
// 设置标题
operLog.setTitle(log.title());
// 设置操作人类别
operLog.setOperatorType(log.operatorType().ordinal());
// 是否需要保存request,参数和值
if (log.isSaveRequestData()) {
// 获取参数的信息,传入到数据库中。
setRequestValue(joinPoint, operLog);
}
}
/**
* 获取请求的参数,放到log中
*
* @param operLog 操作日志
* @throws Exception 异常
*/
private void setRequestValue(JoinPoint joinPoint, OperLog operLog) throws Exception {
String requestMethod = operLog.getRequestMethod();
if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) {
String params = argsArrayToString(joinPoint.getArgs());
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
} else {
Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
operLog.setOperParam(StringUtils.substring(paramsMap.toString(), 0, 2000));
}
}
/**
* 是否存在注解,如果存在就获取
*/
private Log getAnnotationLog(JoinPoint joinPoint) throws Exception {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null) {
return method.getAnnotation(Log.class);
}
return null;
}
/**
* 参数拼装
*/
private String argsArrayToString(Object[] paramsArray) {
String params = "";
if (paramsArray != null && paramsArray.length > 0) {
for (int i = 0; i < paramsArray.length; i++) {
if (!isFilterObject(paramsArray[i])) {
Object jsonObj = JSON.toJSON(paramsArray[i]);
params += jsonObj.toString() + " ";
}
}
}
return params.trim();
}
/**
* 判断是否需要过滤的对象。
*
* @param o 对象信息。
* @return 如果是需要过滤的对象,则返回true;否则返回false。
*/
public boolean isFilterObject(final Object o) {
return o instanceof MultipartFile || o instanceof HttpServletRequest
|| o instanceof HttpServletResponse;
}
}
system-web 模块修改 com.it6666.controller.system 中的 Controller 凡是包含了 BusinessType 枚举中的操作都需要在 Controller 方法上面加上如下代码注解,也可以不加哦,我这里是做的一个操作日志管理
title = "修改数据字典信息",businessType = BusinessType.UPDATE)(
- BusinessType:需要自己修改一下,对应着controller的功能即可
- title:功能描述
修改之后的代码
DictTypeController
package com.it6666.controller.system;
import com.it6666.aspectj.annotation.Log;
import com.it6666.aspectj.enums.BusinessType;
import com.it6666.dto.DictTypeDto;
import com.it6666.service.DictTypeService;
import com.it6666.utils.ShiroSecurityUtils;
import com.it6666.vo.AjaxResult;
import com.it6666.vo.DataGridView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* @author tangyihao
* @version V1.1.1
* @program BNTang-his
* @date Created in 2020/9/5 14:21
* @description 数据字典信息
**/
("system/dict/type")
public class DictTypeController {
private DictTypeService dictTypeService;
/**
* 分页查询
*/
("listForPage")
(title = "分页查询",businessType = BusinessType.OTHER)
public AjaxResult listForPage(DictTypeDto dictTypeDto) {
DataGridView gridView = this.dictTypeService.listPage(dictTypeDto);
return AjaxResult.success("查询成功", gridView.getData(), gridView.getTotal());
}
/**
* 添加
*/
("addDictType")
(title = "添加数据字典信息",businessType = BusinessType.INSERT)
public AjaxResult addDictType( DictTypeDto dictTypeDto) {
if (dictTypeService.checkDictTypeUnique(dictTypeDto.getDictId(), dictTypeDto.getDictType())) {
return AjaxResult.fail("新增字典【" + dictTypeDto.getDictName() + "】失败,字典类型已存在");
}
dictTypeDto.setSimpleUser(ShiroSecurityUtils.getCurrentSimpleUser());
return AjaxResult.toAjax(this.dictTypeService.insert(dictTypeDto));
}
/**
* 修改
*/
("updateDictType")
(title = "修改数据字典信息",businessType = BusinessType.UPDATE)
public AjaxResult updateDictType( DictTypeDto dictTypeDto) {
if (dictTypeService.checkDictTypeUnique(dictTypeDto.getDictId(), dictTypeDto.getDictType())) {
return AjaxResult.fail("修改字典【" + dictTypeDto.getDictName() + "】失败,字典类型已存在");
}
dictTypeDto.setSimpleUser(ShiroSecurityUtils.getCurrentSimpleUser());
return AjaxResult.toAjax(this.dictTypeService.update(dictTypeDto));
}
/**
* 根据ID查询一个字典信息
*/
("getOne/{dictId}")
(title = "根据ID查询一个字典信息",businessType = BusinessType.OTHER)
public AjaxResult getDictType( (message = "字典ID不能为空") Long dictId) {
return AjaxResult.success(this.dictTypeService.selectDictTypeById(dictId));
}
/**
* 删除
*/
("deleteDictTypeByIds/{dictIds}")
(title = "删除数据字典信息",businessType = BusinessType.DELETE)
public AjaxResult updateDictType( (message = "要删除的ID不能为空") Long[] dictIds) {
return AjaxResult.toAjax(this.dictTypeService.deleteDictTypeByIds(dictIds));
}
/**
* 查询所有可用的字典类型
*/
("selectAllDictType")
(title = "查询所有可用的字典类型",businessType = BusinessType.OTHER)
public AjaxResult selectAllDictType() {
return AjaxResult.success(this.dictTypeService.list().getData());
}
/**
* 同步缓存
*/
("dictCacheAsync")
(title = "同步缓存",businessType = BusinessType.OTHER)
public AjaxResult dictCacheAsync() {
try {
this.dictTypeService.dictCacheAsync();
return AjaxResult.success();
} catch (Exception e) {
return AjaxResult.error();
}
}
}
DictDataController
package com.it6666.controller.system;
import com.it6666.aspectj.annotation.Log;
import com.it6666.aspectj.enums.BusinessType;
import com.it6666.dto.DictDataDto;
import com.it6666.service.DictDataService;
import com.it6666.utils.ShiroSecurityUtils;
import com.it6666.vo.AjaxResult;
import com.it6666.vo.DataGridView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* @author tangyihao
* @version V1.1.1
* @program BNTang-his
* @date Created in 2020/9/5 15:04
* @description 数据字典信息
**/
("system/dict/data")
public class DictDataController {
private DictDataService dictDataService;
/**
* 分页查询
*/
("listForPage")
(title = "分页查询",businessType = BusinessType.OTHER)
public AjaxResult listForPage(DictDataDto dictDataDto) {
DataGridView gridView = this.dictDataService.listPage(dictDataDto);
return AjaxResult.success("查询成功", gridView.getData(), gridView.getTotal());
}
/**
* 添加
*/
("addDictData")
(title = "添加数据字典信息",businessType = BusinessType.INSERT)
public AjaxResult addDictData( DictDataDto dictDataDto) {
dictDataDto.setSimpleUser(ShiroSecurityUtils.getCurrentSimpleUser());
return AjaxResult.toAjax(this.dictDataService.insert(dictDataDto));
}
/**
* 修改
*/
("updateDictData")
(title = "修改数据字典信息",businessType = BusinessType.UPDATE)
public AjaxResult updateDictData( DictDataDto dictDataDto) {
dictDataDto.setSimpleUser(ShiroSecurityUtils.getCurrentSimpleUser());
return AjaxResult.toAjax(this.dictDataService.update(dictDataDto));
}
/**
* 根据ID查询一个字典信息
*/
("getOne/{dictCode}")
(title = "根据ID查询一个字典信息",businessType = BusinessType.OTHER)
public AjaxResult getDictData( (message = "字典ID不能为空") Long dictCode) {
return AjaxResult.success(this.dictDataService.selectDictDataById(dictCode));
}
/**
* 删除
*/
("deleteDictDataByIds/{dictCodeIds}")
(title = "删除数据字典信息",businessType = BusinessType.DELETE)
public AjaxResult updateDictData( (message = "要删除的ID不能为空") Long[] dictCodeIds) {
return AjaxResult.toAjax(this.dictDataService.deleteDictDataByIds(dictCodeIds));
}
/**
* 查询所有可用的字典类型
*/
("getDataByType/{dictType}")
(title = "查询所有可用的字典类型",businessType = BusinessType.OTHER)
public AjaxResult getDataByType( (message = "字典类型不能为空") String dictType) {
return AjaxResult.success(this.dictDataService.selectDictDataByDictType(dictType));
}
}
LoginController
package com.it6666.controller.system;
import com.it6666.aspectj.annotation.Log;
import com.it6666.aspectj.enums.BusinessType;
import com.it6666.constants.Constants;
import com.it6666.constants.HttpStatus;
import com.it6666.domain.Menu;
import com.it6666.domain.SimpleUser;
import com.it6666.dto.LoginBodyDto;
import com.it6666.service.MenuService;
import com.it6666.vo.ActiverUser;
import com.it6666.vo.AjaxResult;
import com.it6666.vo.MenuTreeVo;
import lombok.extern.log4j.Log4j2;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* description: LoginController
* date: 2020-09-03 22:25
* author: 30315
* version: 1.0
*/
public class LoginController {
private final MenuService menuService;
public LoginController(MenuService menuService) {
this.menuService = menuService;
}
/**
* 登录方法
*
* @return 结果
*/
("login/doLogin")
(title = "登录方法",businessType = BusinessType.OTHER)
public AjaxResult login( LoginBodyDto loginBodyDto, HttpServletRequest request) {
AjaxResult ajax = AjaxResult.success();
String username = loginBodyDto.getUsername();
String password = loginBodyDto.getPassword();
//构造用户名和密码的token
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
Subject subject = SecurityUtils.getSubject();
try {
subject.login(token);
// 得到会话的token==也就是redis里面存的
Serializable webToken = subject.getSession().getId();
ajax.put(Constants.TOKEN, webToken);
} catch (Exception e) {
log.error("用户名或密码不正确", e);
ajax = AjaxResult.error(HttpStatus.ERROR, "用户名或密码不正确");
}
return ajax;
}
/**
* 获取用户信息
*
* @return 用户信息
*/
("login/getInfo")
(title = "获取用户信息",businessType = BusinessType.OTHER)
public AjaxResult getInfo() {
Subject subject = SecurityUtils.getSubject();
ActiverUser activerUser = (ActiverUser) subject.getPrincipal();
AjaxResult ajax = AjaxResult.success();
ajax.put("username", activerUser.getUser().getUserName());
ajax.put("picture", activerUser.getUser().getPicture());
ajax.put("roles", activerUser.getRoles());
ajax.put("permissions", activerUser.getPermissions());
return ajax;
}
/**
* 用户退出
*/
("login/logout")
(title = "用户退出",businessType = BusinessType.FORCE)
public AjaxResult logout() {
Subject subject = SecurityUtils.getSubject();
subject.logout();
return AjaxResult.success("用户退出成功");
}
/**
* 获取应该显示的菜单信息
*
* @return 菜单信息
*/
("login/getMenus")
(title = "获取应该显示的菜单信息",businessType = BusinessType.OTHER)
public AjaxResult getMeuns() {
Subject subject = SecurityUtils.getSubject();
ActiverUser activerUser = (ActiverUser) subject.getPrincipal();
boolean isAdmin = activerUser.getUser().getUserType().equals(Constants.USER_ADMIN);
SimpleUser simpleUser = null;
if (!isAdmin) {
simpleUser = new SimpleUser(activerUser.getUser().getUserId(), activerUser.getUser().getUserName());
}
List<Menu> menus = menuService.selectMenuTree(isAdmin, simpleUser);
List<MenuTreeVo> menuVos = new ArrayList<>();
for (Menu menu : menus) {
menuVos.add(new MenuTreeVo(menu.getMenuId().toString(), menu.getPath()));
}
return AjaxResult.success(menuVos);
}
}
system-web 模块 com.it6666.controller.system 中创建 OperLogController
package com.it6666.controller.system;
import com.it6666.dto.OperLogDto;
import com.it6666.service.OperLogService;
import com.it6666.vo.AjaxResult;
import com.it6666.vo.DataGridView;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* description: OperLogController
* date: 2020-09-12 10:33
* author: 30315
* version: 1.0
*/
("system/operLog")
public class OperLogController {
private OperLogService operLogService;
/**
* 分页查询
*/
("listForPage")
public AjaxResult listForPage(OperLogDto operLogDto) {
DataGridView gridView = operLogService.listForPage(operLogDto);
return AjaxResult.success("查询成功", gridView.getData(), gridView.getTotal());
}
/**
* 删除
*/
("deleteOperLogByIds/{infoIds}")
public AjaxResult deleteOperLogByIds( Long[] infoIds) {
return AjaxResult.toAjax(this.operLogService.deleteOperLogByIds(infoIds));
}
/**
* 清空删除
*/
("clearAllOperLog")
public AjaxResult clearAllOperLog() {
return AjaxResult.toAjax(this.operLogService.clearAllOperLog());
}
}
自行测试接口,yapi 测试,现在去编写前端