fix(项目管理): 修复消息中心全部已读还是未读状态问题
--bug=1039289 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001039289
This commit is contained in:
parent
0ae4b87190
commit
4104a5b0b1
|
@ -50,7 +50,7 @@ public class NotificationController {
|
|||
@Operation(summary = "消息中心-获取未读的消息")
|
||||
@CheckOwner(resourceId = "#projectId", resourceType = "project")
|
||||
public Integer getUnRead(@PathVariable(value = "projectId") String projectId) {
|
||||
return notificationService.getUnRead(projectId);
|
||||
return notificationService.getUnRead(projectId, SessionUtils.getUserId());
|
||||
}
|
||||
|
||||
@PostMapping(value = "/count")
|
||||
|
|
|
@ -107,12 +107,12 @@ public class NotificationService {
|
|||
}
|
||||
|
||||
|
||||
public Integer getUnRead(String projectId) {
|
||||
public Integer getUnRead(String projectId, String userId) {
|
||||
NotificationExample example = new NotificationExample();
|
||||
if (StringUtils.isBlank(projectId)) {
|
||||
return 0;
|
||||
}
|
||||
example.createCriteria().andProjectIdEqualTo(projectId).andStatusEqualTo(NotificationConstants.Status.UNREAD.name());
|
||||
example.createCriteria().andProjectIdEqualTo(projectId).andStatusEqualTo(NotificationConstants.Status.UNREAD.name()).andReceiverEqualTo(userId);
|
||||
return (int) notificationMapper.countByExample(example);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue