Skip to content

Commit

Permalink
fix(echo) Automatically recognizes and removes string backslashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
yizzuide committed Nov 18, 2020
1 parent 67688f1 commit a11b8e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Milkomeda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<properties>
<java.version>1.8</java.version>
<project.release.version>3.12.7-SNAPSHOT</project.release.version>
<project.release.version>3.12.8-SNAPSHOT</project.release.version>
<spring-boot.version>2.2.4</spring-boot.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<mybatis.starter.version>2.1.1</mybatis.starter.version>
Expand Down Expand Up @@ -67,7 +67,7 @@
<profile>
<id>sonatype-oss-release</id>
<properties>
<project.release.version>3.12.7</project.release.version>
<project.release.version>3.12.8</project.release.version>
</properties>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @author yizzuide
* @since 1.13.0
* @version 3.12.7
* @version 3.12.8
* Create at 2019/09/21 19:00
*/
@Slf4j
Expand Down Expand Up @@ -104,13 +104,18 @@ protected <T> EchoResponseData<T> createReturnData(Object respData, TypeReferenc
if (isStringType) {
return responseData;
}
// 去字符串符和反斜杠
String dataStr = (String) responseData.getData();
if (dataStr.startsWith("\"")) {
dataStr = dataStr.substring(1);
}
if (dataStr.endsWith("\"")) {
dataStr = dataStr.substring(0, dataStr.length() - 1);
}
if (dataStr.contains("\\")) {
dataStr = dataStr.replaceAll("\\\\", "");
}
// 驼峰转换
if (forceCamel) {
responseData.setData(JSONUtil.toCamel(dataStr, specType));
return responseData;
Expand Down
2 changes: 1 addition & 1 deletion MilkomedaDemo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<milkomeda.version>3.12.7-SNAPSHOT</milkomeda.version>
<milkomeda.version>3.12.8-SNAPSHOT</milkomeda.version>
<mybatis.starter>2.1.1</mybatis.starter>
<redission.version>3.12.5</redission.version>
<zookeeper.version>3.4.14</zookeeper.version>
Expand Down

0 comments on commit a11b8e2

Please sign in to comment.