I have to services and two entities
entity AEnt {}
microservice AEnt with A
entity BEnt {}
microservice BEnt with B
And I want to realize the relation like
relationship OneToOne {
A{b} to B
}
but programmatically.
So I need JPA + DTO for BEnt in microservice B and only service-layer DTO and service class or service interface with implementation based on feign client (or rest template) in service A.
Is there are the best way to do this? Do I need:
- Copy BEntDto and Service Interface from B app to A app and implement interface manually?
- Extract dto POJO and interface into the third library, something like microservices-core?
- Maybe run service B, download OpenAPI spec, generate spring-client from it?
To clarify my problem:
Service A - Book info service
Service B - for images, ie store book cover
I need to create full info json-response for some book, ie size, color and url in s3 storage from a book. But my API and data-model not stable now, I often change data and do not want to do it manually, but completely automated (jhipster jdl and etc.)
Aucun commentaire:
Enregistrer un commentaire