BUGFIX: 获取系统通知未读数

This commit is contained in:
2025-11-18 16:02:26 +08:00
parent d236057f2a
commit 97f0c8f65f
2 changed files with 5 additions and 2 deletions

View File

@@ -296,6 +296,7 @@ public class GenerateConsumer {
redisUtil.addToMap(exceptionMapKey, exceptionInfo);
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
try {
channel.basicAck(msg.getMessageProperties().getDeliveryTag(), false);

View File

@@ -30,6 +30,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@@ -385,6 +386,8 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
return PageBaseResponse.success(convert);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void videoFinishedMsg(Long userId, String projectName, boolean isSuccess) {
Account account = accountService.getById(userId);
String language = account.getLanguage();
@@ -410,11 +413,10 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
}
}
notification.setContent(JSON.toJSONString(sysNotificationDTO));
notification.setIsRead(0);
notification.setCreateTime(LocalDateTime.now());
save(notification);
pushMessage("system", userId);
}