GWTP REST-Dispatch - 自从在 1.5 版本中删除了 Rest Service 接口后,rest dispatch 的新用途是什么

GWTP REST-Dispatch - What is the new usage for rest dispach, since the removal of the RestService interface in 1.5 release

大家好,

我遇到了 gwtp 框架的 rest-dispatch 模块的实现问题。

如果我按照当前的documentation,定义服务提供的资源接口应该如下:

@Path(FOO)
@Produces(MediaType.APPLICATION_JSON)
public interface FooResource {

    @GET
    RestAction<FooDTO> getFoo();

}

在客户端(没有委托扩展):

@Inject RestDispatch dispatcher;
@Inject FooResource fooResource;

...
dispatcher.execute(fooResource.getFoo(), new AsyncCallback<FooDTO>() {
     @Override
     public void onFailure(Throwable throwable) {

     }

     @Override
     public void onSuccess(FooDTO fooDto) {

     }
});
...

问题

RestDispatch 正在等待 returnRestAction 方法,但由于 RestService 接口已从 1.5 版本中删除:

如何实现 FooResource?

此外

在carstore示例项目中,唯一使用RestAction的资源是: https://github.com/ArcBees/GWTP-Samples/blob/master/carstore/src/main/java/com/gwtplatform/carstore/shared/api/StatisticsResource.java

但它是实现,实际上不是那种情况下的实现: https://github.com/ArcBees/GWTP-Samples/blob/master/carstore/src/main/java/com/gwtplatform/carstore/server/api/StatisticsResourceImpl.java

我应该遵循这个例子吗,非实现接口的目的是什么?

我认为我的问题非常具体,可能主要针对 gwtp 的作者。

我提前感谢那些愿意回应的人。

rest-dispatch是一个client-library,描述服务的接口不是在服务端使用的。 我试图做一些 GWTP 作者无意做的事情。

然而,DelegateResource 扩展是一个解决方案,如果您也想在服务器端使用该接口。它有一个缺点:能够在客户端进行类型安全回调。

更进一步,这里是我与团队在 github 上的交流: https://github.com/ArcBees/GWTP-Samples/issues/92