在pom.xml中加入启动器
<!-- 引入retrofit依赖 -->
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.5</version>
</dependency>
<!-- 引入retrofit依赖 没有此包 retrofit starter 会启动失败 -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.9</version>
</dependency>
在application.propertices中做简单配置
## Retrofit
retrofit.global-log.enable=true
retrofit.global-log.log-level=info
其作用就是显示日志,正式发版前可以去掉
在启动类中加入接口扫描注解
@RetrofitScan("cn.xxx.xxx")
可以传入数组,指定多