Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mvc request method (#749) #750

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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