bibabolynn / bibabolynn/learning-materials

泛型 ServiceResponse<T>

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
worklog
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.