dev add context for notifcations
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-13 13:39:02 +07:00
parent 0546f6acd5
commit 48c14d475d
10 changed files with 154 additions and 21 deletions
@@ -1,5 +1,7 @@
package ru.soune.nocopy.service.file.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.vrt.NoCopyFileService;
import com.vrt.fileprotection.FileProtector;
import com.vrt.fileprotection.NoCopyCheckResult;
@@ -447,7 +449,16 @@ public class FileUploadServiceImpl implements FileUploadService {
tariffInfoService.writeOffTokens(session.getUserId(), costService.protectFileCost(fileType),
OperationType.FILE_UPLOAD);
notificationService.addNotification(NotificationType.FILE_ADDED_TO_SYSTEM, session.getUserId());
ObjectMapper mapper = new ObjectMapper();
ObjectNode context = mapper.createObjectNode();
context.put("status", status.name());
context.put("file_name", fileEntity.getOriginalFileName());
context.put("file_id", fileEntity.getId());
context.put("support_id", fileEntity.getSupportId());
notificationService.addNotification(NotificationType.FILE_ADDED_TO_SYSTEM, session.getUserId(),
context);
}
if (status != FileStatus.TEMP) {