Optimize the random value generation of some fields.

This commit is contained in:
shalousun 2021-11-03 13:47:52 +08:00
parent ca1048c869
commit 83b3b327ce
3 changed files with 6 additions and 0 deletions

View File

@ -66,12 +66,14 @@ Add [smart-doc-maven-plugin](https://github.com/smart-doc-group/smart-doc-maven-
<!--smart-doc implements automatic analysis of the dependency tree to load the source code of third-party dependencies. If some framework dependency libraries are not loaded, an error is reported, then use excludes to exclude-->
<excludes>
<!--The format is: groupId: artifactId; refer to the following-->
<!--Regular expressions can also be used, such as: com.google:.* -->
<exclude>com.google.guava:guava</exclude>
</excludes>
<!--Since version 1.0.8, the plugin provides includes support-->
<!--smart-doc can automatically analyze the dependency tree to load all dependent source code. In principle, it will affect the efficiency of document construction, so you can use includes to let the plugin load the components you configure.-->
<includes>
<!--The format is: groupId: artifactId; refer to the following-->
<!--Regular expressions can also be used, such as: com.google:.* -->
<include>com.alibaba:fastjson</include>
</includes>
</configuration>

View File

@ -77,6 +77,7 @@ smart-doc官方目前已经开发完成[Maven插件](https://gitee.com/smart-doc
<!--smart-doc实现自动分析依赖树加载第三方依赖的源码如果一些框架依赖库加载不到导致报错这时请使用excludes排除掉-->
<excludes>
<!--格式为groupId:artifactId;参考如下-->
<!--也可以支持正则式如com.alibaba:.* -->
<exclude>com.alibaba:fastjson</exclude>
</excludes>
<!--自1.0.8版本开始插件提供includes支持,配置了includes后插件会按照用户配置加载而不是自动加载因此使用时需要注意-->

View File

@ -55,6 +55,7 @@ public class DocUtil {
static {
fieldValue.put("uuid-string", UUID.randomUUID().toString());
fieldValue.put("traceid-string",UUID.randomUUID().toString());
fieldValue.put("id-string", String.valueOf(RandomUtil.randomInt(1, 200)));
fieldValue.put("nickname-string", enFaker.name().username());
fieldValue.put("hostname-string", faker.internet().ipV4Address());
@ -62,6 +63,8 @@ public class DocUtil {
fieldValue.put("author-string", faker.book().author());
fieldValue.put("url-string", faker.internet().url());
fieldValue.put("username-string", faker.name().username());
fieldValue.put("index-int","1");
fieldValue.put("index-integer","1");
fieldValue.put("page-int", "1");
fieldValue.put("page-integer", "1");
fieldValue.put("age-int", String.valueOf(RandomUtil.randomInt(0, 70)));