V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  qinxi  ›  全部回复第 21 页 / 共 91 页
回复总数  1813
1 ... 17  18  19  20  21  22  23  24  25  26 ... 91  
2021-04-28 17:20:49 +08:00
回复了 FenixVu 创建的主题 问与答 Jenkins 远程目标机器执行 git clone 的问题
难道不应该在 A 机器 clone,build,
之后把 结果推送到 B 吗?
2021-04-26 11:54:15 +08:00
回复了 JasonLaw 创建的主题 程序员 Springfox 如何设置一个全局的 HTTP request header?
@JasonLaw #3 不知道普通的 header 可以不可以, 不过 auth 类 header 是可以的. 你可以用我说的第一种的 ,设置一次就可以了
2021-04-26 11:44:22 +08:00
回复了 JasonLaw 创建的主题 程序员 Springfox 如何设置一个全局的 HTTP request header?
@qinxi #1 这个就是全局的 header .如果你要默认值就把 defaultValue 加上就可以了
2021-04-26 11:42:47 +08:00
回复了 JasonLaw 创建的主题 程序员 Springfox 如何设置一个全局的 HTTP request header?
如果是 auth 类 header 会有个小锁
new Docket(DocumentationType.SWAGGER_2)
.useDefaultResponseMessages(false)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.xx"))
.paths(PathSelectors.any())
.build().securitySchemes(securitySchemes())
//.globalOperationParameters(globalOperationParameters())
.securityContexts(securityContexts());

private List<ApiKey> securitySchemes() {
ArrayList<ApiKey> list = new ArrayList<>();
list.add(new ApiKey("Authorization", "Authorization", "header"));
return list;
}

private List<SecurityContext> securityContexts() {
return Collections.singletonList(
SecurityContext.builder()
.securityReferences(defaultAuth())
.forPaths(PathSelectors.any())
.build()
);
}

private List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return Collections.singletonList(
new SecurityReference("Authorization", authorizationScopes));
}


//如果是普通的 header
new Docket(DocumentationType.SWAGGER_2)
.useDefaultResponseMessages(false)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.xx"))
.paths(PathSelectors.any())
.build()
//.securitySchemes(securitySchemes())
.globalOperationParameters(globalOperationParameters())
;


private List<Parameter> globalOperationParameters() {
ArrayList<Parameter> list = new ArrayList<>();
Parameter parameter = new ParameterBuilder().name("key").required(true)
.description("").parameterType("header").defaultValue("")
.allowMultiple(false)
.modelRef(new ModelRef("string")).build();
list.add(parameter);

return list;
}
@felixcode #2 我的传呼机现在就是 5G,敏感肌可以用,孩子已经吃了一车了
2021-04-25 18:19:33 +08:00
回复了 xxmmoo 创建的主题 汽车 曾经的家电巨头创维要开始造车了...
@dynastysea #15 弯道超车的结果是中途需要频繁停下来充电
2021-04-21 14:27:54 +08:00
回复了 elfive 创建的主题 Overwatch 姐夫离开了玻璃渣, Overwatch 2 成了未知数了
@Goat121 #16 现在只玩自定义.以前玩 Boss,现在玩勾勾乐😆
2021-04-20 09:41:13 +08:00
回复了 christin 创建的主题 上海 有老哥知道上海哪里有租相机的吗
内啥 APP ? 没租过,不过看过他不少视频
2021-04-14 09:25:49 +08:00
回复了 zh0n9 创建的主题 随想 坐标深圳,一次发烧,花费 520
月初发烧. 医院总花费 350 ,抽血,CT,核酸一样不少,还给了药. 坐标北京.
觉得丑的人原本就不会买.买的人又不 care 这个 logo https://i.v2ex.co/ni1vw0o2.png https://i.v2ex.co/ni1vw0o2.png
2021-03-29 12:28:18 +08:00
回复了 leogoforit 创建的主题 程序员 为什么云服务器代理那里的价格比官方低很多?
@KanVivii #17 没有..这个是我们公司账号买才行...我自己买都没法走公司的.
之前看到的据说高端的已经可以通过身高体型姿态了.
2021-03-17 18:10:54 +08:00
回复了 telnetning 创建的主题 Java Spring 启动阶段接口 500
@chenqh #12 解释型语言都快. 没运行到的 py 代码甚至不知道能不能跑 https://i.v2ex.co/504J5BO2.png
@qinxi #3 如果是本身弱密码 /无密码. 那跟项目没关系.
1 ... 17  18  19  20  21  22  23  24  25  26 ... 91  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4766 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 57ms · UTC 09:51 · PVG 17:51 · LAX 02:51 · JFK 05:51
Developed with CodeLauncher
♥ Do have faith in what you're doing.