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

公司建设网站的申请招工 最新招聘信息怎么写

公司建设网站的申请,招工 最新招聘信息怎么写,asp.net 网站 方案,视频网站如何做推广1 Knife4j介绍 knife4j是为Java MVC框架集成Swagger生成Api文档的增强解决方案#xff0c;前身是swagger-bootstrap-ui#xff0c;取名knife4j是希望它能像一把匕首一样小巧#xff0c;轻量#xff0c;并且功能强悍#xff01; 其底层是对Springfox的封装#xff0c;使…1 Knife4j介绍 knife4j是为Java MVC框架集成Swagger生成Api文档的增强解决方案前身是swagger-bootstrap-ui取名knife4j是希望它能像一把匕首一样小巧轻量并且功能强悍 其底层是对Springfox的封装使用方式也和Springfox一致只是对接口文档UI进行了优化。其核心功能包括文档说明和在线调试。 2 Knife4j案例 1创建maven工程并配置其pom.xml文件如下 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.2.2.RELEASE/versionrelativePath//parentgroupIdcom.hsgx/groupIdartifactIdknife4j-demo/artifactIdversion1.0-SNAPSHOT/versionpropertiesmaven.compiler.source8/maven.compiler.sourcemaven.compiler.target8/maven.compiler.targetproject.build.sourceEncodingUTF-8/project.build.sourceEncoding/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactId/dependency!--knife4j--dependencygroupIdcom.github.xiaoymin/groupIdartifactIdknife4j-spring-boot-starter/artifactIdversion2.0.1/version/dependency/dependencies /project2创建实体类User和控制器UserController类跟Springfox的写法是一样的 package com.hsgx.pojo;import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data;Data ApiModel(description 用户实体) public class User {ApiModelProperty(value 主键)private Integer id;ApiModelProperty(value 姓名)private String name;ApiModelProperty(value 年龄)private Integer age;ApiModelProperty(value 地址)private String address; }package com.hsgx.controller;import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;RestController RequestMapping(/user) Api(tags 用户控制器) public class UserController {ApiImplicitParams({ApiImplicitParam(name pageNum, value 页码,required true, type Integer),ApiImplicitParam(name pageSize, value 每页条数,required true, type Integer),})ApiOperation(value 分页查询用户信息)GetMapping(value page/{pageNum}/{pageSize})public String findByPage(PathVariable Integer pageNum,PathVariable Integer pageSize) {return OK;} }3创建配置属性类SwaggerProperties映射配置文件的配置信息 package com.hsgx.config;import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties;import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map;Data ConfigurationProperties(prefix swagger) public class SwaggerProperties {private MapString, DocketInfo docket new LinkedHashMap(); //分组文档Datapublic static class DocketInfo {private String title ; //标题private String group ; //组名private String description ; //描述private String version ; //版本private String name ; // 联系人private String url ; // 联系人urlprivate String email ; // 联系人emailprivate String basePackage ; //swagger会解析的包路径private ListString basePath new ArrayList(); //swagger会解析的url规则private ListString excludePath new ArrayList(); //在basePath基础上需要排除的url// 如果没有填写组名则直接用标题作为组名public String getGroup() {if (group null || group.isEmpty()) {return title;}return group;}} }4创建自动配置类SwaggerAutoConfiguration package com.hsgx.config;import com.google.common.base.Predicate; import com.google.common.base.Predicates; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2;import java.util.ArrayList; import java.util.LinkedList; import java.util.List;Configuration ConditionalOnProperty(name swagger.enabled, havingValue true, matchIfMissing true) EnableSwagger2 EnableConfigurationProperties(SwaggerProperties.class) public class SwaggerAutoConfiguration implements BeanFactoryAware {Autowiredprivate SwaggerProperties swaggerProperties;Autowiredprivate BeanFactory beanFactory;BeanConditionalOnMissingBeanpublic ListDocket createRestApi(){ConfigurableBeanFactory configurableBeanFactory (ConfigurableBeanFactory) beanFactory;ListDocket docketList new LinkedList();// 分组创建for (String groupName : swaggerProperties.getDocket().keySet()){SwaggerProperties.DocketInfo docketInfo swaggerProperties.getDocket().get(groupName);ApiInfo apiInfo new ApiInfoBuilder()// 页面标题.title(docketInfo.getTitle())// 创建人.contact(new Contact(docketInfo.getName(),docketInfo.getUrl(),docketInfo.getEmail()))// 版本号.version(docketInfo.getVersion())// 描述.description(docketInfo.getDescription()).build();// base-path处理当没有配置任何path的时候解析/**if (docketInfo.getBasePath().isEmpty()) {docketInfo.getBasePath().add(/**);}ListPredicateString basePath new ArrayList();for (String path : docketInfo.getBasePath()) {basePath.add(PathSelectors.ant(path));}// exclude-path处理ListPredicateString excludePath new ArrayList();for (String path : docketInfo.getExcludePath()) {excludePath.add(PathSelectors.ant(path));}Docket docket new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).groupName(docketInfo.getGroup()).select()// 为当前包路径.apis(RequestHandlerSelectors.basePackage(docketInfo.getBasePackage())).paths(Predicates.and(Predicates.not(Predicates.or(excludePath)),Predicates.or(basePath))).build();configurableBeanFactory.registerSingleton(groupName, docket);docketList.add(docket);}return docketList;}Overridepublic void setBeanFactory(BeanFactory beanFactory) throws BeansException {this.beanFactory beanFactory;} }5创建配置文件application.yml server:port: 8082 swagger:enabled: true #是否启用swaggerdocket:user:title: 用户模块group: userdescription: 用户模块version: 1.0name: hsgxurl:email:base-package: com.hsgx.controllerorder:title: 订单模块group:description: 订单模块version: 1.0name: hsgxurl:email:base-package: com.hsgx.controller6创建启动类Knife4jDemoApp package com.hsgx;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;SpringBootApplication public class Knife4jDemoApp {public static void main(String[] args) {SpringApplication.run(Knife4jDemoApp.class, args);} }6启动服务访问地址http://localhost:8082/doc.html 由结果可知Knif34j生成的文档包含两个组和我们在配置文件中配置的一样。 … 本节完更多内容查阅后台管理系统的通用权限解决方案 延伸阅读后台管理系统的通用权限解决方案(二)SpringBoot整合Swagger Springfox实现接口日志文档
http://www.hkea.cn/news/14376408/

