四、人人开源搭建后台与前端 2020-06-16

1、gitee上找到人人开源

    后端:renren-fast

    前端:renren-fast-vue

    后端逆向工程:renren-generator

2、每次单独对一个微服务使用逆向工程,记得修改关键点


    启动逆向工程运行,下载代码,并将下载文件解压,将其中main文件夹复制粘贴到对应微服务项目中。

        

3、

/**

* 1、整合MyBatis-Plus

*      1)、common中导入依赖

 *         <dependency>

 *             <groupId>com.baomidou</groupId>

 *             <artifactId>mybatis-plus-boot-starter</artifactId>

 *             <version>3.3.2</version>

 *         </dependency>

*      2)、配置

*          1、配置数据源

*              1)、导入数据库的驱动;

*              2)、在application.yml配置数据源相关信息

*          2、配置MyBatis-Plus:

*              1)、使用@MapperScan

*              2)、告诉MyBtis-Plus,sql映射文件

 */

在微服务的pom中添加gulimall-common依赖,common中包含了MySQL依赖等等

spring:

  datasource:

    username: root

    password: root

    url: jdbc:mysql://192.168.56.10:3306/gulimall_pms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai

    driver-class-name: com.mysql.cj.jdbc.Driver


mybatis-plus:

  mapper-location: classpath:/mapper/**/*.xml

  global-config:

    db-config:

      id-type: auto


server:

  port: 10000

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。