dev add field locale for get info for view doc
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-15 12:40:26 +07:00
parent 0c373acc7f
commit b0c66720b0
2 changed files with 18 additions and 0 deletions
@@ -39,11 +39,20 @@ public class DockViewService {
@Transactional
public DockView createDockView(DocViewerRequest request, Long userId) {
DockView dockView = new DockView();
String geoEnName = geoCountryService.getCityByIp(request.getIp(), "en") + "/" +
geoCountryService.getCountryByIp(request.getIp(), "en");
String geoRuName = geoCountryService.getCityByIp(request.getIp(), "ru") + "/" +
geoCountryService.getCountryByIp(request.getIp(), "ru");
User user = userRepository.findById(userId).orElse(null);
dockView.setViewerId(userId);
dockView.setViewerIp(request.getIp() != null ? request.getIp() : "-");
dockView.setUserAgent(request.getUserAgent() != null ? request.getUserAgent() : "-");
dockView.setFileId(request.getFileId());
dockView.setCreatedAt(LocalDateTime.now());
dockView.setGeoNameEn(geoEnName);
dockView.setGeoNameRu(geoRuName);
dockView.setViewerName(user == null ? "guest" : user.getFullName());
DockView saved = dockViewRepository.save(dockView);