Create a module file
After creating the submodule, the directory structure of the project is as follows. There are two pom files, one is the pom of the parent project, and the other is the pom of the subproject. The
added module will be displayed in the pom of the parent class
. Create application.yml under resources
application.yml configuration file
server:
port: 8001
spring:
application:
name: cloud-payment-service
datasource:
type: com.alibaba.druid.pool.DruidDataSource # 当前数据源操作类型
driver-class-name: org.gjt.mm.mysql.Driver # mysql驱动包
url: jdbc:mysql://localhost:3306/db2019?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: 123
mybatis:
mapperLocations: classpath:mapper/*.xml
type-aliases-package: com.atguigu.springcloud.entities # 所有Entity别名类所在包
Write the main startup class