jhipster应用程序在微服务中的使用

jhipster应用程序在微服务中的使用,jhipster,Jhipster,首先,我对杰普斯特不熟悉。我已经创建了jhipster网关(前端)和angular应用程序(后端) 我希望这不会起作用,因为后端不存在/正在工作,所有服务调用都将通过后端访问数据库 当我尝试使用访问前端时http://localhost:8080,我能看到一切都在运转。我不知道怎么做。有人能解释一下吗 JHipster v6.10.5用于此目的 谢谢 逃避 JHISTER命令行的应用程序响应: ? Which *type* of application would you like to cre

首先,我对杰普斯特不熟悉。我已经创建了jhipster网关(前端)和angular应用程序(后端)

我希望这不会起作用,因为后端不存在/正在工作,所有服务调用都将通过后端访问数据库

当我尝试使用访问前端时http://localhost:8080,我能看到一切都在运转。我不知道怎么做。有人能解释一下吗

JHipster v6.10.5用于此目的

谢谢 逃避

JHISTER命令行的应用程序响应:

? Which *type* of application would you like to create? Microservice gateway 
? [Beta] Do you want to make it reactive with Spring WebFlux? No 
? What is the base name of your application? gateway 
? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8080 
? What is your default Java package name? com.btn.test 
? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards) 
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token) 
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL) 
? Which *production* database would you like to use? MySQL ? Which *development* database would you like to use? MySQL 
? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes, supports rate-limiting for gateway applications) 
? Do you want to use Hibernate 2nd level cache? Yes 
? Would you like to use Maven or Gradle for building the backend? Maven 
? Which other technologies would you like to use? 
? Which *Framework* would you like to use for the client? Angular 
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster 
? Would you like to enable internationalization support? No 
? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling, Cucumber, Protractor 
? Would you like to install other generators from the JHipster Marketplace? (y/N) No

emp.jdl 现在我已经使用了访问网关http://localhost:8080 并尝试访问员工实体。我能在表格中看到(假)数据


所以,即使后端应用程序不存在,应用程序也可以正常工作。怎样?我遗漏了什么吗?

网关包含整个UI。当您定义实体时,微服务开始发挥作用。这些不由网关管理(但UI是)。此概述图片非常好地描述了体系结构:


感谢您的快速响应。我使用以下输入创建了网关应用程序,并使用jdl(emp.jdl)添加了新实体。现在我已使用访问网关并尝试访问员工实体。我能在表格中看到(假)数据。所以,即使后端应用程序不存在,应用程序也可以正常工作。怎样?我遗漏了什么吗?您可以访问示例代码@。我使用的是mysql数据库,root是用户,密码是。你能发布你的jdl吗?可以定义图元的创建位置。网关上可能有实体。查看您的代码,员工实体是网关的一部分。请看这里的例子。您看到的数据是在dev概要文件中运行时通过liquibase迁移创建的。我使用jhipster命令生成了网关,然后使用上面的jdl添加了emp实体。您能告诉我如何定义创建位置吗。我想要应用程序(后端)代码中的所有实体。您定义了三个应用程序(1个网关,2个微服务)。每个应用程序都包含它们负责的实体。您可以在一个空目录中执行jhipster jdl,它将为您创建三个文件夹(gateway、blog microservice和store microservice)。
/**
 * The Employee entity.
 * @author Shirish Bathe
 */
entity Employee {
    name String required unique
    dept String
}