diff --git a/src/main/java/fr/abes/bestppn/BestPpnApplication.java b/src/main/java/fr/abes/bestppn/BestPpnApplication.java index e5b4031..5df59ea 100644 --- a/src/main/java/fr/abes/bestppn/BestPpnApplication.java +++ b/src/main/java/fr/abes/bestppn/BestPpnApplication.java @@ -2,9 +2,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.kafka.annotation.EnableKafka; @EnableKafka +@EnableAspectJAutoProxy @SpringBootApplication public class BestPpnApplication { public static void main(String[] args) { diff --git a/src/main/java/fr/abes/bestppn/configuration/BaconDbConfig.java b/src/main/java/fr/abes/bestppn/configuration/BaconDbConfig.java index 45ba0fb..fa6fe6c 100644 --- a/src/main/java/fr/abes/bestppn/configuration/BaconDbConfig.java +++ b/src/main/java/fr/abes/bestppn/configuration/BaconDbConfig.java @@ -41,7 +41,7 @@ public class BaconDbConfig extends AbstractConfig { public LocalContainerEntityManagerFactoryBean baconEntityManager() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(baconDataSource()); - em.setPackagesToScan(new String[]{"fr.abes.bestppn.entity.bacon"}); + em.setPackagesToScan(new String[]{"fr.abes.bestppn.model.entity.bacon"}); configHibernate(em, platform, showsql, dialect, ddlAuto, generateDdl, initMode); return em; } diff --git a/src/main/java/fr/abes/bestppn/configuration/BaseXMLOracleConfig.java b/src/main/java/fr/abes/bestppn/configuration/BaseXMLOracleConfig.java index eaaa9b3..54fe505 100644 --- a/src/main/java/fr/abes/bestppn/configuration/BaseXMLOracleConfig.java +++ b/src/main/java/fr/abes/bestppn/configuration/BaseXMLOracleConfig.java @@ -46,7 +46,7 @@ public LocalContainerEntityManagerFactoryBean baseXmlEntityManager() { = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(baseXmlDataSource()); em.setPackagesToScan( - "fr.abes.bestppn.entity.basexml"); + "fr.abes.bestppn.model.entity.basexml"); configHibernate(em, platform, showsql, dialect, ddlAuto, generateDdl, initMode); return em; } diff --git a/src/main/java/fr/abes/bestppn/controller/BestPpnController.java b/src/main/java/fr/abes/bestppn/controller/BestPpnController.java index 81237f3..b4ac560 100644 --- a/src/main/java/fr/abes/bestppn/controller/BestPpnController.java +++ b/src/main/java/fr/abes/bestppn/controller/BestPpnController.java @@ -1,6 +1,8 @@ package fr.abes.bestppn.controller; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.BestPpnDto; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.BestPpn; import fr.abes.bestppn.exception.BestPpnException; import fr.abes.bestppn.exception.IllegalDoiException; import fr.abes.bestppn.service.BestPpnService; @@ -15,6 +17,8 @@ import java.io.IOException; import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; @Tag(name = "Calcul du meilleur PPN", description = "API de calcul du meilleur PPN pour une ligne tsv") @CrossOrigin(origins = "*") @@ -37,11 +41,12 @@ public BestPpnController(BestPpnService service) { } ) @GetMapping(value = "/bestPpn") - public String bestPpn(@RequestParam(name = "provider") String provider, @RequestParam(name = "publication_title", required = false) String publicationTitle, - @RequestParam(name = "publication_type") String publicationType, @RequestParam(name = "online_identifier", required = false) String onlineIdentifier, - @RequestParam(name = "print_identifier", required = false) String printIdentifier, @RequestParam(name = "titleUrl", required = false) String titleUrl, - @RequestParam(name = "date_monograph_published_online", required = false) String dateMonographPublishedOnline, @RequestParam(name = "date_monograph_published_print", required = false) String dateMonographPublishedPrint, - @RequestParam(name = "first_author", required = false) String firstAuthor, @RequestParam(name = "force", required = false) Boolean force) throws IOException { + public BestPpnDto bestPpn(@RequestParam(name = "provider") String provider, @RequestParam(name = "publication_title", required = false) String publicationTitle, + @RequestParam(name = "publication_type") String publicationType, @RequestParam(name = "online_identifier", required = false) String onlineIdentifier, + @RequestParam(name = "print_identifier", required = false) String printIdentifier, @RequestParam(name = "titleUrl", required = false) String titleUrl, + @RequestParam(name = "date_monograph_published_online", required = false) String dateMonographPublishedOnline, @RequestParam(name = "date_monograph_published_print", required = false) String dateMonographPublishedPrint, + @RequestParam(name = "first_author", required = false) String firstAuthor, @RequestParam(name = "force", required = false) Boolean force, + @RequestParam(name = "log", required = false) Boolean log) throws IOException { try { LigneKbartDto ligneKbartDto = new LigneKbartDto(); ligneKbartDto.setPublicationType(publicationType); @@ -53,11 +58,16 @@ public String bestPpn(@RequestParam(name = "provider") String provider, @Request ligneKbartDto.setDateMonographPublishedOnline((dateMonographPublishedOnline != null) ? dateMonographPublishedOnline : ""); ligneKbartDto.setFirstAuthor((firstAuthor != null) ? firstAuthor : ""); boolean injectKafka = (force != null) ? force : false; - return service.getBestPpn(ligneKbartDto, provider, injectKafka).getPpn(); + boolean isSendLog = (log != null) ? log : false; + BestPpn bestPpn = service.getBestPpn(ligneKbartDto, provider, injectKafka, isSendLog); + if(!isSendLog) bestPpn.setLogs(null); // désactive l'envoi des logs si non demandés. + return new BestPpnDto(bestPpn); } catch (URISyntaxException e) { throw new IllegalArgumentException("Une url dans le champ title_url du kbart n'est pas correcte"); } catch (BestPpnException | RestClientException | IllegalArgumentException | IllegalDoiException e) { - return e.getMessage(); + List logs = new ArrayList<>(); + logs.add(e.getMessage()); + return new BestPpnDto(logs); } } } diff --git a/src/main/java/fr/abes/bestppn/dto/kafka/PpnWithDestinationDto.java b/src/main/java/fr/abes/bestppn/dto/kafka/PpnWithDestinationDto.java deleted file mode 100644 index dcde83c..0000000 --- a/src/main/java/fr/abes/bestppn/dto/kafka/PpnWithDestinationDto.java +++ /dev/null @@ -1,12 +0,0 @@ -package fr.abes.bestppn.dto.kafka; - -import fr.abes.bestppn.utils.DESTINATION_TOPIC; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -public class PpnWithDestinationDto { - private String ppn; - private DESTINATION_TOPIC destination; -} diff --git a/src/main/java/fr/abes/bestppn/kafka/TopicConsumer.java b/src/main/java/fr/abes/bestppn/kafka/TopicConsumer.java index ad01a6c..a62d1b2 100644 --- a/src/main/java/fr/abes/bestppn/kafka/TopicConsumer.java +++ b/src/main/java/fr/abes/bestppn/kafka/TopicConsumer.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; -import fr.abes.bestppn.entity.bacon.Provider; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.entity.bacon.Provider; import fr.abes.bestppn.exception.*; import fr.abes.bestppn.repository.bacon.ProviderRepository; import fr.abes.bestppn.service.EmailService; diff --git a/src/main/java/fr/abes/bestppn/kafka/TopicProducer.java b/src/main/java/fr/abes/bestppn/kafka/TopicProducer.java index 27a7016..8be8204 100644 --- a/src/main/java/fr/abes/bestppn/kafka/TopicProducer.java +++ b/src/main/java/fr/abes/bestppn/kafka/TopicProducer.java @@ -3,8 +3,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import fr.abes.LigneKbartConnect; import fr.abes.LigneKbartImprime; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; -import fr.abes.bestppn.entity.bacon.ProviderPackage; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.entity.bacon.ProviderPackage; import fr.abes.bestppn.exception.BestPpnException; import fr.abes.bestppn.utils.UtilsMapper; import jakarta.annotation.PostConstruct; diff --git a/src/main/java/fr/abes/bestppn/model/BestPpn.java b/src/main/java/fr/abes/bestppn/model/BestPpn.java new file mode 100644 index 0000000..c5878b6 --- /dev/null +++ b/src/main/java/fr/abes/bestppn/model/BestPpn.java @@ -0,0 +1,52 @@ +package fr.abes.bestppn.model; + +import fr.abes.bestppn.utils.DESTINATION_TOPIC; +import fr.abes.bestppn.utils.TYPE_SUPPORT; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.lang.Nullable; + +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +public class BestPpn { + + @Nullable + private String ppn; + + @Nullable + private TYPE_SUPPORT typeSupport; + + @Nullable + private DESTINATION_TOPIC destination; + + @Nullable + private List logs; + + public BestPpn(String ppn, DESTINATION_TOPIC destination) { + this.ppn = ppn; + this.destination = destination; + } + + public BestPpn(String ppn, DESTINATION_TOPIC destination, TYPE_SUPPORT typeSupport) { + this.ppn = ppn; + this.destination = destination; + this.typeSupport = typeSupport; + } + + public BestPpn(String ppn, DESTINATION_TOPIC destination, List logs) { + this.ppn = ppn; + this.destination = destination; + this.logs = logs; + } + + public BestPpn(String ppn, DESTINATION_TOPIC destination, TYPE_SUPPORT typeSupport, List logs) { + this.ppn = ppn; + this.destination = destination; + this.typeSupport = typeSupport; + this.logs = logs; + } +} diff --git a/src/main/java/fr/abes/bestppn/model/dto/BestPpnDto.java b/src/main/java/fr/abes/bestppn/model/dto/BestPpnDto.java new file mode 100644 index 0000000..87d6e42 --- /dev/null +++ b/src/main/java/fr/abes/bestppn/model/dto/BestPpnDto.java @@ -0,0 +1,44 @@ +package fr.abes.bestppn.model.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import fr.abes.bestppn.model.BestPpn; +import fr.abes.bestppn.utils.TYPE_SUPPORT; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.lang.Nullable; + +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +public class BestPpnDto { + @Nullable + @JsonInclude(JsonInclude.Include.NON_NULL) + private String ppn; + + @Nullable + @JsonInclude(JsonInclude.Include.NON_NULL) + private TYPE_SUPPORT typeSupport; + + @Nullable + @JsonInclude(JsonInclude.Include.NON_NULL) + private List logs; + + public BestPpnDto(String ppn, TYPE_SUPPORT typeSupport, List logs) { + this.ppn = ppn; + this.typeSupport = typeSupport; + this.logs = logs; + } + + public BestPpnDto(List logs) { + this.logs = logs; + } + + public BestPpnDto(BestPpn bestPpn) { + this.ppn = bestPpn.getPpn(); + this.typeSupport = bestPpn.getTypeSupport(); + this.logs = bestPpn.getLogs(); + } +} diff --git a/src/main/java/fr/abes/bestppn/dto/PackageKbartDto.java b/src/main/java/fr/abes/bestppn/model/dto/PackageKbartDto.java similarity index 88% rename from src/main/java/fr/abes/bestppn/dto/PackageKbartDto.java rename to src/main/java/fr/abes/bestppn/model/dto/PackageKbartDto.java index 6a7f8e1..fd211ab 100644 --- a/src/main/java/fr/abes/bestppn/dto/PackageKbartDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/PackageKbartDto.java @@ -1,6 +1,6 @@ -package fr.abes.bestppn.dto; +package fr.abes.bestppn.model.dto; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; diff --git a/src/main/java/fr/abes/bestppn/dto/kafka/KbartProviderDto.java b/src/main/java/fr/abes/bestppn/model/dto/kafka/KbartProviderDto.java similarity index 90% rename from src/main/java/fr/abes/bestppn/dto/kafka/KbartProviderDto.java rename to src/main/java/fr/abes/bestppn/model/dto/kafka/KbartProviderDto.java index 071b466..c7a5d7f 100644 --- a/src/main/java/fr/abes/bestppn/dto/kafka/KbartProviderDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/kafka/KbartProviderDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.kafka; +package fr.abes.bestppn.model.dto.kafka; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; diff --git a/src/main/java/fr/abes/bestppn/dto/kafka/LigneKbartDto.java b/src/main/java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java similarity index 99% rename from src/main/java/fr/abes/bestppn/dto/kafka/LigneKbartDto.java rename to src/main/java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java index fa07864..01bcb5b 100644 --- a/src/main/java/fr/abes/bestppn/dto/kafka/LigneKbartDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/kafka/LigneKbartDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.kafka; +package fr.abes.bestppn.model.dto.kafka; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/fr/abes/bestppn/dto/kafka/PpnKbartProviderDto.java b/src/main/java/fr/abes/bestppn/model/dto/kafka/PpnKbartProviderDto.java similarity index 94% rename from src/main/java/fr/abes/bestppn/dto/kafka/PpnKbartProviderDto.java rename to src/main/java/fr/abes/bestppn/model/dto/kafka/PpnKbartProviderDto.java index 51f83c3..8c33b6a 100644 --- a/src/main/java/fr/abes/bestppn/dto/kafka/PpnKbartProviderDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/kafka/PpnKbartProviderDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.kafka; +package fr.abes.bestppn.model.dto.kafka; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/fr/abes/bestppn/dto/mail/MailDto.java b/src/main/java/fr/abes/bestppn/model/dto/mail/MailDto.java similarity index 85% rename from src/main/java/fr/abes/bestppn/dto/mail/MailDto.java rename to src/main/java/fr/abes/bestppn/model/dto/mail/MailDto.java index 0f48efe..df8c40c 100644 --- a/src/main/java/fr/abes/bestppn/dto/mail/MailDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/mail/MailDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.mail; +package fr.abes.bestppn.model.dto.mail; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/fr/abes/bestppn/dto/wscall/PpnWithTypeDto.java b/src/main/java/fr/abes/bestppn/model/dto/wscall/PpnWithTypeDto.java similarity index 95% rename from src/main/java/fr/abes/bestppn/dto/wscall/PpnWithTypeDto.java rename to src/main/java/fr/abes/bestppn/model/dto/wscall/PpnWithTypeDto.java index 72812d0..9f45723 100644 --- a/src/main/java/fr/abes/bestppn/dto/wscall/PpnWithTypeDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/wscall/PpnWithTypeDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.wscall; +package fr.abes.bestppn.model.dto.wscall; import fr.abes.bestppn.utils.TYPE_DOCUMENT; import fr.abes.bestppn.utils.TYPE_SUPPORT; diff --git a/src/main/java/fr/abes/bestppn/dto/wscall/ResultDat2PpnWebDto.java b/src/main/java/fr/abes/bestppn/model/dto/wscall/ResultDat2PpnWebDto.java similarity index 93% rename from src/main/java/fr/abes/bestppn/dto/wscall/ResultDat2PpnWebDto.java rename to src/main/java/fr/abes/bestppn/model/dto/wscall/ResultDat2PpnWebDto.java index 1d236db..20f4b38 100644 --- a/src/main/java/fr/abes/bestppn/dto/wscall/ResultDat2PpnWebDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/wscall/ResultDat2PpnWebDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.wscall; +package fr.abes.bestppn.model.dto.wscall; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; diff --git a/src/main/java/fr/abes/bestppn/dto/wscall/ResultWsSudocDto.java b/src/main/java/fr/abes/bestppn/model/dto/wscall/ResultWsSudocDto.java similarity index 97% rename from src/main/java/fr/abes/bestppn/dto/wscall/ResultWsSudocDto.java rename to src/main/java/fr/abes/bestppn/model/dto/wscall/ResultWsSudocDto.java index 4050cb4..bf53ab0 100644 --- a/src/main/java/fr/abes/bestppn/dto/wscall/ResultWsSudocDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/wscall/ResultWsSudocDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.wscall; +package fr.abes.bestppn.model.dto.wscall; import fr.abes.bestppn.utils.TYPE_SUPPORT; import lombok.Getter; diff --git a/src/main/java/fr/abes/bestppn/dto/wscall/SearchDatWebDto.java b/src/main/java/fr/abes/bestppn/model/dto/wscall/SearchDatWebDto.java similarity index 85% rename from src/main/java/fr/abes/bestppn/dto/wscall/SearchDatWebDto.java rename to src/main/java/fr/abes/bestppn/model/dto/wscall/SearchDatWebDto.java index b571164..b3b3660 100644 --- a/src/main/java/fr/abes/bestppn/dto/wscall/SearchDatWebDto.java +++ b/src/main/java/fr/abes/bestppn/model/dto/wscall/SearchDatWebDto.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.dto.wscall; +package fr.abes.bestppn.model.dto.wscall; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/fr/abes/bestppn/entity/ExecutionReport.java b/src/main/java/fr/abes/bestppn/model/entity/ExecutionReport.java similarity index 97% rename from src/main/java/fr/abes/bestppn/entity/ExecutionReport.java rename to src/main/java/fr/abes/bestppn/model/entity/ExecutionReport.java index 768f416..8348edf 100644 --- a/src/main/java/fr/abes/bestppn/entity/ExecutionReport.java +++ b/src/main/java/fr/abes/bestppn/model/entity/ExecutionReport.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity; +package fr.abes.bestppn.model.entity; import lombok.Data; diff --git a/src/main/java/fr/abes/bestppn/entity/PpnResultList.java b/src/main/java/fr/abes/bestppn/model/entity/PpnResultList.java similarity index 88% rename from src/main/java/fr/abes/bestppn/entity/PpnResultList.java rename to src/main/java/fr/abes/bestppn/model/entity/PpnResultList.java index ab221fc..350c933 100644 --- a/src/main/java/fr/abes/bestppn/entity/PpnResultList.java +++ b/src/main/java/fr/abes/bestppn/model/entity/PpnResultList.java @@ -1,6 +1,6 @@ -package fr.abes.bestppn.entity; +package fr.abes.bestppn.model.entity; -import fr.abes.bestppn.dto.wscall.PpnWithTypeDto; +import fr.abes.bestppn.model.dto.wscall.PpnWithTypeDto; import fr.abes.bestppn.utils.TYPE_SUPPORT; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/fr/abes/bestppn/entity/bacon/LigneKbart.java b/src/main/java/fr/abes/bestppn/model/entity/bacon/LigneKbart.java similarity index 91% rename from src/main/java/fr/abes/bestppn/entity/bacon/LigneKbart.java rename to src/main/java/fr/abes/bestppn/model/entity/bacon/LigneKbart.java index e1b407c..4cdb38d 100644 --- a/src/main/java/fr/abes/bestppn/entity/bacon/LigneKbart.java +++ b/src/main/java/fr/abes/bestppn/model/entity/bacon/LigneKbart.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.bacon; +package fr.abes.bestppn.model.entity.bacon; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/fr/abes/bestppn/entity/bacon/Provider.java b/src/main/java/fr/abes/bestppn/model/entity/bacon/Provider.java similarity index 96% rename from src/main/java/fr/abes/bestppn/entity/bacon/Provider.java rename to src/main/java/fr/abes/bestppn/model/entity/bacon/Provider.java index 987688b..cbd197c 100644 --- a/src/main/java/fr/abes/bestppn/entity/bacon/Provider.java +++ b/src/main/java/fr/abes/bestppn/model/entity/bacon/Provider.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.bacon; +package fr.abes.bestppn.model.entity.bacon; import jakarta.persistence.*; import lombok.Getter; diff --git a/src/main/java/fr/abes/bestppn/entity/bacon/ProviderPackage.java b/src/main/java/fr/abes/bestppn/model/entity/bacon/ProviderPackage.java similarity index 96% rename from src/main/java/fr/abes/bestppn/entity/bacon/ProviderPackage.java rename to src/main/java/fr/abes/bestppn/model/entity/bacon/ProviderPackage.java index d08a17c..8dc1192 100644 --- a/src/main/java/fr/abes/bestppn/entity/bacon/ProviderPackage.java +++ b/src/main/java/fr/abes/bestppn/model/entity/bacon/ProviderPackage.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.bacon; +package fr.abes.bestppn.model.entity.bacon; import jakarta.persistence.*; import lombok.AllArgsConstructor; diff --git a/src/main/java/fr/abes/bestppn/entity/basexml/NoticesBibio.java b/src/main/java/fr/abes/bestppn/model/entity/basexml/NoticesBibio.java similarity index 94% rename from src/main/java/fr/abes/bestppn/entity/basexml/NoticesBibio.java rename to src/main/java/fr/abes/bestppn/model/entity/basexml/NoticesBibio.java index 46cc04a..2ec70e3 100644 --- a/src/main/java/fr/abes/bestppn/entity/basexml/NoticesBibio.java +++ b/src/main/java/fr/abes/bestppn/model/entity/basexml/NoticesBibio.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.basexml; +package fr.abes.bestppn.model.entity.basexml; import jakarta.persistence.*; import lombok.Getter; diff --git a/src/main/java/fr/abes/bestppn/entity/basexml/notice/Controlfield.java b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/Controlfield.java similarity index 87% rename from src/main/java/fr/abes/bestppn/entity/basexml/notice/Controlfield.java rename to src/main/java/fr/abes/bestppn/model/entity/basexml/notice/Controlfield.java index bfeac93..715ded3 100644 --- a/src/main/java/fr/abes/bestppn/entity/basexml/notice/Controlfield.java +++ b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/Controlfield.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.basexml.notice; +package fr.abes.bestppn.model.entity.basexml.notice; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; diff --git a/src/main/java/fr/abes/bestppn/entity/basexml/notice/Datafield.java b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/Datafield.java similarity index 91% rename from src/main/java/fr/abes/bestppn/entity/basexml/notice/Datafield.java rename to src/main/java/fr/abes/bestppn/model/entity/basexml/notice/Datafield.java index 46e85b5..241c6f1 100644 --- a/src/main/java/fr/abes/bestppn/entity/basexml/notice/Datafield.java +++ b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/Datafield.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.basexml.notice; +package fr.abes.bestppn.model.entity.basexml.notice; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import lombok.Getter; diff --git a/src/main/java/fr/abes/bestppn/entity/basexml/notice/NoticeXml.java b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/NoticeXml.java similarity index 98% rename from src/main/java/fr/abes/bestppn/entity/basexml/notice/NoticeXml.java rename to src/main/java/fr/abes/bestppn/model/entity/basexml/notice/NoticeXml.java index 6fcb2a0..5bdb060 100644 --- a/src/main/java/fr/abes/bestppn/entity/basexml/notice/NoticeXml.java +++ b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/NoticeXml.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.basexml.notice; +package fr.abes.bestppn.model.entity.basexml.notice; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; diff --git a/src/main/java/fr/abes/bestppn/entity/basexml/notice/SubField.java b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/SubField.java similarity index 89% rename from src/main/java/fr/abes/bestppn/entity/basexml/notice/SubField.java rename to src/main/java/fr/abes/bestppn/model/entity/basexml/notice/SubField.java index 8a8a833..6dea944 100644 --- a/src/main/java/fr/abes/bestppn/entity/basexml/notice/SubField.java +++ b/src/main/java/fr/abes/bestppn/model/entity/basexml/notice/SubField.java @@ -1,4 +1,4 @@ -package fr.abes.bestppn.entity.basexml.notice; +package fr.abes.bestppn.model.entity.basexml.notice; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; diff --git a/src/main/java/fr/abes/bestppn/repository/bacon/LigneKbartRepository.java b/src/main/java/fr/abes/bestppn/repository/bacon/LigneKbartRepository.java index 9c44e59..92459cd 100644 --- a/src/main/java/fr/abes/bestppn/repository/bacon/LigneKbartRepository.java +++ b/src/main/java/fr/abes/bestppn/repository/bacon/LigneKbartRepository.java @@ -1,7 +1,7 @@ package fr.abes.bestppn.repository.bacon; import fr.abes.bestppn.configuration.BaconDbConfiguration; -import fr.abes.bestppn.entity.bacon.LigneKbart; +import fr.abes.bestppn.model.entity.bacon.LigneKbart; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/fr/abes/bestppn/repository/bacon/ProviderPackageRepository.java b/src/main/java/fr/abes/bestppn/repository/bacon/ProviderPackageRepository.java index aa493e0..0b193c8 100644 --- a/src/main/java/fr/abes/bestppn/repository/bacon/ProviderPackageRepository.java +++ b/src/main/java/fr/abes/bestppn/repository/bacon/ProviderPackageRepository.java @@ -1,7 +1,7 @@ package fr.abes.bestppn.repository.bacon; import fr.abes.bestppn.configuration.BaconDbConfiguration; -import fr.abes.bestppn.entity.bacon.ProviderPackage; +import fr.abes.bestppn.model.entity.bacon.ProviderPackage; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/fr/abes/bestppn/repository/bacon/ProviderRepository.java b/src/main/java/fr/abes/bestppn/repository/bacon/ProviderRepository.java index bbab272..ad3aa26 100644 --- a/src/main/java/fr/abes/bestppn/repository/bacon/ProviderRepository.java +++ b/src/main/java/fr/abes/bestppn/repository/bacon/ProviderRepository.java @@ -1,7 +1,7 @@ package fr.abes.bestppn.repository.bacon; import fr.abes.bestppn.configuration.BaconDbConfiguration; -import fr.abes.bestppn.entity.bacon.Provider; +import fr.abes.bestppn.model.entity.bacon.Provider; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/fr/abes/bestppn/repository/basexml/NoticesBibioRepository.java b/src/main/java/fr/abes/bestppn/repository/basexml/NoticesBibioRepository.java index f15a2ff..f4165b2 100644 --- a/src/main/java/fr/abes/bestppn/repository/basexml/NoticesBibioRepository.java +++ b/src/main/java/fr/abes/bestppn/repository/basexml/NoticesBibioRepository.java @@ -1,6 +1,6 @@ package fr.abes.bestppn.repository.basexml; -import fr.abes.bestppn.entity.basexml.NoticesBibio; +import fr.abes.bestppn.model.entity.basexml.NoticesBibio; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/fr/abes/bestppn/service/BestPpnService.java b/src/main/java/fr/abes/bestppn/service/BestPpnService.java index f81d605..a1669ba 100644 --- a/src/main/java/fr/abes/bestppn/service/BestPpnService.java +++ b/src/main/java/fr/abes/bestppn/service/BestPpnService.java @@ -1,16 +1,18 @@ package fr.abes.bestppn.service; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; -import fr.abes.bestppn.dto.kafka.PpnWithDestinationDto; -import fr.abes.bestppn.dto.wscall.PpnWithTypeDto; -import fr.abes.bestppn.dto.wscall.ResultDat2PpnWebDto; -import fr.abes.bestppn.dto.wscall.ResultWsSudocDto; -import fr.abes.bestppn.entity.basexml.notice.NoticeXml; +import fr.abes.bestppn.model.BestPpn; import fr.abes.bestppn.exception.BestPpnException; import fr.abes.bestppn.exception.IllegalDoiException; import fr.abes.bestppn.kafka.TopicProducer; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.wscall.PpnWithTypeDto; +import fr.abes.bestppn.model.dto.wscall.ResultDat2PpnWebDto; +import fr.abes.bestppn.model.dto.wscall.ResultWsSudocDto; +import fr.abes.bestppn.model.entity.basexml.notice.NoticeXml; import fr.abes.bestppn.utils.*; +import io.netty.handler.logging.LogLevel; import lombok.Getter; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -18,10 +20,7 @@ import java.io.IOException; import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import java.util.*; @Service @Getter @@ -49,6 +48,11 @@ public class BestPpnService { private final CheckUrlService checkUrlService; + @Setter + private List kbartLineLogs; + + @Setter + private Boolean isSendLogs; public BestPpnService(WsService service, NoticeService noticeService, TopicProducer topicProducer, CheckUrlService checkUrlService) { this.service = service; @@ -57,19 +61,21 @@ public BestPpnService(WsService service, NoticeService noticeService, TopicProdu this.checkUrlService = checkUrlService; } - public PpnWithDestinationDto getBestPpn(LigneKbartDto kbart, String provider, boolean injectKafka) throws IOException, BestPpnException, URISyntaxException, RestClientException, IllegalArgumentException, IllegalDoiException { + public BestPpn getBestPpn(LigneKbartDto kbart, String provider, boolean injectKafka, boolean isSendLogs) throws IOException, BestPpnException, URISyntaxException, RestClientException, IllegalArgumentException, IllegalDoiException { + kbartLineLogs = new ArrayList<>(); + this.isSendLogs = isSendLogs; Map ppnElecScoredList = new HashMap<>(); Set ppnPrintResultList = new HashSet<>(); if (!kbart.getPublicationType().isEmpty()) { provider = kbart.getPublicationType().equals(PUBLICATION_TYPE.serial.toString()) ? "" : provider; if (kbart.getOnlineIdentifier() != null && !kbart.getOnlineIdentifier().isEmpty()) { - log.debug("paramètres en entrée : type : " + kbart.getPublicationType() + " / id : " + kbart.getOnlineIdentifier() + " / provider : " + provider); + sendLog(LogLevel.DEBUG, "paramètres en entrée : type : " + kbart.getPublicationType() + " / id : " + kbart.getOnlineIdentifier() + " / provider : " + provider); feedPpnListFromOnline(kbart, provider, ppnElecScoredList, ppnPrintResultList); } if (kbart.getPrintIdentifier() != null && !kbart.getPrintIdentifier().isEmpty()) { - log.debug("paramètres en entrée : type : " + kbart.getPublicationType() + " / id : " + kbart.getPrintIdentifier() + " / provider : " + provider); + sendLog(LogLevel.DEBUG, "paramètres en entrée : type : " + kbart.getPublicationType() + " / id : " + kbart.getPrintIdentifier() + " / provider : " + provider); feedPpnListFromPrint(kbart, provider, ppnElecScoredList, ppnPrintResultList); } } @@ -86,7 +92,7 @@ public PpnWithDestinationDto getBestPpn(LigneKbartDto kbart, String provider, bo } private void feedPpnListFromOnline(LigneKbartDto kbart, String provider, Map ppnElecScoredList, Set ppnPrintResultList) throws IOException, URISyntaxException, IllegalArgumentException, BestPpnException { - log.debug("Entrée dans onlineId2Ppn"); + sendLog(LogLevel.DEBUG, "Entrée dans onlineId2Ppn"); try { setScoreToEveryPpnFromResultWS(service.callOnlineId2Ppn(kbart.getPublicationType(), kbart.getOnlineIdentifier(), provider), kbart.getTitleUrl(), this.scoreOnlineId2PpnElect, ppnElecScoredList, ppnPrintResultList); } catch (RestClientException ex) { @@ -95,7 +101,7 @@ private void feedPpnListFromOnline(LigneKbartDto kbart, String provider, Map ppnElecScoredList, Set ppnPrintResultList) throws IOException, URISyntaxException, IllegalArgumentException, BestPpnException { - log.debug("Entrée dans printId2Ppn"); + sendLog(LogLevel.DEBUG, "Entrée dans printId2Ppn"); try { ResultWsSudocDto resultCallWs = service.callPrintId2Ppn(kbart.getPublicationType(), kbart.getPrintIdentifier(), provider); ResultWsSudocDto resultWithTypeElectronique = resultCallWs.getPpnWithTypeElectronique(); @@ -114,15 +120,15 @@ private void feedPpnListFromPrint(LigneKbartDto kbart, String provider, Map ppnElecScoredList, Set ppnPrintResultList) throws IOException { ResultDat2PpnWebDto resultDat2PpnWeb = null; if (!kbart.getAnneeFromDate_monograph_published_online().isEmpty()) { - log.debug("Appel dat2ppn : date_monograph_published_online : " + kbart.getAnneeFromDate_monograph_published_online() + " / publication_title : " + kbart.getPublicationTitle() + " auteur : " + kbart.getAuthor()); + sendLog(LogLevel.DEBUG, "Appel dat2ppn : date_monograph_published_online : " + kbart.getAnneeFromDate_monograph_published_online() + " / publication_title : " + kbart.getPublicationTitle() + " auteur : " + kbart.getAuthor()); resultDat2PpnWeb = service.callDat2Ppn(kbart.getAnneeFromDate_monograph_published_online(), kbart.getAuthor(), kbart.getPublicationTitle()); } else if (ppnElecScoredList.isEmpty() && !kbart.getAnneeFromDate_monograph_published_print().isEmpty()) { - log.debug("Appel dat2ppn : date_monograph_published_print : " + kbart.getAnneeFromDate_monograph_published_print() + " / publication_title : " + kbart.getPublicationTitle() + " auteur : " + kbart.getAuthor()); + sendLog(LogLevel.DEBUG, "Appel dat2ppn : date_monograph_published_print : " + kbart.getAnneeFromDate_monograph_published_print() + " / publication_title : " + kbart.getPublicationTitle() + " auteur : " + kbart.getAuthor()); resultDat2PpnWeb = service.callDat2Ppn(kbart.getAnneeFromDate_monograph_published_print(), kbart.getAuthor(), kbart.getPublicationTitle()); } if(resultDat2PpnWeb != null && !resultDat2PpnWeb.getPpns().isEmpty()) { for (String ppn : resultDat2PpnWeb.getPpns()) { - log.debug("résultat : ppn " + ppn); + sendLog(LogLevel.DEBUG, "résultat : ppn " + ppn); NoticeXml notice = noticeService.getNoticeByPpn(ppn); if (notice.isNoticeElectronique()) { ppnElecScoredList.put(ppn, scoreDat2Ppn); @@ -140,7 +146,7 @@ private void feedPpnListFromDoi(String doi, String provider, Map ppnWithTypeDto.getTypeSupport().equals(TYPE_SUPPORT.ELECTRONIQUE)).count(); for (PpnWithTypeDto ppn : resultCallWs.getPpns()) { if(ppn.getTypeSupport().equals(TYPE_SUPPORT.IMPRIME)) { - log.info("PPN Imprimé : " + ppn); + sendLog(LogLevel.INFO, "PPN Imprimé : " + ppn); ppnPrintResultList.add(ppn.getPpn()); } else if (ppn.getTypeDocument() != TYPE_DOCUMENT.MONOGRAPHIE || ppn.isProviderPresent() || checkUrlService.checkUrlInNotice(ppn.getPpn(), titleUrl)){ setScoreToPpnElect(score, ppnElecResultList, nbPpnElec, ppn); } else { - log.error("Le PPN " + ppn + " n'a pas de provider trouvé"); + sendLog(LogLevel.ERROR, "Le PPN " + ppn + " n'a pas de provider trouvé"); } } } @@ -169,23 +175,24 @@ private void setScoreToPpnElect(int score, Map ppnElecScoredLis } else { ppnElecScoredList.put(ppn.getPpn(), (score / nbPpnElec)); } - log.info("PPN Electronique : " + ppn + " / score : " + ppnElecScoredList.get(ppn.getPpn())); + sendLog(LogLevel.INFO, "PPN Electronique : " + ppn + " / score : " + ppnElecScoredList.get(ppn.getPpn())); } - public PpnWithDestinationDto getBestPpnByScore(LigneKbartDto kbart, Map ppnElecResultList, Set ppnPrintResultList, boolean isForced) throws BestPpnException { + public BestPpn getBestPpnByScore(LigneKbartDto kbart, Map ppnElecResultList, Set ppnPrintResultList, boolean isForced) throws BestPpnException { Map ppnElecScore = Utils.getMaxValuesFromMap(ppnElecResultList); return switch (ppnElecScore.size()) { case 0 -> { - log.info("Aucun ppn électronique trouvé." + kbart); + sendLog(LogLevel.INFO, "Aucun ppn électronique trouvé. " + kbart); yield switch (ppnPrintResultList.size()) { case 0 -> { kbart.setErrorType("Aucun ppn trouvé"); - yield new PpnWithDestinationDto(null, DESTINATION_TOPIC.NO_PPN_FOUND_SUDOC); + yield new BestPpn(null, DESTINATION_TOPIC.NO_PPN_FOUND_SUDOC, kbartLineLogs); } case 1 -> { kbart.setErrorType("Ppn imprimé trouvé : " + ppnPrintResultList.stream().toList().get(0)); - yield new PpnWithDestinationDto(ppnPrintResultList.stream().toList().get(0),DESTINATION_TOPIC.PRINT_PPN_SUDOC); + sendLog(LogLevel.DEBUG, "Ppn imprimé trouvé : " + ppnPrintResultList.stream().toList().get(0)); + yield new BestPpn(ppnPrintResultList.stream().toList().get(0),DESTINATION_TOPIC.PRINT_PPN_SUDOC, TYPE_SUPPORT.IMPRIME, kbartLineLogs); } default -> { @@ -193,15 +200,15 @@ yield switch (ppnPrintResultList.size()) { kbart.setErrorType(errorString); // vérification du forçage if (isForced) { - log.error(errorString); - yield new PpnWithDestinationDto("",DESTINATION_TOPIC.BEST_PPN_BACON); + sendLog(LogLevel.ERROR,"Plusieurs ppn imprimés (" + String.join(", ", ppnPrintResultList) + ") ont été trouvés."); + yield new BestPpn("",DESTINATION_TOPIC.BEST_PPN_BACON, kbartLineLogs); } else { throw new BestPpnException(errorString); } } }; } - case 1 -> new PpnWithDestinationDto(ppnElecScore.keySet().stream().findFirst().get(), DESTINATION_TOPIC.BEST_PPN_BACON); + case 1 -> new BestPpn(ppnElecScore.keySet().stream().findFirst().get(), DESTINATION_TOPIC.BEST_PPN_BACON, TYPE_SUPPORT.ELECTRONIQUE, kbartLineLogs); default -> { String listPpn = String.join(", ", ppnElecScore.keySet()); @@ -209,12 +216,25 @@ yield switch (ppnPrintResultList.size()) { kbart.setErrorType(errorString); // vérification du forçage if (isForced) { - log.error(errorString); - yield new PpnWithDestinationDto("", DESTINATION_TOPIC.BEST_PPN_BACON); + sendLog(LogLevel.ERROR, errorString); + yield new BestPpn("", DESTINATION_TOPIC.BEST_PPN_BACON, kbartLineLogs); } else { throw new BestPpnException(errorString); } } }; } + + public void sendLog(LogLevel level, String message) { + if (isSendLogs) { + if (level.equals(LogLevel.INFO) || level.equals(LogLevel.ERROR)) kbartLineLogs.add(message); + } + switch (level) { + case DEBUG -> log.debug(message); + case TRACE -> log.trace(message); + case WARN -> log.warn(message); + case ERROR -> log.error(message); + default -> log.info(message); + } + } } diff --git a/src/main/java/fr/abes/bestppn/service/CheckUrlService.java b/src/main/java/fr/abes/bestppn/service/CheckUrlService.java index bd5f34d..c1d8bed 100644 --- a/src/main/java/fr/abes/bestppn/service/CheckUrlService.java +++ b/src/main/java/fr/abes/bestppn/service/CheckUrlService.java @@ -1,8 +1,8 @@ package fr.abes.bestppn.service; -import fr.abes.bestppn.entity.basexml.notice.Datafield; -import fr.abes.bestppn.entity.basexml.notice.NoticeXml; -import fr.abes.bestppn.entity.basexml.notice.SubField; +import fr.abes.bestppn.model.entity.basexml.notice.Datafield; +import fr.abes.bestppn.model.entity.basexml.notice.NoticeXml; +import fr.abes.bestppn.model.entity.basexml.notice.SubField; import fr.abes.bestppn.utils.Utils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/src/main/java/fr/abes/bestppn/service/EmailService.java b/src/main/java/fr/abes/bestppn/service/EmailService.java index 84ed9cf..5601e33 100644 --- a/src/main/java/fr/abes/bestppn/service/EmailService.java +++ b/src/main/java/fr/abes/bestppn/service/EmailService.java @@ -7,9 +7,9 @@ import com.opencsv.bean.StatefulBeanToCsvBuilder; import com.opencsv.exceptions.CsvDataTypeMismatchException; import com.opencsv.exceptions.CsvRequiredFieldEmptyException; -import fr.abes.bestppn.dto.PackageKbartDto; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; -import fr.abes.bestppn.dto.mail.MailDto; +import fr.abes.bestppn.model.dto.PackageKbartDto; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.mail.MailDto; import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpEntity; import org.apache.http.client.methods.HttpPost; diff --git a/src/main/java/fr/abes/bestppn/service/ExecutionReportService.java b/src/main/java/fr/abes/bestppn/service/ExecutionReportService.java index ce228e1..2faa4d4 100644 --- a/src/main/java/fr/abes/bestppn/service/ExecutionReportService.java +++ b/src/main/java/fr/abes/bestppn/service/ExecutionReportService.java @@ -1,6 +1,6 @@ package fr.abes.bestppn.service; -import fr.abes.bestppn.entity.ExecutionReport; +import fr.abes.bestppn.model.entity.ExecutionReport; import lombok.Getter; import org.springframework.stereotype.Service; diff --git a/src/main/java/fr/abes/bestppn/service/KbartService.java b/src/main/java/fr/abes/bestppn/service/KbartService.java index c41196a..fa60729 100644 --- a/src/main/java/fr/abes/bestppn/service/KbartService.java +++ b/src/main/java/fr/abes/bestppn/service/KbartService.java @@ -1,10 +1,10 @@ package fr.abes.bestppn.service; import fr.abes.LigneKbartImprime; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; -import fr.abes.bestppn.dto.kafka.PpnWithDestinationDto; -import fr.abes.bestppn.entity.bacon.Provider; -import fr.abes.bestppn.entity.bacon.ProviderPackage; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.BestPpn; +import fr.abes.bestppn.model.entity.bacon.Provider; +import fr.abes.bestppn.model.entity.bacon.ProviderPackage; import fr.abes.bestppn.exception.BestPpnException; import fr.abes.bestppn.exception.IllegalDateException; import fr.abes.bestppn.exception.IllegalDoiException; @@ -59,13 +59,13 @@ public void processConsumerRecord(LigneKbartDto ligneFromKafka, String providerN log.info("Début calcul BestPpn pour la ligne " + ligneFromKafka); if (ligneFromKafka.isBestPpnEmpty()) { log.info(ligneFromKafka.toString()); - PpnWithDestinationDto ppnWithDestinationDto = service.getBestPpn(ligneFromKafka, providerName, isForced); - switch (ppnWithDestinationDto.getDestination()) { + BestPpn bestPpn = service.getBestPpn(ligneFromKafka, providerName, isForced, false); + switch (bestPpn.getDestination()) { case BEST_PPN_BACON -> { - ligneFromKafka.setBestPpn(ppnWithDestinationDto.getPpn()); + ligneFromKafka.setBestPpn(bestPpn.getPpn()); executionReportService.addNbBestPpnFind(); } - case PRINT_PPN_SUDOC -> ppnToCreate.add(getLigneKbartImprime(ppnWithDestinationDto, ligneFromKafka)); + case PRINT_PPN_SUDOC -> ppnToCreate.add(getLigneKbartImprime(bestPpn, ligneFromKafka)); case NO_PPN_FOUND_SUDOC -> { if (ligneFromKafka.getPublicationType().equals("monograph")) { ppnFromKbartToCreate.add(ligneFromKafka); @@ -95,9 +95,9 @@ public void clearListesKbart() { ppnFromKbartToCreate.clear(); } - private static LigneKbartImprime getLigneKbartImprime(PpnWithDestinationDto ppnWithDestinationDto, LigneKbartDto ligneFromKafka) { + private static LigneKbartImprime getLigneKbartImprime(BestPpn bestPpn, LigneKbartDto ligneFromKafka) { return LigneKbartImprime.newBuilder() - .setPpn(ppnWithDestinationDto.getPpn()) + .setPpn(bestPpn.getPpn()) .setPublicationTitle(ligneFromKafka.getPublicationTitle()) .setPrintIdentifier(ligneFromKafka.getPrintIdentifier()) .setOnlineIdentifier(ligneFromKafka.getOnlineIdentifier()) diff --git a/src/main/java/fr/abes/bestppn/service/LogFileService.java b/src/main/java/fr/abes/bestppn/service/LogFileService.java index 7533dd4..932f995 100644 --- a/src/main/java/fr/abes/bestppn/service/LogFileService.java +++ b/src/main/java/fr/abes/bestppn/service/LogFileService.java @@ -1,6 +1,6 @@ package fr.abes.bestppn.service; -import fr.abes.bestppn.entity.ExecutionReport; +import fr.abes.bestppn.model.entity.ExecutionReport; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/src/main/java/fr/abes/bestppn/service/NoticeService.java b/src/main/java/fr/abes/bestppn/service/NoticeService.java index 9dabf63..8753761 100644 --- a/src/main/java/fr/abes/bestppn/service/NoticeService.java +++ b/src/main/java/fr/abes/bestppn/service/NoticeService.java @@ -1,8 +1,8 @@ package fr.abes.bestppn.service; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import fr.abes.bestppn.entity.basexml.NoticesBibio; -import fr.abes.bestppn.entity.basexml.notice.NoticeXml; +import fr.abes.bestppn.model.entity.basexml.NoticesBibio; +import fr.abes.bestppn.model.entity.basexml.notice.NoticeXml; import fr.abes.bestppn.repository.basexml.NoticesBibioRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/src/main/java/fr/abes/bestppn/service/ProviderService.java b/src/main/java/fr/abes/bestppn/service/ProviderService.java index 11091da..279459e 100644 --- a/src/main/java/fr/abes/bestppn/service/ProviderService.java +++ b/src/main/java/fr/abes/bestppn/service/ProviderService.java @@ -1,7 +1,7 @@ package fr.abes.bestppn.service; -import fr.abes.bestppn.entity.bacon.Provider; -import fr.abes.bestppn.entity.bacon.ProviderPackage; +import fr.abes.bestppn.model.entity.bacon.Provider; +import fr.abes.bestppn.model.entity.bacon.ProviderPackage; import fr.abes.bestppn.exception.IllegalDateException; import fr.abes.bestppn.exception.IllegalPackageException; import fr.abes.bestppn.repository.bacon.LigneKbartRepository; diff --git a/src/main/java/fr/abes/bestppn/service/WsService.java b/src/main/java/fr/abes/bestppn/service/WsService.java index 9d47398..5bae48c 100644 --- a/src/main/java/fr/abes/bestppn/service/WsService.java +++ b/src/main/java/fr/abes/bestppn/service/WsService.java @@ -2,12 +2,10 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import fr.abes.bestppn.dto.wscall.ResultDat2PpnWebDto; -import fr.abes.bestppn.dto.wscall.ResultWsSudocDto; -import fr.abes.bestppn.dto.wscall.SearchDatWebDto; -import fr.abes.bestppn.exception.BestPpnException; +import fr.abes.bestppn.model.dto.wscall.ResultDat2PpnWebDto; +import fr.abes.bestppn.model.dto.wscall.ResultWsSudocDto; +import fr.abes.bestppn.model.dto.wscall.SearchDatWebDto; import fr.abes.bestppn.exception.IllegalDoiException; -import fr.abes.bestppn.utils.ExecutionTime; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; diff --git a/src/main/java/fr/abes/bestppn/utils/LigneKbartMapper.java b/src/main/java/fr/abes/bestppn/utils/LigneKbartMapper.java index a2107c5..4a1d821 100644 --- a/src/main/java/fr/abes/bestppn/utils/LigneKbartMapper.java +++ b/src/main/java/fr/abes/bestppn/utils/LigneKbartMapper.java @@ -1,7 +1,7 @@ package fr.abes.bestppn.utils; import fr.abes.LigneKbartConnect; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; import org.modelmapper.Converter; import org.modelmapper.spi.MappingContext; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/fr/abes/bestppn/utils/Utils.java b/src/main/java/fr/abes/bestppn/utils/Utils.java index 2c62793..d7f2cd0 100644 --- a/src/main/java/fr/abes/bestppn/utils/Utils.java +++ b/src/main/java/fr/abes/bestppn/utils/Utils.java @@ -1,9 +1,11 @@ package fr.abes.bestppn.utils; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; import fr.abes.bestppn.exception.IllegalDateException; import fr.abes.bestppn.exception.IllegalPackageException; import fr.abes.bestppn.exception.IllegalProviderException; +import io.netty.handler.logging.LogLevel; +import lombok.extern.slf4j.Slf4j; import java.net.URI; import java.net.URISyntaxException; @@ -14,6 +16,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +@Slf4j public class Utils { public static String extractDomainFromUrl(String url) throws URISyntaxException { diff --git a/src/test/java/fr/abes/bestppn/controller/BestPpnControllerTest.java b/src/test/java/fr/abes/bestppn/controller/BestPpnControllerTest.java index 625f382..608e992 100644 --- a/src/test/java/fr/abes/bestppn/controller/BestPpnControllerTest.java +++ b/src/test/java/fr/abes/bestppn/controller/BestPpnControllerTest.java @@ -3,10 +3,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import fr.abes.bestppn.configuration.MapperConfig; import fr.abes.bestppn.configuration.RestConfiguration; -import fr.abes.bestppn.dto.kafka.PpnWithDestinationDto; +import fr.abes.bestppn.model.BestPpn; import fr.abes.bestppn.exception.BestPpnException; import fr.abes.bestppn.exception.ExceptionControllerHandler; -import fr.abes.bestppn.exception.IllegalDoiException; import fr.abes.bestppn.service.BestPpnService; import fr.abes.bestppn.utils.DESTINATION_TOPIC; import org.junit.jupiter.api.Assertions; @@ -59,8 +58,8 @@ void init() { @Test @DisplayName("test controller with wrong number of parameters") - void testBestPpnControllerWrongNumberOfParameters() throws Exception, IllegalDoiException { - Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean())).thenReturn(new PpnWithDestinationDto("1111111111", DESTINATION_TOPIC.BEST_PPN_BACON)); + void testBestPpnControllerWrongNumberOfParameters() throws Exception { + Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(new BestPpn("1111111111", DESTINATION_TOPIC.BEST_PPN_BACON)); this.mockMvc.perform(get("/api/v1/bestPpn").characterEncoding(StandardCharsets.UTF_8)) .andExpect(status().isBadRequest()) .andExpect(result -> Assertions.assertTrue((result.getResolvedException() instanceof MissingServletRequestParameterException))) @@ -75,7 +74,7 @@ void testBestPpnControllerWrongNumberOfParameters() throws Exception, IllegalDoi @Test @DisplayName("test controller with wrong URL format") void testBestPpnControllerBadUrlFormat() throws Exception { - Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean())).thenThrow(new URISyntaxException("test", "Format d'URL incorrect")); + Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenThrow(new URISyntaxException("test", "Format d'URL incorrect")); this.mockMvc.perform(get("/api/v1/bestPpn?provider=cairn&publication_type=monograph&print_identifier=9781111111111&title_url=test").characterEncoding(StandardCharsets.UTF_8)) .andExpect(status().isBadRequest()) .andExpect(result -> Assertions.assertTrue((result.getResolvedException() instanceof IllegalArgumentException))) @@ -85,7 +84,7 @@ void testBestPpnControllerBadUrlFormat() throws Exception { @Test @DisplayName("test controller with BestPpnException") void testBestPpnControllerBestPpnException() throws Exception { - Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean())).thenThrow(new BestPpnException("Plusieurs ppn imprimés")); + Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenThrow(new BestPpnException("Plusieurs ppn imprimés")); this.mockMvc.perform(get("/api/v1/bestPpn?provider=cairn&publication_type=monograph&print_identifier=9781111111111&title_url=test").characterEncoding(StandardCharsets.UTF_8)) .andExpect(status().isOk()) .andExpect(result -> Assertions.assertTrue(result.getResponse().getContentAsString(StandardCharsets.UTF_8).contains("Plusieurs ppn imprimés"))); @@ -94,7 +93,7 @@ void testBestPpnControllerBestPpnException() throws Exception { @Test @DisplayName("test controller Ok") void testBestPpnControllerOk() throws Exception { - Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean())).thenReturn(new PpnWithDestinationDto("1111111111", DESTINATION_TOPIC.BEST_PPN_BACON)); + Mockito.when(service.getBestPpn(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(new BestPpn("1111111111", DESTINATION_TOPIC.BEST_PPN_BACON)); this.mockMvc.perform(get("/api/v1/bestPpn?provider=cairn&publication_type=monograph&print_identifier=9781111111111&title_url=test").characterEncoding(StandardCharsets.UTF_8)) .andExpect(status().isOk()) .andExpect(result -> Assertions.assertTrue(result.getResponse().getContentAsString(StandardCharsets.UTF_8).contains("111111111"))); diff --git a/src/test/java/fr/abes/bestppn/dto/LigneKbartDtoTest.java b/src/test/java/fr/abes/bestppn/dto/LigneKbartDtoTest.java index 0633aab..57076c2 100644 --- a/src/test/java/fr/abes/bestppn/dto/LigneKbartDtoTest.java +++ b/src/test/java/fr/abes/bestppn/dto/LigneKbartDtoTest.java @@ -1,6 +1,6 @@ package fr.abes.bestppn.dto; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/fr/abes/bestppn/dto/ResultWsSudocDtoTest.java b/src/test/java/fr/abes/bestppn/dto/ResultWsSudocDtoTest.java index a3e9b8c..c55c387 100644 --- a/src/test/java/fr/abes/bestppn/dto/ResultWsSudocDtoTest.java +++ b/src/test/java/fr/abes/bestppn/dto/ResultWsSudocDtoTest.java @@ -1,7 +1,7 @@ package fr.abes.bestppn.dto; -import fr.abes.bestppn.dto.wscall.PpnWithTypeDto; -import fr.abes.bestppn.dto.wscall.ResultWsSudocDto; +import fr.abes.bestppn.model.dto.wscall.PpnWithTypeDto; +import fr.abes.bestppn.model.dto.wscall.ResultWsSudocDto; import fr.abes.bestppn.utils.TYPE_SUPPORT; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/fr/abes/bestppn/entity/basexml/notice/NoticeXmlTest.java b/src/test/java/fr/abes/bestppn/entity/basexml/notice/NoticeXmlTest.java index 0360ac8..b0c2c2e 100644 --- a/src/test/java/fr/abes/bestppn/entity/basexml/notice/NoticeXmlTest.java +++ b/src/test/java/fr/abes/bestppn/entity/basexml/notice/NoticeXmlTest.java @@ -1,5 +1,8 @@ package fr.abes.bestppn.entity.basexml.notice; +import fr.abes.bestppn.model.entity.basexml.notice.Datafield; +import fr.abes.bestppn.model.entity.basexml.notice.NoticeXml; +import fr.abes.bestppn.model.entity.basexml.notice.SubField; import org.assertj.core.util.Lists; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/fr/abes/bestppn/service/BestPpnServiceTest.java b/src/test/java/fr/abes/bestppn/service/BestPpnServiceTest.java index b6781e8..546ed20 100644 --- a/src/test/java/fr/abes/bestppn/service/BestPpnServiceTest.java +++ b/src/test/java/fr/abes/bestppn/service/BestPpnServiceTest.java @@ -2,12 +2,12 @@ import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; -import fr.abes.bestppn.dto.kafka.PpnWithDestinationDto; -import fr.abes.bestppn.dto.wscall.PpnWithTypeDto; -import fr.abes.bestppn.dto.wscall.ResultDat2PpnWebDto; -import fr.abes.bestppn.dto.wscall.ResultWsSudocDto; -import fr.abes.bestppn.entity.basexml.notice.NoticeXml; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.BestPpn; +import fr.abes.bestppn.model.dto.wscall.PpnWithTypeDto; +import fr.abes.bestppn.model.dto.wscall.ResultDat2PpnWebDto; +import fr.abes.bestppn.model.dto.wscall.ResultWsSudocDto; +import fr.abes.bestppn.model.entity.basexml.notice.NoticeXml; import fr.abes.bestppn.exception.BestPpnException; import fr.abes.bestppn.exception.IllegalDoiException; import fr.abes.bestppn.kafka.TopicProducer; @@ -122,7 +122,7 @@ void getBestPpnTest01() throws IOException, BestPpnException, URISyntaxException Mockito.when(noticeService.getNoticeByPpn(Mockito.anyString())).thenReturn(this.noticeElec); // Appel du service - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("100000001", result.getPpn()); @@ -173,7 +173,7 @@ void getBestPpnTest01_WithProviderInNoticeIsPresent() throws IOException, BestPp Mockito.when(noticeService.getNoticeByPpn(Mockito.anyString())).thenReturn(this.noticeElec); // Appel du service - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("100000001", result.getPpn()); @@ -231,7 +231,7 @@ void getBestPpnTest02() throws IOException, BestPpnException, URISyntaxException Mockito.when(noticeService.getNoticeByPpn(Mockito.anyString())).thenReturn(this.noticeElec); // Appel du service - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("100000001", result.getPpn()); @@ -289,7 +289,7 @@ void getBestPpnTest03() throws IOException, BestPpnException, URISyntaxException Mockito.when(noticeService.getNoticeByPpn(Mockito.anyString())).thenReturn(this.noticeElec); // Appel du service - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("100000001", result.getPpn()); @@ -341,7 +341,7 @@ void getBestPpnTest04() throws IOException, URISyntaxException { Mockito.when(noticeService.getNoticeByPpn(Mockito.anyString())).thenReturn(this.noticeElec); // Vérification - BestPpnException result = Assertions.assertThrows(BestPpnException.class, ()-> bestPpnService.getBestPpn(kbart, provider, false)); + BestPpnException result = Assertions.assertThrows(BestPpnException.class, ()-> bestPpnService.getBestPpn(kbart, provider, false, false)); Assertions.assertEquals("Kbart : publication title : Titre / publication_type : serial / online_identifier : 1292-8399 / print_identifier : 2-84358-095-1 : Les ppn électroniques 100000001, 100000002 ont le même score" , result.getLocalizedMessage()); } @@ -387,7 +387,7 @@ void getBestPpnTest06() throws IOException, BestPpnException, URISyntaxException Mockito.when(service.callDat2Ppn(Mockito.anyString(), Mockito.anyString(), Mockito.anyString())).thenReturn(resultDat2PpnWeb); // Appel de la méthode - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("300000001", result.getPpn()); @@ -429,7 +429,7 @@ void getBestPpnTest06_NoBestPpnByDat2Ppn() throws IOException, BestPpnException, Mockito.when(noticeService.getNoticeByPpn("300000002")).thenReturn(noticePrint); // Appel de la méthode - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertNull(result.getPpn()); @@ -481,7 +481,7 @@ void getBestPpnTest07() throws IOException, BestPpnException, URISyntaxException Mockito.when(noticeService.getNoticeByPpn(Mockito.anyString())).thenReturn(this.noticeElec); // Appel du service - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("100000001", result.getPpn()); @@ -532,7 +532,7 @@ void getBestPpnTest08() throws IOException, BestPpnException, URISyntaxException Mockito.when(checkUrlService.checkUrlInNotice(Mockito.anyString(), Mockito.any())).thenReturn(true); // Appel du service - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("200000001", result.getPpn()); @@ -614,7 +614,7 @@ void getBestPpnTest09() throws IOException, BestPpnException, URISyntaxException ThreadContext.put("package","truc_truc_2000-12-31.tsv"); Mockito.when(checkUrlService.checkUrlInNotice(Mockito.anyString(), Mockito.anyString())).thenReturn(true); // Appel du service - PpnWithDestinationDto result = bestPpnService.getBestPpn(kbart, provider, false); + BestPpn result = bestPpnService.getBestPpn(kbart, provider, false, false); // Vérification Assertions.assertEquals("123456789", result.getPpn()); @@ -629,7 +629,8 @@ void bestPpnWithScoreTest1() throws BestPpnException { ppnElecResultList.put("100000001", 10); Set ppnPrintResultList = new HashSet<>(); - PpnWithDestinationDto result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, false); + bestPpnService.setIsSendLogs(false); + BestPpn result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, false); Assertions.assertEquals("100000001", result.getPpn()); Assertions.assertEquals(DESTINATION_TOPIC.BEST_PPN_BACON, result.getDestination()); } @@ -643,7 +644,8 @@ void bestPpnWithScoreTest2() throws BestPpnException { ppnElecResultList.put("100000002", 10); Set ppnPrintResultList = new HashSet<>(); - PpnWithDestinationDto result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, false); + bestPpnService.setIsSendLogs(false); + BestPpn result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, false); Assertions.assertEquals("100000002", result.getPpn()); Assertions.assertEquals(DESTINATION_TOPIC.BEST_PPN_BACON, result.getDestination()); } @@ -657,7 +659,8 @@ void bestPpnWithScoreTest3() throws BestPpnException { ppnElecResultList.put("100000002", 10); Set ppnPrintResultList = new HashSet<>(); - PpnWithDestinationDto result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, true); + bestPpnService.setIsSendLogs(false); + BestPpn result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, true); Assertions.assertEquals("", result.getPpn()); } @@ -672,7 +675,8 @@ void bestPpnWithScoreTest4() throws BestPpnException { ppnPrintResultList.add("100000001"); ppnPrintResultList.add("100000002"); - PpnWithDestinationDto result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, true); + bestPpnService.setIsSendLogs(false); + BestPpn result = bestPpnService.getBestPpnByScore(kbart, ppnElecResultList, ppnPrintResultList, true); Assertions.assertEquals("", result.getPpn()); } diff --git a/src/test/java/fr/abes/bestppn/service/CheckUrlServiceTest.java b/src/test/java/fr/abes/bestppn/service/CheckUrlServiceTest.java index bb07ade..efc693c 100644 --- a/src/test/java/fr/abes/bestppn/service/CheckUrlServiceTest.java +++ b/src/test/java/fr/abes/bestppn/service/CheckUrlServiceTest.java @@ -1,8 +1,8 @@ package fr.abes.bestppn.service; -import fr.abes.bestppn.entity.basexml.notice.Datafield; -import fr.abes.bestppn.entity.basexml.notice.NoticeXml; -import fr.abes.bestppn.entity.basexml.notice.SubField; +import fr.abes.bestppn.model.entity.basexml.notice.Datafield; +import fr.abes.bestppn.model.entity.basexml.notice.NoticeXml; +import fr.abes.bestppn.model.entity.basexml.notice.SubField; import org.assertj.core.util.Lists; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/fr/abes/bestppn/utils/UtilsTest.java b/src/test/java/fr/abes/bestppn/utils/UtilsTest.java index c083b79..45e5f5e 100644 --- a/src/test/java/fr/abes/bestppn/utils/UtilsTest.java +++ b/src/test/java/fr/abes/bestppn/utils/UtilsTest.java @@ -1,6 +1,6 @@ package fr.abes.bestppn.utils; -import fr.abes.bestppn.dto.kafka.LigneKbartDto; +import fr.abes.bestppn.model.dto.kafka.LigneKbartDto; import fr.abes.bestppn.exception.IllegalDateException; import fr.abes.bestppn.exception.IllegalPackageException; import org.junit.jupiter.api.Assertions;