新增未读日志数量查询接口及服务实现
在系统模块的作业日志功能中,新增了一个获取当前登录用户可查看日志未读数量的接口。该接口通过调用LogReadService的新方法`getUnRead`来获取未读日志的数量。服务端的实现通过查询数据库中用户的阅读状态,统计出未读日志的数量并返回。
This commit is contained in:
parent
e8d15070c2
commit
b2effbec4e
@ -209,6 +209,14 @@ public class LogInstanceController {
|
|||||||
return success(readUserVO);
|
return success(readUserVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get-unRead")
|
||||||
|
@Operation(summary = "获取当前登录用户可查看日志未读的数量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:view-log:query')")
|
||||||
|
public CommonResult<Long> unRead() {
|
||||||
|
|
||||||
|
return success(logReadService.getUnRead(getLoginUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出日志实例 Excel")
|
@Operation(summary = "导出日志实例 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('system:log-instance:export')")
|
@PreAuthorize("@ss.hasPermission('system:log-instance:export')")
|
||||||
|
@ -49,4 +49,11 @@ public interface LogReadService {
|
|||||||
* @return 阅读状态
|
* @return 阅读状态
|
||||||
*/
|
*/
|
||||||
Boolean isReadByLogId(Long logId);
|
Boolean isReadByLogId(Long logId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录用户可查看日志未读的数量
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @return 未读数量
|
||||||
|
*/
|
||||||
|
Long getUnRead(Long userId);
|
||||||
}
|
}
|
||||||
|
@ -86,4 +86,12 @@ public class LogReadServiceImpl implements LogReadService{
|
|||||||
|
|
||||||
return count > 0L;
|
return count > 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getUnRead(Long userId) {
|
||||||
|
|
||||||
|
return logReadMapper.selectCount(new LambdaQueryWrapperX<LogReadDo>()
|
||||||
|
.eq(LogReadDo::getReadUserId, userId)
|
||||||
|
.eq(LogReadDo::getReadStatus, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user