1: 一个提供接口,一个实现接口
2: yml
#server:
# port: 8122
# servlet.context-path: /test
spring:
application:
name: server-account
main:
allow-bean-definition-overriding: true
cloud:
nacos:
discovery:
server-addr: 192.168.0.109:8848
namespace: 9e7d04e1-0b95-4205-a278-7f05b9afdce1
group: common
config:
server-addr: 192.168.0.109:8848
file-extension: yaml
namespace: 9e7d04e1-0b95-4205-a278-7f05b9afdce1
shared-configs: common-tool.yaml
refresh-enabled: true
group: common
datasource:
username: root
password: xxxxxxx
url: jdbc:mysql://192.168.0.109:3306/vily-common?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
driver-class-name: com.mysql.jdbc.Driver
redis:
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
database: 3
host: 192.168.0.109
port: 6379
# redis访问密码(默认为空)
password: xxxxx
timeout: 1000
dubbo:
scan:
base-packages: com.vily.petlove.dubbo
protocol:
name: dubbo
port: 18122
# 注册中心配置
registry:
address: nacos://192.168.0.109:8848
group: common
application:
name: server-account
mybatis:
type-aliases-package: learning.model
#mapper.xml所在位置
mapper-locations: classpath:mybatis/mappers/*.xml
3: 不要忘记
4: 接口实现,一个是远程调用的@service,一个是可供本地使用的@service