修复:rpc 数据解析错误
This commit is contained in:
parent
8a5f1c10e1
commit
4d125f8e46
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.tccn</groupId>
|
||||
<artifactId>zhub-client-redkale</artifactId>
|
||||
<version>0.1.1-dev</version>
|
||||
<version>0.1.3.dev</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
@ -34,7 +34,7 @@ public class RpcResult<R> {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(Object result) {
|
||||
this.result = (R) result;
|
||||
public void setResult(R result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
|
@ -679,7 +679,7 @@ public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer
|
||||
TypeToken typeToken = rpc.getTypeToken();
|
||||
if (typeToken.getType() != ((RpcResult<?>) value).getResult().getClass()) {
|
||||
Object result = convert.convertFrom(typeToken.getType(), toStr(((RpcResult<?>) value).getResult()));
|
||||
((RpcResult<?>) value).setResult(result);
|
||||
((RpcResult<Object>) value).setResult(result);
|
||||
}
|
||||
|
||||
rpc.setRpcResult((RpcResult) value);
|
||||
@ -725,7 +725,8 @@ public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer
|
||||
Rpc<T> rpc = null;
|
||||
try {
|
||||
if (v instanceof String) {
|
||||
rpc = convert.convertFrom(IType.STRING.getType(), (String) v);
|
||||
rpc = convert.convertFrom(new TypeToken<Rpc<String>>() {
|
||||
}.getType(), (String) v);
|
||||
} else {
|
||||
rpc = (Rpc<T>) v;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user