perf(web):操作日志优化
1,不再返回params字段 2,params字段有text改为longtext
This commit is contained in:
@@ -3,6 +3,7 @@ package com.tiesheng.core.controller;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.tiesheng.annotation.token.TokenIgnore;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||||
@@ -36,15 +37,16 @@ public class LogController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/operation/page")
|
@GetMapping("/operation/page")
|
||||||
|
@TokenIgnore
|
||||||
public ApiResp<List<CoreLogOperation>> operationPage(@Valid PageDTO dto) {
|
public ApiResp<List<CoreLogOperation>> operationPage(@Valid PageDTO dto) {
|
||||||
|
|
||||||
QueryWrapper<CoreLogOperation> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CoreLogOperation> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("is_deleted", 0);
|
queryWrapper.eq("is_deleted", 0);
|
||||||
dto.likeColumns(queryWrapper, "user_name", "title", "subject", "params");
|
dto.likeColumns(queryWrapper, "user_name", "title", "subject");
|
||||||
queryWrapper.orderByDesc("create_time");
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
|
||||||
Page<CoreLogOperation> page = dto.pageObj();
|
Page<CoreLogOperation> page = dto.pageObj();
|
||||||
coreLogService.page(page, queryWrapper);
|
coreLogService.getBaseMapper().page(page, queryWrapper);
|
||||||
|
|
||||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
package com.tiesheng.core.mapper;
|
package com.tiesheng.core.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
public interface CoreLogOperationMapper extends BaseMapper<CoreLogOperation> {
|
public interface CoreLogOperationMapper extends BaseMapper<CoreLogOperation> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取日志列表
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param queryWrapper
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<CoreLogOperation> page(IPage<CoreLogOperation> page, @Param("ew") QueryWrapper<CoreLogOperation> queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ CREATE TABLE `core_log_operation`
|
|||||||
`user_name` varchar(255) DEFAULT NULL COMMENT '用户名称',
|
`user_name` varchar(255) DEFAULT NULL COMMENT '用户名称',
|
||||||
`title` varchar(255) DEFAULT NULL COMMENT '标题',
|
`title` varchar(255) DEFAULT NULL COMMENT '标题',
|
||||||
`subject` varchar(500) DEFAULT NULL COMMENT '小标题',
|
`subject` varchar(500) DEFAULT NULL COMMENT '小标题',
|
||||||
`params` text COMMENT '其他参数',
|
`params` longtext COMMENT '其他参数',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作';
|
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作';
|
||||||
|
|||||||
@@ -19,4 +19,9 @@
|
|||||||
id, create_time, update_time, is_deleted, user_id, user_name, title, subject, params
|
id, create_time, update_time, is_deleted, user_id, user_name, title, subject, params
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="page" resultMap="BaseResultMap">
|
||||||
|
select id,create_time,update_time,is_deleted,user_name,user_id,title,subject from core_log_operation
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user