美文网首页
springboot 整合 feign

springboot 整合 feign

作者: 急中生智的言灵之书 | 来源:发表于2020-10-23 14:28 被阅读0次

启动文件

@EnableFeignClients(basePackages = {"com.sie.saaf.activity.seckill.model.inter" })

调用接口

package com.sie.saaf.activity.seckill.model.inter;

import org.springframework.cloud.netflix.feign.FeignClient;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name ="1006-SAAF-BASE-SERVER")

public interface IFeign{

@RequestMapping(value ="/baseLoginService/login", method = RequestMethod.POST)

StringbaseLoginServiceLogin(@RequestParam("params") String params);

}

yml文件
feign:

    httpclient:

        enabled: true

pom.xml

<dependency>

            <groupId>org.springframework.cloud</groupId>

            <artifactId>spring-cloud-starter-openfeign</artifactId>

            <version>2.1.3.RELEASE</version>

</dependency>

相关文章

网友评论

      本文标题:springboot 整合 feign

      本文链接:https://www.haomeiwen.com/subject/tygxcxtx.html