open-feign设置全局header
发表于|更新于
|浏览量:
求学犹植树,春天开花朵,秋天结果实。——爱因斯坦
代码如下:
1 | import feign.RequestInterceptor; |
即可实现feign全局添加请求头
相关推荐
2021-01-21
父类坑
我要让全世界都记住我的温柔。——曼德拉 今天在项目中遇到一个小坑可把我吓坏了,记录一下,以免再犯 首先还原下场景吧,我们写个类 123456789101112131415161718192021222324252627package com.ruben.pojo;import lombok.Data;/** * @ClassName: BaseEntity * @Description: 我还没有写描述 * @Date: 2021/1/21 0021 21:01 * * * @author: <achao1441470436@gmail.com> * @version: 1.0 * @since: JDK 1.8 */@Datapublic class BaseEntity { protected Integer id; public BaseEntity() { } public BaseEntity(Integer id) { this(); this.id = id;...
2021-06-29
通过Function获取属性对应字段
只有绝望的赌鬼才肯把全部所有作孤注的一掷。一个商人如果把他的全部财产装在一只船上,人家就管他叫冒失鬼——席勒 我写了个函数 123456789101112131415161718/** * 获取表内字段 * * @param function 字段 * @return java.lang.String * @author <achao1441470436@gmail.com> * @since 2021/6/29 16:51 */public static <R, T> String getColumn(SFunction<T, R> function) { SerializedLambda lambda = LambdaUtils.resolve(function); TableInfo tableInfo = TableInfoHelper.getTableInfo(lambda.getImplClass()); return tableInfo.getFieldList() .para...
2023-09-17
QLExpress
方向是比速度更重要的追求。——白岩松 QLExpress是一种强大,轻量级,动态的Java平台语言,旨在提高开发人员在不同业务场景中的生产力。 https://github.com/alibaba/QLExpress 安装 12345<dependency> <groupId>com.alibaba</groupId> <artifactId>QLExpress</artifactId> <version>3.3.2</version></dependency> 代码: 12345678ExpressRunner runner = new ExpressRunner();DefaultContext<String, Object> context = new DefaultContext<String, Object>();context.put("a", 1);context.put("b", 2);cont...
2022-06-24
opencc4j
“不用给我爱,不用给我钱,不用给我声誉,给我真理吧。我们应该有勇气去面对真实的内心,即使前面荆棘满地,也要坚定地走下去。为了不浪费你的这一辈子。”——梭罗《瓦尔登湖》 分享一个java简繁转换的库opencc4j https://github.com/houbb/opencc4j Group ArtifactId Version 12345<dependency> <groupId>com.github.houbb</groupId> <artifactId>opencc4j</artifactId> <version>1.7.2</version></dependency> 使用起来: 繁简体转换转为简体123String original = "生命不息,奮鬥不止";String result = ZhConverterUtil.toSimple(original);Assert.assertEquals("生命不息,奋斗不止...
2022-09-28
springboot动态配置
耐心和持久胜过激烈和狂热——拉封丹 分享一个springboot动态配置框架:https://github.com/Code2Life/spring-boot-dynamic-config 在一些场景下可以用到热更新配置 轻量方便,简单好用 GAV 12345<dependency> <groupId>top.code2life</groupId> <artifactId>spring-boot-dynamic-config</artifactId> <version>1.0.9</version></dependency> 添加注解:@DynamicConfig 以及@Value 1234567891011121314151617181920212223242526272829303132333435import lombok.Data;import org.springframework.beans.factory.annotation.Value;impor...
2020-07-14
Gitlab的安装
Gitlab安装1.安装相关依赖 1yum -y install policycoreutils openssh-server openssh-clients postfix 2.启动ssh服务&设置为开机启动 1systemctl enable sshd && sudo systemctl start sshd 3.设置postfix开机自启,并启动,postfix支持gitlab发信功能 1systemctl enable postfix && sudo systemctl start postfix 如果报这个错 1Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details. 可以采取以下解决方案 1234#修改 /etc/postfix/m...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog