Create a subproject module of the microservice

Insert picture description here
Create a module file
Insert picture description here

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
Insert picture description here
added module will be displayed in the pom of the parent class
Insert picture description here. Create application.yml under resources
Insert picture description here

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
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44822939/article/details/114231482