swagger with knife4j

This commit is contained in:
MaxKey
2023-03-20 13:43:25 +08:00
parent fba48af522
commit cfded0f337
6 changed files with 65 additions and 12 deletions

View File

@@ -79,6 +79,7 @@ public class MaxKeyMvcConfig implements WebMvcConfigurer {
_logger.debug("add statics");
registry.addResourceHandler("/static/**")
.addResourceLocations("classpath:/static/");
_logger.debug("add templates");
registry.addResourceHandler("/templates/**")
.addResourceLocations("classpath:/templates/");
@@ -86,12 +87,13 @@ public class MaxKeyMvcConfig implements WebMvcConfigurer {
_logger.debug("add swagger");
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
_logger.debug("add knife4j");
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("doc.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
_logger.debug("add Resource Handler finished .");
}

View File

@@ -276,6 +276,20 @@ maxkey.swagger.title =MaxKey\u5355\u70b9\u767b\u5f55\
maxkey.swagger.description =MaxKey\u5355\u70b9\u767b\u5f55\u8ba4\u8bc1\u7cfb\u7edfAPI\u6587\u6863
maxkey.swagger.version =${application.formatted-version}
springdoc.swagger-ui.path =/swagger-ui.html
springdoc.swagger-ui.enabled =true
springdoc.swagger-ui.tags-sorter =alpha
springdoc.swagger-ui.operations-sorter =alpha
springdoc.swagger-ui.showExtensions =true
springdoc.api-docs.path =/v3/api-docs
springdoc.group-configs[0].group =default
springdoc.group-configs[0].paths-to-match =/*
springdoc.group-configs[0].packages-to-scan =org.maxkey
knife4j.enable =true
knife4j.setting.language =zh_cn
knife4j.setting.swagger-model-name =\u5B9E\u4F53\u7C7B\u5217\u8868
############################################################################
#freemarker configuration #
############################################################################