资源简介

  1. 开发工具:idea;
  2. springboot版本:2.1.13
  3. springcloud版本:Finchley.SR1(注意,此处使用的是springboot2.0.x以上的版本,而springcloud对应的版本为Finchley,且springboot2.0相比于springboot1.5.x来说,maven依赖变化较大,这个问题在搭建分布式项目时我会做出说明)
  4. 中间件:eureka、fegin(其他中间件比如hystrix、ribbon等后续再添加)

运行后会出现如下服务信息即为成功:

访问服务:http://localhost:7001/consumer/getConsumer;如下图所示,已经能够使用fegin调用服务的接口了;



资源截图

代码片段和文件信息

package com.example.desingpattern;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DesingPatternApplication {

    public static void main(String[] args) {
        SpringApplication.run(DesingPatternApplication.class args);
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-12-18 11:07  springbootdemo-master\
     文件         208  2019-12-18 11:07  springbootdemo-master\README.md
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\
     文件        1393  2019-12-18 11:07  springbootdemo-master\desing-pattern\pom.xml
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\java\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\java\com\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\java\com\example\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\java\com\example\desingpattern\
     文件         344  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\java\com\example\desingpattern\DesingPatternApplication.java
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\resources\
     文件           1  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\main\resources\application.properties
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\test\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\test\java\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\test\java\com\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\test\java\com\example\
     目录           0  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\test\java\com\example\desingpattern\
     文件         358  2019-12-18 11:07  springbootdemo-master\desing-pattern\src\test\java\com\example\desingpattern\DesingPatternApplicationTests.java
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\
     文件        1393  2019-12-18 11:07  springbootdemo-master\elastic-search\pom.xml
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\java\
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\java\com\
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\java\com\example\
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\java\com\example\elasticsearch\
     文件         344  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\java\com\example\elasticsearch\ElasticSearchApplication.java
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\resources\
     文件           1  2019-12-18 11:07  springbootdemo-master\elastic-search\src\main\resources\application.properties
     目录           0  2019-12-18 11:07  springbootdemo-master\elastic-search\src\test\
............此处省略342个文件信息

评论

共有 条评论