Skip to content

Commit

Permalink
fix mvc request method (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanwb committed Nov 1, 2023
1 parent 79bcddb commit dda0ee2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jcommon/docean/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>docean</artifactId>
<version>1.4.0</version>
<version>1.4.1-SNAPSHOT</version>

<properties>
<netty.version>4.1.48.Final</netty.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ public void callService(MvcContext context, MvcRequest request, MvcResponse resp

public void callMethod(MvcContext context, MvcRequest request, MvcResponse response, MvcResult<Object> result, HttpRequestMethod method) {
Safe.run(() -> {
JsonElement arguments = gson.fromJson(new String(request.getBody()), JsonElement.class);
//GET、POST
String reqMethod = request.getMethod();
String m = method.getHttpMethod();
if (!m.equalsIgnoreCase(reqMethod)) {
throw new IllegalArgumentException(String.format("unmatched request type:%s, expect:%s", reqMethod, m.toUpperCase()));
}

JsonElement arguments = gson.fromJson(new String(request.getBody()), JsonElement.class);
MutableObject mo = getArgs(method, arguments, m);
Safe.run(() -> context.setParams(arguments));
JsonElement args = mo.getObj();
Expand Down
2 changes: 1 addition & 1 deletion jcommon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
</goals>
<configuration>
<executable>gpg</executable>
<keyname>your-gpg-key</keyname>
<!-- <keyname>your-gpg-key</keyname>-->
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit dda0ee2

Please sign in to comment.