zoukankan      html  css  js  c++  java
  • SpringCloud Feign Client 端配置

    1. 启动类

    @SpringBootApplication
    @EnableAlive
    @EnableFeignClients(basePackages = "com.lingoace.pub.operations.clients")
    public class Application {
        public static void main(final String[] args) {
            SpringApplication.run(Application.class, args);
        }
    
    }
    

    2. application.yml

    spring:
      main:
        allow-bean-definition-overriding: true
      profiles:
          active: dev #默认为开发环境
      application:
          name: pub-dataquery
      jackson:
        date-format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
    
    client:
      pub-operations-host: localhost:8402
    
    server:
      port: 8404
      servlet:
        session:
          timeout:
            600 #会话超时时间秒
    
    mybatis:
      mapper-locations:
        - classpath*:mapper/*.xml
    

    3. ApiController

    @RestController
    public class ApiController {
        @Autowired
        private FinanceClient financeClient;
    
        @RequestMapping("/hello")
        public String hello() {
            financeClient.getFinanceRechargeCountByParentIds();
            return "Hello World!";
        }
    }
    

      

      

      

  • 相关阅读:
    23.2 编写笨的程序
    python面向对象
    面向对象封装
    python新式类删改查
    os模块sys模块 进度条实例
    选课系统练习程序
    python类相关
    xml模块
    json&pickle模块shelve模块
    Python写的ATM程序
  • 原文地址:https://www.cnblogs.com/shijianchuzhenzhi/p/15346747.html
Copyright © 2011-2022 走看看