pio*_*rpo 6 java spring-mvc retrofit2
我想创建一个包含3个模块的项目:
Data classes are easy part as I can use this same parser on both ends, or just don't use any gson / jackson / *son annotations at all.
The problem is:
How to define Retrofit interface and Spring in a way that do not require manual synchronization of both files?
Retrofit:
public interface GitHubService {
@GET("users/{user}/repos")
Call<List<Repo>> listRepos(@Path("user") String user);
}
Run Code Online (Sandbox Code Playgroud)
Spring:
public class GitHubService {
@RequestMapping(value="users/{user}/repos", mehod=GET)
List<Repo> listRepos(@PathVariable("user") String user);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
669 次 |
| 最近记录: |