1
0
forked from PGL/Clyde

added addview and download PDF

This commit is contained in:
2024-04-17 00:09:30 +02:00
parent 388c53e47b
commit 821377a72f
8 changed files with 63 additions and 39 deletions

View File

@ -2,6 +2,7 @@ package ovh.herisson.Clyde.Services.ScientificPublications;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.DTO.ScientificPublications.ResearchDTO;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchCoAuthorsRepository;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearcherRepository;
@ -186,4 +187,13 @@ public class ResearchesService {
}
researcherRepo.save(researcher);
}
public Research getResearchByUrl(String url) {
return articleRepo.findByPdfLocation(url);
}
public Research addView(Research research) {
research.setViews(research.getViews()+1);
articleRepo.save(research);
}
}

View File

@ -40,7 +40,6 @@ public class StatisticsService {
toReturn.add(statsRepo.languageByYears());
toReturn.add(statsRepo.languageByMonths());
toReturn.add(statsRepo.languageByTopics());
return toReturn;
}
}