通用案例Consumer消费者(Client)通过REST调用Provider提供者(Server)提供的服务, 观看b站秦疆老师Java系列课程之SpringCloud系列
视频记录。
- 创建一个Maven项目,引入对应的jar包和选择对应的版本
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>springcloud</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>springcloud-provider-dept-8001</module>
<module>springcloud-consumer-dept-80</module>
<module>springcloud-api</module>
</modules>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
<fastjson.version>1.2.47</fastjson.version>
<commons.lang.version>2.6</commons.lang.version>
<jwt.version>0.7.0</jwt.version>
<spring-boot-admin.version>2.1.4</spring-boot-admin.version>
<spring-boot-admin-server-ui.version>2.1.4</spring-boot-admin-server-ui.version>
<swagger-butler-core-version>2.0.0</swagger-butler-core-version>
<log4j.version>1.2.17</log4j.version>
<guava.version>27.0.1-jre