人人开源项目拉取

1.renren-fast 用来做后台系统:https://gitee.com/renrenio/renren-fast.git

 

2.renren-fast-vue 用来做前台系统:https://gitee.com/renrenio/renren-fast-vue.git

3.在桌面打开Git Bush

输入命令:git clone  https://gitee.com/renrenio/renren-fast.git

                  git clone https://gitee.com/renrenio/renren-fast-vue.git

克隆两个项目到卓面

然后删除两个项目中的.git文件,将两个项目复制到gulimail聚合项目中

然后将renren-fast名字加入到聚合pom文件中

4.然后将renren-fast的pom文件添加到maven控制面板中,然后刷新启动renren-fast项目

但是这里renren-fast还是爆红,打开项目结构、,原来是没有配置JDK

5.安装renren-fast-vue前端项目的依赖:npm install

 package.json中规定好了以来的版本,会根据这个来下载依赖:

但是这里报错说缺少python环境,查了原因是因为node版本wenti,将node版本由14换成10.16.3就能成功运行npm install命令来下载依赖了

6.依赖下载好了之后直接运行:npm run dev

访问路径:localhost:8001(账号/密码:admin)

7.clone人人开源的代码生成器:renren-generator

git clone https://gitee.com/renrenio/renren-generator.git

同样将项目放入gulimail聚合工程中,并在maven中引入pom文件,在工程结构中添加JDK

8.使用代码生成器生成代码:

(1)在yml文件中配置数据库ip,以及要生成模块的数据库表。这里要生成gulimail-product模块的代码所以数据库表为gulimail_pms

 

(2)在 generator.properties中配置包名等:

 

 

 

(3)启动代码生成器:(80端口)

它会将所有的表展示出来,我们勾选所有表,然后生成代码。将会下载一个压缩包,我们进行加压就行:生成的代码都在此文件夹中,我们将其复制到idea中相应的模块中就行

 

 

9.创建gulimail_common公共类:里面存放所有模块共用的配置

在pom文件中引入mybatisplus和lombok依赖,以及mysql驱动

10.配置gulimail-product模块的数据源以及mp相关配置:

创建yml文件:

spring:
  datasource:
    username: root
    password: root
    url: jdbc:mysql://192.168.43.196:3306/gulimail_pms
    driver-class-name: com.mysql.cj.jdbc.Driver

#告诉Mybatis-plus,sql映射文件位置
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  #定义实体类主键生成规则
  global-config:
    db-config:
      id-type: auto

11.在gulimail-product模块启动类需要加@MaperScan注解,告诉spring,Dao(Mapper)文件的位置:

package com.atguigu.gulimail.product;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


/*
*配置mybatis-plus
* 1.导入依赖
* 2.使用@MapperScan注解
* 3.告诉Mybatis-plus,sql映射文件位置
* */

@MapperScan("com.atguigu.gulimail.product.dao")
@SpringBootApplication
public class GulimailProductApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimailProductApplication.class, args);
    }

}

12.mybatis-plus中会继承Iservice接口,里面提供了增删改查的各种方法:

package com.atguigu.gulimail.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.uilts.PageUtils;
import com.atguigu.gulimail.product.entity.BrandEntity;

import java.util.Map;

/**
 * 品牌
 *
 * @author dlf
 * @email dlf@gmail.com
 * @date 2021-10-30 17:12:30
 */
public interface BrandService extends IService<BrandEntity> {

    PageUtils queryPage(Map<String, Object> params);
}

13.接下来一次生成其他模块的代码,重复上面的步骤。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员gelei

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值