sofastack / sofa-rpc-node

SOFARPC Node is a high-performance, high-extensibility, production-level Nodejs RPC framework.
MIT License
612 stars 64 forks source link

hessain2 HashMap cannot be cast to xx.xx.entity #31

Closed liuyang-zhituanbox closed 5 years ago

liuyang-zhituanbox commented 5 years ago

node ts 描述参数类

export interface AppPermissionListVo {
    /**
     * 路由LIST
     */
    permissions: Array<AppPlatformPermissionVo>;
}

参数只包装了父级 cn.bhbapp.vo.platform.AppPermissionListVo 于是调用时,AppPlatformPermissionVo解析报错,转换异常。

liuyang-zhituanbox commented 5 years ago

我们目前的场景时java做提供者,node做消费者。我们做成sdk的方式,提供给node端使用。 为什么不用egg-sofa那样,因为我们是以sdk的方式提供,而且是TS写的。现在不好的就是每次发布接口,我们都需要手写sdk,能不能做到自动转换那种

gxcsoccer commented 5 years ago

@liuyang-zhituanbox 参考这篇文章 https://www.yuque.com/egg/nodejs/crmc40