简体   繁体   English

如何架构 Spring 启动微服务

[英]how to architecture Spring Boot Microservice

I have an architectural question about an application I want to build.我有一个关于我要构建的应用程序的架构问题。 The Application will have Angular as frontend and Backend Spring Boot generated with jhipster.该应用程序将 Angular 作为前端和后端 Spring 引导使用 jhipster 生成。

I will have a microservice called manufacturer where I have the following entities: seller material products.我将有一个称为制造商的微服务,其中我有以下实体:卖方材料产品。 material has an many to many relationship with seller and the owner is material.材料与卖方具有多对多的关系,并且所有者是材料。 and product with material many to many and is the owner.和产品的材料多对多,是所有者。

my question is One material can have multiple sellers thus multiple prices.我的问题是一种材料可以有多个卖家,因此有多个价格。 Does it make more sense to put the price field inside material or inside seller?将价格字段放在材料内还是卖家内更有意义? I am not an DB expert but my guts tells me to put it inside material because it makes more logical sense from everyday use.我不是数据库专家,但我的直觉告诉我把它放在材料中,因为它在日常使用中更合乎逻辑。 Could someone maybe give me an advice is that ok if I put it inside material or does it make more sense to put it inside seller entity?有人可以给我一个建议,如果我把它放在材料中,还是把它放在卖家实体中更有意义?

Think practically being a seller.想想实际上是一个卖家。 Multiple seller buy dough but have a varying a pizza prices.多个卖家购买面团,但披萨价格不同。 You might have seen online shopping websites have different prices for different sellers.您可能已经看到在线购物网站对不同的卖家有不同的价格。

I don't know what you mean by material & product , but if I get it right, by material you mean raw-material for making product.我不知道您所说的materialproduct是什么意思,但如果我理解正确的话,您所说的material是指制造产品的原材料。

A seller would be linked with material in a one-to-many and with product in a many-to-many relationship. seller将以many-to-many关系与material相关联,并以one-to-many的关系与product相关联。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM