当前位置: 首页 > news >正文

滑县住房城乡建设厅门户网站邯郸专业做网站多少钱

滑县住房城乡建设厅门户网站,邯郸专业做网站多少钱,开源手机网站cms,企业网站建设公司司需求#xff1a; 生产环境下#xff0c;需要关闭swagger配置#xff0c;避免接口暴露。 方法#xff1a; 1、使用注解Value() 2、使用注解Profile({“dev”,“test”}) 表示在开发或测试环境开启#xff0c;而在生产关闭。 3、使用注解ConditionalOnProperty(name “s…需求 生产环境下需要关闭swagger配置避免接口暴露。 方法 1、使用注解Value() 2、使用注解Profile({“dev”,“test”}) 表示在开发或测试环境开启而在生产关闭。 3、使用注解ConditionalOnProperty(name “swagger.enable”, havingValue “true”) 然后在测试配置或者开发配置中 添加 swagger.enable true 即可开启生产环境不填则默认关闭Swagger。 方法一使用注解Value() 在Swagger2Config类里添加 并需要在配置文件里添加一个swagger.enable属性根据不同的application-xx.yml进行动态插入true或false即可。 Configuration EnableSwagger2 public class Swagger2Config {Value(${swagger.enable})private Boolean enable;Beanpublic Docket swaggerPersonApi10() {return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage(com.unidata.cloud.logservice.api.controller)).paths(PathSelectors.any()).enable(enable) //配置在该处生效.build().apiInfo(apiInfo());}private ApiInfo apiInfo() {return new ApiInfoBuilder().version(1.0).title(xx项目xx平台 Swagger2 文档 API).contact(new Contact( xx团队, https://www.xx.com/, kangjiaxx.com)).description(logservice platform API v1.0).build();} }方法二使用注解Profile({“dev”,“test”}) 表示在开发或测试环境开启而在生产关闭。 Configuration EnableSwagger2 Profile({local, dev}) public class Swagger2Config {Beanpublic Docket swaggerPersonApi10() {return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage(com.unidata.cloud.logservice.api.controller)).paths(PathSelectors.any()).build().apiInfo(apiInfo());}private ApiInfo apiInfo() {return new ApiInfoBuilder().version(1.0).title(xx项目xx平台 Swagger2 文档 API).contact(new Contact( xx团队, https://www.xx.com/, kangjiaxx.com)).description(logservice platform API v1.0).build();} }方法三使用注解ConditionalOnProperty(name “swagger.enable”, havingValue “true”) 然后在测试配置或者开发配置中 添加 swagger.enable true 即可开启生产环境不填则默认关闭Swagger。 1、使用注解 ConditionalOnProperty(name “swagger.enable”, havingValue “true”) Configuration EnableSwagger2 //ConditionalOnProperty(name enabled ,prefix swagger,havingValue true,matchIfMissing true //matchIfMissingtrue :为空则设为true,不合理 ConditionalOnProperty(name “swagger.enable”, havingValue “true”) public class Swagger2Config {Beanpublic Docket swaggerPersonApi10() {return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage(com.unidata.cloud.logservice.api.controller)).paths(PathSelectors.any()).enable(enable).build().apiInfo(apiInfo());}private ApiInfo apiInfo() {return new ApiInfoBuilder().version(1.0).title(xx项目xx平台 Swagger2 文档 API).contact(new Contact( xx团队, https://www.xxx.com/, kangjiaxxx.com)).description(logservice platform API v1.0).build();} }2、然后在测试配置或者开发配置中 添加 swagger.enable true 即可开启生产环境不写该配置则默认关闭Swagger。 #Swagger lock swagger: enabled: true参考链接https://www.dandelioncloud.cn/article/details/1593427183718813697
http://www.hkea.cn/news/14283191/

相关文章:

  • 如何建设公司网站设计公司logo用什么软件
  • 网站免费正能量软件直播网站运营推广公司
  • 网站正常打开速度宁波网络推广方法
  • 科技网站域名wordpress 顶 踩
  • 做黄金的经常看什么网站中国电子商务官网首页
  • 深圳网站建设 网站制作 网站设计【迅美】旧版小视频制作
  • 网站建设 账务处理宾馆网站制作
  • 网站运行速度优化市场调研分析
  • 简单的网站源码怎么查网站做站点地图
  • 嘉兴哪里可以做淘宝网站wordpress网页美化教程
  • 住房与城乡建设局网站如何提高网站的收录
  • 用什么技术做网站为什么网站关键词没有排名
  • 雄安智能网站建设电话网站架构包含哪几部分
  • 静态网站建设平台百度网盘云资源搜索引擎
  • 怀远县建设局门户网站设计一个企业官网的栏目
  • 网站建设需要硬件设备无锡网站建设的公司
  • 彩票网站建设基本流程类似快手网站开发
  • 东莞网站设计哪家好番禺seo培训
  • 公司网站建设成都网站电子商务类型
  • 域名服务网站商业空间设计风格
  • 做购物车的网站越秀高端网站建设
  • 网站开发社区铁岭网站制作
  • 东莞网站建设 钢结构发布网站免费空间
  • 珠海市建设工程质量监督检测站网站酷站百分百
  • 婚庆网站建设网站格局
  • 网站文章更新注意什么意思做seo网站标题用什么符号
  • 制作收款网站成都网站建设龙兵网络
  • 移动手机网站开发湖南人文科技学院全国排名
  • 泗洪有做网站黄页 推广
  • 做网站带来的好处建网站 找个人