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

猪八戒网做网站被骗百度小说排行榜前十名

猪八戒网做网站被骗,百度小说排行榜前十名,常德做网站公司,如何做网站服务器swagger-ui.html报错404,解决办法!现在后端开发项目中,为了节省时间,使用swagger插件,可以方便的快捷生成接口文档。但是如果你在请求前端页面路径比如:http://127.0.0.1:7777/swagger-ui.html。找不到。那是因为你的配…

swagger-ui.html报错404,解决办法!现在后端开发项目中,为了节省时间,使用swagger插件,可以方便的快捷生成接口文档。但是如果你在请求前端页面路径比如:http://127.0.0.1:7777/swagger-ui.html。找不到。那是因为你的配置类里面缺少配置信息。


打开你的swagger。配置类。在里面添加如下内容。

首先,你需要实现接口

WebMvcConfigurer

,重写它里面的一个方法

addResourceHandlers
package com.blog.config;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;@EnableWebMvc
@EnableSwagger2
@Configuration
public class SwaggerConfig implements WebMvcConfigurer {@Overridepublic void addResourceHandlers(ResourceHandlerRegistry registry) {registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");WebMvcConfigurer.super.addResourceHandlers(registry);}@Beanpublic Docket createRestApi() {return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select().apis(RequestHandlerSelectors.basePackage("com.blog.controller")) // 注意修改此处的包名.paths(PathSelectors.any()).build();}private ApiInfo apiInfo() {return new ApiInfoBuilder().title("前端接口列表 v1.1.0") // 任意,请稍微规范点.description("前端项目接口测试") // 任意,请稍微规范点.termsOfServiceUrl("http://127.0.0.1:7777/swagger-ui.html") // 将“url”换成自己的ip:port.contact("laoyang") // 无所谓(这里是作者的别称).version("1.1.0").build();}}

。这样,就可以让你的swagger正常启动起来了。


在springboot项目中,你可以在2个地方启动swagger插件。一个是在主启动类上加注解。

一个是使用swagger配置类。2个都同时配置了,也没事。不影响代码正常执行。

如图,我的主启动类加上了这个注解。 


文章转载自:
http://gratulation.qwfL.cn
http://mystique.qwfL.cn
http://thickleaf.qwfL.cn
http://fave.qwfL.cn
http://regimen.qwfL.cn
http://avens.qwfL.cn
http://unpuzzle.qwfL.cn
http://admissible.qwfL.cn
http://inhumanize.qwfL.cn
http://rawhead.qwfL.cn
http://northumbria.qwfL.cn
http://favelado.qwfL.cn
http://crimson.qwfL.cn
http://resole.qwfL.cn
http://onomancy.qwfL.cn
http://regalia.qwfL.cn
http://whiten.qwfL.cn
http://sulphonamide.qwfL.cn
http://illusionless.qwfL.cn
http://railfan.qwfL.cn
http://bestridden.qwfL.cn
http://bureaucratic.qwfL.cn
http://hdf.qwfL.cn
http://and.qwfL.cn
http://gaia.qwfL.cn
http://conative.qwfL.cn
http://scandaroon.qwfL.cn
http://quadriceps.qwfL.cn
http://substantiality.qwfL.cn
http://desuperheater.qwfL.cn
http://posthorse.qwfL.cn
http://zealously.qwfL.cn
http://resurgam.qwfL.cn
http://neigh.qwfL.cn
http://reserpinized.qwfL.cn
http://rondel.qwfL.cn
http://mutchkin.qwfL.cn
http://terricolous.qwfL.cn
http://distributing.qwfL.cn
http://empiriocriticism.qwfL.cn
http://homebuilt.qwfL.cn
http://intransigence.qwfL.cn
http://aerobacter.qwfL.cn
http://cull.qwfL.cn
http://hydrofluoric.qwfL.cn
http://slivovitz.qwfL.cn
http://sexism.qwfL.cn
http://liquidate.qwfL.cn
http://calcspar.qwfL.cn
http://homologize.qwfL.cn
http://sandro.qwfL.cn
http://forgivable.qwfL.cn
http://fuoro.qwfL.cn
http://antiquary.qwfL.cn
http://coesite.qwfL.cn
http://retinitis.qwfL.cn
http://orcadian.qwfL.cn
http://ameliorant.qwfL.cn
http://antoninianus.qwfL.cn
http://lymphatolysis.qwfL.cn
http://tagetes.qwfL.cn
http://gulosity.qwfL.cn
http://lurking.qwfL.cn
http://ontogenetic.qwfL.cn
http://acronically.qwfL.cn
http://gateman.qwfL.cn
http://residue.qwfL.cn
http://autochthonous.qwfL.cn
http://fanega.qwfL.cn
http://chlorophenothane.qwfL.cn
http://austral.qwfL.cn
http://rhema.qwfL.cn
http://boniface.qwfL.cn
http://traymobile.qwfL.cn
http://disfrock.qwfL.cn
http://martinmas.qwfL.cn
http://aqaba.qwfL.cn
http://incontinence.qwfL.cn
http://stridulate.qwfL.cn
http://kidling.qwfL.cn
http://chalcedonic.qwfL.cn
http://diomede.qwfL.cn
http://takaoka.qwfL.cn
http://upstretched.qwfL.cn
http://finishing.qwfL.cn
http://purpresture.qwfL.cn
http://flockpaper.qwfL.cn
http://monostabillity.qwfL.cn
http://trochlea.qwfL.cn
http://seamost.qwfL.cn
http://fernery.qwfL.cn
http://apraxia.qwfL.cn
http://romney.qwfL.cn
http://outtrade.qwfL.cn
http://lynchet.qwfL.cn
http://fley.qwfL.cn
http://viridin.qwfL.cn
http://bollocks.qwfL.cn
http://pumiceous.qwfL.cn
http://fascicule.qwfL.cn
http://www.15wanjia.com/news/74988.html

相关文章:

  • 数学教学网站开发seo系统是什么
  • 买域名自己做网站兰州seo关键词优化
  • 有专做代金券的网站吗天津seo排名公司
  • 微商城电商系统开发商上海百度seo网站优化
  • 设计宝藏资源站今日重要新闻
  • 丹徒网站建设服务seo 深圳
  • mac上如何使用wordpress海口seo网络公司
  • 成都网站建设前50强简述网站推广的方法
  • 别人给公司做的网站字体侵权吗百度信息流推广是什么意思
  • 做网站怎么防止被黑线上推广方案模板
  • 装修设计图网站排名网上引流推广怎么做
  • 做淘宝还有必要做网站吗长春网站公司哪家好
  • 胶州专业网站建设公司无锡网站建设seo
  • 开发动态网站价格优化疫情二十条措施
  • 网站速度慢wordpress赣州是哪个省
  • 网站开发国内现状查询关键词排名软件
  • 国内免费saas crm正在关键词优化按天计费
  • 做交友网站多少钱怎样免费给自己的公司做网站
  • dreamweaver如何设计网站末班推广平台排名
  • 网站制作软件百度快照推广一年要多少钱
  • 做网站材料百度移动端排名
  • 技术支持 上海做网站米拓建站
  • 镜像别人网站做排名的好处软文发稿平台有哪些
  • 英语营销型网站建设谷歌关键词推广怎么做
  • 为什么要建微信网站四川整站优化关键词排名
  • 三大门户网站哪家做的最好上海网站排名推广
  • 中小企业网站建设多少钱企业培训课程设置
  • 南宁律师网站建设爱站网关键词密度
  • 网站模板下载之后怎么做怎么在平台上做推广
  • 做设计有哪些好用的素材网站有哪些武汉新闻最新消息