Skip to content

Commit

Permalink
Merge pull request #504 from shalousun/master
Browse files Browse the repository at this point in the history
release 2.6.9
  • Loading branch information
shalousun authored May 14, 2023
2 parents c263981 + ac1efb9 commit 147c6cb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 51 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
## smart-doc版本

### 版本号:2.6.9

- 更新日期: 2023-05-14
- 更新内容:
1. 修复qdox不允许将字段名命名为permits关键字的bug,[#498](https://github.com/smart-doc-group/smart-doc/issues/498)
2. dubbo接口继承父类时,父类中接口未解析问题修复。[#493](https://github.com/smart-doc-group/smart-doc/issues/493)
3. 优化插件对许多无关依赖的过滤,提升插件开箱即用的能力。
4. 支持禁用随机mock值生成,[#497](https://github.com/smart-doc-group/smart-doc/issues/497)


### 版本号:2.6.8

- 更新日期: 2023-05-02
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>smart-doc</artifactId>
<packaging>jar</packaging>
<version>2.6.8</version>
<version>2.6.9</version>

<name>smart-doc</name>
<url>https://github.com/smart-doc-group/smart-doc.git</url>
Expand Down Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>com.github.shalousun</groupId>
<artifactId>qdox</artifactId>
<version>2.0.3</version>
<version>2.0.3.1</version>
</dependency>
<dependency>
<groupId>net.datafaker</groupId>
Expand All @@ -61,7 +61,7 @@
<dependency>
<groupId>com.github.shalousun</groupId>
<artifactId>common-util</artifactId>
<version>2.1.8</version>
<version>2.1.9</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
49 changes: 1 addition & 48 deletions src/main/java/com/power/doc/utils/DocUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static String jsonValueByType(String typeName) {
if (randomMockFlag) {
value = RandomUtil.randomValueByType(type);
} else {
value = generateDefaultValueByType(type);
value = RandomUtil.generateDefaultValueByType(type);
}
if (javaPrimaryType(type)) {
return value;
Expand Down Expand Up @@ -1046,51 +1046,4 @@ public static boolean substringMatch(CharSequence str, int index, CharSequence s
}
return true;
}

public static String generateDefaultValueByType(String type) {
switch (type) {
//12
case "char":
return "";
case "Integer": //4
case "int":
case "Long": //-5
case "long":
case "BigDecimal": //3
case "BigInteger":
return "0";
case "Double": //8
case "double":
case "Float": //6
case "float":
return "0.0";
case "short":
case "Short":
return "0";
case "boolean":
case "Boolean":
return "true";
case "Time": //91
case "Date":
case "Timestamp":
case "LocalDateTime":
return DateTimeUtil.DATE_FORMAT_SECOND;
case "LocalTime":
return DateTimeUtil.LOCAL_TIME;
case "Year":
return DateTimeUtil.YEAR;
case "MonthDay":
return DateTimeUtil.MONTH_DAY;
case "YearMonth":
return DateTimeUtil.YEAR_MONTH;
case "LocalDate":
return DateTimeUtil.DATE_FORMAT_DAY;
case "ZonedDateTime":
return DateTimeUtil.DATE_FORMAT_ZONED_DATE_TIME;
case "OffsetDateTime":
return OffsetDateTime.now().toString();
default:
return "";
}
}
}

0 comments on commit 147c6cb

Please sign in to comment.