SocketNet opened a new issue #272:
URL: https://github.com/apache/dubbo-go-hessian2/issues/272
Java 对象
```
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImRequestMsgBody {
private String url;
private Map<String, Object> params;
}
```
转 JSON 后通过 Hessian2Output 序列化,得到以下数据
`1;{"params":{"fromAccid":"23495382","msgType":100,"msgId":"148ef1b2-808d-48f2-b268-7a1018a27bdb","attach":"{\"accid\":\"23495382\",\"classRoomFlag\":50685,\"msgId\":\"599645021431398400\",\"msgType\":\"100\",\"nickname\":\"橙子������\"}","roomid":413256699},"url":"https://api.netease.im/nimserver/chatroom/sendMsg.action"}`
Go 还原后得到以下数据
`
func stringHessianDecode(data []byte) (string, error) {
decode := hessian.NewDecoder(data)
res, err := decode.Decode()
if err != nil {
return "", err
}
return res.(string), nil
}
`
`{"params":{"fromAccid":"23495382","msgType":100,"msgId":"148ef1b2-808d-48f2-b268-7a1018a27bdb","attach":"{\"accid\":\"23495382\",\"classRoomFlag\":50685,\"msgId\":\"599645021431398400\",\"msgType\":\"100\",\"nickname\":\"橙子������\"}","roomid":413256699},"url":"https://api.netease.im/nimserver/chatroom/sendMsg.acti`
这里只是举个例子,丢的更夸张的字符串
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]