相关文章:

  • 网站开发公司基本业务流程图网站建设教程网站
  • 网站服务器租用售价上海最近热点事件
  • 部队织梦网站模板免费下载wordpress产品展示主题下载
  • 免费设计图网站设计微信网站建设
  • 辽宁省住房与城乡建设厅网站郑州建设网站企业定制
  • 中小学生在线做试卷的网站6企业邮箱注册哪家好
  • 网站流量提升方案wordpress免费字体
  • 保定网站建设公司哪家好wordpress视频教程百度云
  • 招聘网站入职分析表怎么做wordpress手机底部联系插件
  • 门户网站建设需求模板wordpress启用主题404
  • 苏州建设网站电话杭州建站平台
  • 网站建站建设费用大连软件公司排行
  • 南通做网站公司哪家好推广网站设计推广方案
  • 怎样用word2003做网站wordpress 上一篇下一篇
  • asp网站添加背景音乐seo人才招聘
  • 一个网站有多少网页福建省建设厅网站 2013
  • 网站排名优化教程网站建设毕业设计
  • 做电子商务平台网站wordpress访问人数统计
  • 如何把电脑改成服务器做网站wordpress为什么好卡
  • 云溪网络建站宝盒wordpress很安全
  • 用python怎么做网站企业网站开发用什么软件
  • 汉口北做网站wordpress 关闭功能
  • 网络网站建设公司排名苏州seo网络推广
  • 淄博网站建设同圈科技网站的首页设计
  • 手机网站布局教程广告设计速成班多少钱
  • 如何做影视剧网站网站制作的收费标准
  • 找设计公司上哪个网站静态网站怎么优化
  • 建设银行如何网站设置密码网上国网app缴费
  • 大港网站建设公司志鸿优化设计电子版
  • 做电影网站会被捉吗网站建设要哪些seo