update readme

This commit is contained in:
oppofind 2020-07-03 15:07:48 +08:00
parent bba93b5060
commit 628303fc55
4 changed files with 11 additions and 2 deletions

View File

@ -133,6 +133,9 @@ When you need to use smart-doc to generate more API document information, you ca
"className": "org.springframework.data.domain.Pageable",
"replacementClassName": "com.power.doc.model.PageRequestDto" //Use custom PageRequestDto instead of JPA Pageable for document rendering.
}],
"apiConstants": [{////Configure your own constant class, smart-doc automatically replaces with a specific value when parsing to a constant
"constantsClassName": "com.power.doc.constants.RequestParamConstant"
}],
  "requestHeaders": [// Set global request headers, no need to set
    {
      "name": "token",

View File

@ -140,6 +140,9 @@ smart-doc官方目前已经开发完成maven 插件和gradle你可以根据
"className": "org.springframework.data.domain.Pageable",
"replacementClassName": "com.power.doc.model.PageRequestDto" //自定义的PageRequestDto替换Pageable做文档渲染
}],
"apiConstants": [{//从1.8.9开始配置自己的常量类smart-doc在解析到常量时自动替换为具体的值
"constantsClassName": "com.power.doc.constants.RequestParamConstant"
}],
"sourceCodePaths": [ //设置代码路径, 插件已经能够自动下载发布的源码包,没必要配置
{
"path": "src/main/java",

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>smart-doc</artifactId>
<packaging>jar</packaging>
<version>1.8.8</version>
<version>1.8.9</version>
<name>smart-doc</name>
<url>https://github.com/shalousun/smart-doc.git</url>
@ -59,7 +59,7 @@
<dependency>
<groupId>com.github.shalousun</groupId>
<artifactId>common-util</artifactId>
<version>1.9.5</version>
<version>1.9.6</version>
</dependency>
<!--markdown to html-->
<dependency>

View File

@ -50,6 +50,7 @@ public class SpringMVCRequestMappingHandler {
* @param serverUrl server url
* @param controllerBaseUrl spring mvc controller base url
* @param method JavaMethod
* @param constantsMap project constant container
* @return RequestMapping
*/
public RequestMapping handle(String serverUrl, String controllerBaseUrl, JavaMethod method, Map<String, String> constantsMap) {
@ -113,9 +114,11 @@ public class SpringMVCRequestMappingHandler {
String value = entry.getValue();
if (url.contains(key)) {
url = url.replace(key, value);
url = url.replace("+", "");
}
if (shortUrl.contains(key)) {
shortUrl = shortUrl.replace(key, value);
shortUrl = shortUrl.replace("+", "");
}
}
return RequestMapping.builder().setMediaType(mediaType).setMethodType(methodType)