refactor: 日志和websocket代码优化
This commit is contained in:
@@ -34,10 +34,10 @@ public class LogController {
|
||||
|
||||
@Operation(summary = "日志分页列表")
|
||||
@GetMapping("/page")
|
||||
public PageResult<LogPageVO> listPagedLogs(
|
||||
public PageResult<LogPageVO> getLogPage(
|
||||
LogPageQuery queryParams
|
||||
) {
|
||||
Page<LogPageVO> result = logService.listPagedLogs(queryParams);
|
||||
Page<LogPageVO> result = logService.getLogPage(queryParams);
|
||||
return PageResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,33 @@ package com.youlai.boot.system.event;
|
||||
import lombok.Getter;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
|
||||
/**
|
||||
* 用户连接事件
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2.3.0
|
||||
*/
|
||||
@Getter
|
||||
public class UserConnectionEvent extends ApplicationEvent {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private final String username;
|
||||
|
||||
/**
|
||||
* 是否连接
|
||||
*/
|
||||
private final boolean connected;
|
||||
|
||||
/**
|
||||
* 用户连接事件
|
||||
*
|
||||
* @param source 事件源
|
||||
* @param username 用户名
|
||||
* @param connected 是否连接
|
||||
*/
|
||||
public UserConnectionEvent(Object source, String username, boolean connected) {
|
||||
super(source);
|
||||
this.username = username;
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface LogMapper extends BaseMapper<Log> {
|
||||
* @param queryParams
|
||||
* @return
|
||||
*/
|
||||
Page<LogPageVO> listPagedLogs(Page<LogPageVO> page, LogPageQuery queryParams);
|
||||
Page<LogPageVO> getLogPage(Page<LogPageVO> page, LogPageQuery queryParams);
|
||||
|
||||
/**
|
||||
* 统计浏览数(PV)
|
||||
|
||||
@@ -7,6 +7,12 @@ import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 访问趋势VO
|
||||
*
|
||||
* @author Ray
|
||||
* @since 2.3.0
|
||||
*/
|
||||
@Schema(description = "访问趋势VO")
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface LogService extends IService<Log> {
|
||||
* @param queryParams 查询参数
|
||||
* @return
|
||||
*/
|
||||
Page<LogPageVO> listPagedLogs(LogPageQuery queryParams);
|
||||
Page<LogPageVO> getLogPage(LogPageQuery queryParams);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,8 +36,8 @@ public class LogServiceImpl extends ServiceImpl<LogMapper, Log>
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<LogPageVO> listPagedLogs(LogPageQuery queryParams) {
|
||||
return this.baseMapper.listPagedLogs(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),
|
||||
public Page<LogPageVO> getLogPage(LogPageQuery queryParams) {
|
||||
return this.baseMapper.getLogPage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),
|
||||
queryParams);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user