Skip to content

泛型 ServiceResponse<T> #2

@bibabolynn

Description

@bibabolynn

接口我们一般放在api model 具体实现放在service model
你在service model 的pom里引人了别人的包调用 xxxService ,返回ServiceResponse,但是 api model里没有引
实现类里调 ServiceResponse response = xxxService.xxx(); 返回response ,response是ServiceResponse 而不是 ServiceResponse
那么编译不会报错,但是运行的时候会调用失败,因为api model 里没有T这个类,转化不成功,要么在 api model引人一下,要么在实现类中转化一下

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions