This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.soune.nocopy.service.file.moderation;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
@@ -89,7 +91,14 @@ public class ModerationService {
|
||||
}
|
||||
}
|
||||
|
||||
notificationService.addNotification(NotificationType.FILE_MODERATION_EVENT, file.getUserId());
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
ObjectNode context = mapper.createObjectNode();
|
||||
context.put("file_name", file.getOriginalFileName());
|
||||
context.put("old_status", file.getStatus().name());
|
||||
context.put("new_status", request.getNewStatus().name());
|
||||
context.put("comment", request.getComment());
|
||||
|
||||
notificationService.addNotification(NotificationType.FILE_MODERATION_EVENT, file.getUserId(), context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user