Giter Site home page Giter Site logo

Comments (5)

wongoo avatar wongoo commented on June 7, 2024

@zhushengjun-it java int就直接在golang中用int接收就好,具体枚举值程序判断就好。

from dubbo-go-hessian2.

zhushengjun-it avatar zhushengjun-it commented on June 7, 2024

我在golang-client 定义结构体中的属性为int时:调用会报错:java exception:Fail to decode request due to: RpcInvocation

如果注释掉这个int的属性参数,那么请求就成功了。

java-server 中这个属性的定义 :
public enum ActionType {
UNDEFINED(0),
...
}
@expose
private ActionType actionType;

from dubbo-go-hessian2.

wongoo avatar wongoo commented on June 7, 2024

我在golang-client 定义结构体中的属性为int时:调用会报错:java exception:Fail to decode request due to: RpcInvocation

如果注释掉这个int的属性参数,那么请求就成功了。

java-server 中这个属性的定义 : public enum ActionType { UNDEFINED(0), ... } @expose private ActionType actionType;

java这样的枚举定义,golang中可能要用string来接收

from dubbo-go-hessian2.

zhushengjun-it avatar zhushengjun-it commented on June 7, 2024

我在golang-client 定义结构体中的属性为int时:调用会报错:java exception:Fail to decode request due to: RpcInvocation
如果注释掉这个int的属性参数,那么请求就成功了。
java-server 中这个属性的定义 : public enum ActionType { UNDEFINED(0), ... } @expose private ActionType actionType;

java这样的枚举定义,golang中可能要用string来接收

我试了一下 string貌似也不行。我如果注释掉这个字段,java那边收到的这个参数是null。

from dubbo-go-hessian2.

zhushengjun-it avatar zhushengjun-it commented on June 7, 2024

已解决。
golang定义:

type ActionType struct {
Name string
}

func (a ActionType) JavaClassName() string {
return "actionType的父类名"
}
func (a ActionType) JavaParamName() string {
return "actionType的类名"
}

from dubbo-go-hessian2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.