服务提供者 provider 8001
在Controller层中使用@RestController注解
import org.springframework.web.bind.annotation.RestController;
@RestController
application.yml
sever:
port:8001 #端口号
mybatis
type-aliases-package: #pojo路径
mapper-location:#mapper.xml路径
spring
application
name: #自己的名称
datasource
type:
drive-class-name:
url:jdbc:mysql://localhost:3306/db01?user
username:
password:
当集合eureka时,需要在yml文件中加入以下配置
eureka:#1、导入eureka依赖。2、启动类中添加@EnableEurekaClient
service-url:
defaultZone: #eureka注册中心的default属性
instance:
instance-id:#修改默认描述信息