- 模仿商品服务模块,生成其他服务模块代码
- 检查代码,修改包的路径
- 各个服务对应的数据库及表前缀 | 模块名 | 数据库 | 表前缀 | | —- | —- | —- | | coupon | mallsms | sms | | member | mallums | ums | | order | malloms | oms | | ware | mallwms | wms |
1、coupon
1.1、修改代码生成器
generator.properties
mainPath=com.ht # 主目录
package=com.ht.mall # 包名
moduleName=coupon # 模块名
author= # 作者
email=xxx@qq.com # email
tablePrefix=sms_
application.yml ```yaml jdbc:mysql://192.168.1.103:3306/mall_sms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
运行 RenrenApplication.java 生成后解压复制到coupon项目对应目录下。
<a name="V9uIb"></a>
## 2.2、修改coupon
1. pom.xml
```xml
<dependency>
<groupId>com.ht.mall</groupId>
<artifactId>mall-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
- 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”:[]}}
其他模块类似……