• 模仿商品服务模块,生成其他服务模块代码
  • 检查代码,修改包的路径
  • 各个服务对应的数据库及表前缀 | 模块名 | 数据库 | 表前缀 | | —- | —- | —- | | coupon | mallsms | sms | | member | mallums | ums | | order | malloms | oms | | ware | mallwms | wms |

1、coupon

1.1、修改代码生成器

  1. generator.properties

    1. mainPath=com.ht # 主目录
    2. package=com.ht.mall # 包名
    3. moduleName=coupon # 模块名
    4. author= # 作者
    5. email=xxx@qq.com # email
    6. tablePrefix=sms_
  2. application.yml ```yaml jdbc:mysql://192.168.1.103:3306/mall_sms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai

  1. 运行 RenrenApplication.java 生成后解压复制到coupon项目对应目录下。
  2. <a name="V9uIb"></a>
  3. ## 2.2、修改coupon
  4. 1. pom.xml
  5. ```xml
  6. <dependency>
  7. <groupId>com.ht.mall</groupId>
  8. <artifactId>mall-common</artifactId>
  9. <version>0.0.1-SNAPSHOT</version>
  10. </dependency>
  1. resources下src包先删除,添加application.yml ```yaml spring: datasource: username: root password: root url: jdbc:mysql://192.168.1.103:3306/mall_sms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai driver-class-name: com.mysql.cj.jdbc.Driver

mybatis-plus: mapper-locations: classpath:/mapper/*/.xml global-config: db-config: id-type: auto logic-delete-value: 1 logic-not-delete-value: 0

server: port: 7000 ``` 运行mallCouponApplication.java
http://localhost:8080/coupon/coupon/list
测试成功:{“msg”:”success”,”code”:0,”page”:{“totalCount”:0,”pageSize”:10,”totalPage”:0,”currPage”:1,”list”:[]}}

其他模块类似……