RUOYI框架在实际项目中的应用三:Ruoyi微服务版本-RuoYi-Cloud


RUOYI框架在实际项目中的应用一:ruoyi简介
RUOYI框架在实际项目中的应用二:Ruoyi前后端分离版本-RuoYi-Vue
RUOYI框架在实际项目中的应用三:Ruoyi微服务版本-RuoYi-Cloud

一、Ruoyi微服务版本-Ruoyi微服务版本

1、官方资料

1:代码地址:https://gitee.com/y_project/RuoYi-Cloud.git
2:文档介绍地址:http://doc.ruoyi.vip/ruoyi-cloud/
3:演示地址:http://vue.ruoyi.vip/login

注:如果是大体量公司项目,需要使用微服务管理。就选择这个。

2、框架简介

RuoYi-Cloud 是一个 Java EE 分布式微服务架构平台,基于经典技术组合(Spring Boot、Spring Cloud & Alibaba、Vue、Element),内置模块如:部门管理、角色用户、菜单及按钮授权、数据权限、系统参数、日志管理、代码生成等。在线定时任务配置;支持集群,支持多数据源。
在这里插入图片描述

1:技术选型

1、系统环境

  • Java EE 8
  • Servlet 3.0
  • Apache Maven 3

2、主框架

  • Spring Boot 2.3.x
  • Spring Cloud Hoxton.SR9
  • Spring Framework 5.2.x
  • Spring Security 5.2.x

3、持久层

  • Apache MyBatis 3.5.x
  • Hibernate Validation 6.0.x
  • Alibaba Druid 1.2.x

4、视图层

  • Vue 2.6.x
  • Axios 0.21.0
  • Element 2.14.x

2:官方推荐软件环境版本

JDK >= 1.8 (推荐1.8版本)
Mysql >= 5.7.0 (推荐5.7版本)
Redis >= 3.0
Maven >= 3.0
Node >= 12
nacos >= 2.0.4 (ruoyi-cloud < 3.0 需要下载nacos >= 1.4.x版本)
sentinel >= 1.6.0

二、框架搭建

1:下载代码

https://gitee.com/y_project/RuoYi-Cloud.git
在这里插入图片描述
在这里插入图片描述

2:环境配置

在Ruoyi-cloud中需要用的如下中间件:

以上三个中间件在此不再赘述,如果公司有就用,没有的话,就自己搭建

3:配置框架数据库表

在这里插入图片描述
注:

  • 创建数据库ry-cloud并导入数据脚本ry_2021xxxx.sql(必须),quartz.sql(可选)
  • 创建数据库ry-config并导入数据脚本ry_config_2021xxxx.sql(如果有nacos就不用执行了)
  • 创建数据库ry-seata并导入数据脚本ry_seata_2021xxxx.sql(如果不涉及分布式事务,就不需要了)

4:修改配置

1:修改各模块下src/main/resources/bootstrap.yml

如果配置全部放在nacos下,那么就修改bootstrap.yml 的nacos配置
在这里插入图片描述
这里给出一个配置实例

# Tomcat
server:
  port: 9201

# Spring
spring: 
  application:
    # 应用名称
    name: ruoyi-system
  profiles:
    # 环境配置
    active: dev
  cloud:
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 127.0.0.1:8848
        namespace: ruoyi_test
        group: DEFAULT_GROUP
        username: nacos
        password: nacos_2024@
      config:
        # 配置中心地址
        server-addr: ${spring.cloud.nacos.discovery.server-addr}
        # 配置文件格式
        file-extension: yml
        # 共享配置
        shared-configs:
          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
        namespace: ${spring.cloud.nacos.discovery.namespace}
        group: ${spring.cloud.nacos.discovery.group}
        username: ${spring.cloud.nacos.discovery.username}
        password: ${spring.cloud.nacos.discovery.password}

注:
1:如果对nacos不了破的,推荐看:Nacos-01-Nacos的简介和安装
2:nacos中默认的各模块配置文件,在程序的ry_config_2021xxxx.sql 的config_info中,大家可自行获取
在这里插入图片描述

5:启动后端

打开运行基础模块(启动没有先后顺序)

  • RuoYiGatewayApplication (网关模块 必须)
  • RuoYiAuthApplication (认证模块 必须)
  • RuoYiSystemApplication (系统模块 必须)
  • RuoYiMonitorApplication (监控中心 可选)
  • RuoYiGenApplication (代码生成 可选)
  • RuoYiJobApplication (定时任务 可选)
  • RuoYFileApplication (文件服务 可选)

6:启动前段

# 进入项目目录
cd ruoyi-ui

# 安装依赖
npm install

# 强烈建议不要用直接使用 cnpm 安装,会有各种诡异的 bug,可以通过重新指定 registry 来解决 npm 安装速度慢的问题。
npm install --registry=https://registry.npmmirror.com

# 本地开发 启动项目
npm run dev

打开浏览器,输入:(http://localhost:80 (opens new window)) 默认账户/密码 admin/admin123)
若能正确展示登录页面,并能成功登录,菜单及页面展示正常,则表明环境搭建成功

三、代码模块说明

1:后端结构

com.ruoyi     
├── ruoyi-ui              // 前端框架 [80]
├── ruoyi-gateway         // 网关模块 [8080]
├── ruoyi-auth            // 认证中心 [9200]
├── ruoyi-api             // 接口模块
│       └── ruoyi-api-system                          // 系统接口
├── ruoyi-common          // 通用模块
│       └── ruoyi-common-core                         // 核心模块
│       └── ruoyi-common-datascope                    // 权限范围
│       └── ruoyi-common-datasource                   // 多数据源
│       └── ruoyi-common-log                          // 日志记录
│       └── ruoyi-common-redis                        // 缓存服务
│       └── ruoyi-common-seata                        // 分布式事务
│       └── ruoyi-common-security                     // 安全模块
│       └── ruoyi-common-sensitive                    // 数据脱敏
│       └── ruoyi-common-swagger                      // 系统接口
├── ruoyi-modules         // 业务模块
│       └── ruoyi-system                              // 系统模块 [9201]
│       └── ruoyi-gen                                 // 代码生成 [9202]
│       └── ruoyi-job                                 // 定时任务 [9203]
│       └── ruoyi-file                                // 文件服务 [9300]
├── ruoyi-visual          // 图形化管理模块
│       └── ruoyi-visual-monitor                      // 监控中心 [9100]
├──pom.xml                // 公共依赖

2:前端结构

com.ruoyi     
├── ruoyi-ui              // 前端框架 [80]
├── ruoyi-gateway         // 网关模块 [8080]
├── ruoyi-auth            // 认证中心 [9200]
├── ruoyi-api             // 接口模块
│       └── ruoyi-api-system                          // 系统接口
├── ruoyi-common          // 通用模块
│       └── ruoyi-common-core                         // 核心模块
│       └── ruoyi-common-datascope                    // 权限范围
│       └── ruoyi-common-datasource                   // 多数据源
│       └── ruoyi-common-log                          // 日志记录
│       └── ruoyi-common-redis                        // 缓存服务
│       └── ruoyi-common-seata                        // 分布式事务
│       └── ruoyi-common-security                     // 安全模块
│       └── ruoyi-common-sensitive                    // 数据脱敏
│       └── ruoyi-common-swagger                      // 系统接口
├── ruoyi-modules         // 业务模块
│       └── ruoyi-system                              // 系统模块 [9201]
│       └── ruoyi-gen                                 // 代码生成 [9202]
│       └── ruoyi-job                                 // 定时任务 [9203]
│       └── ruoyi-file                                // 文件服务 [9300]
├── ruoyi-visual          // 图形化管理模块
│       └── ruoyi-visual-monitor                      // 监控中心 [9100]
├──pom.xml                // 公共依赖

3:实际使用过程

ruoyi的cloud框架很不错,但是很多情况下没什么用,或者用不到,那么最精简的情况是

com.ruoyi     
├── ruoyi-ui              // 前端框架 [80]
├── ruoyi-gateway         // 网关模块 [8080]
├── ruoyi-auth            // 认证中心 [9200]
├── ruoyi-api             // 接口模块
│       └── ruoyi-api-system                          // 系统接口
├── ruoyi-common          // 通用模块
│       └── ruoyi-common-core                         // 核心模块
│       └── ruoyi-common-datascope                    // 权限范围
│       └── ruoyi-common-datasource                   // 多数据源
│       └── ruoyi-common-log                          // 日志记录
│       └── ruoyi-common-redis                        // 缓存服务
│       └── ruoyi-common-security                     // 安全模块
│       └── ruoyi-common-swagger                      // 系统接口
├── ruoyi-modules         // 业务模块
│       └── ruoyi-system                              // 系统模块 [9201]
│       └── ruoyi-gen                                 // 代码生成 [9202]
│       └── ruoyi-job                                 // 定时任务 [9203]
│       └── ruoyi-file                                // 文件服务 [9300]
├──pom.xml                // 公共依赖

4:Ruoyi-cloud框架默认nacos配置

在我们启动ruoyi-cloud后,我们需要在系统中配置nacos的默认配置文件,比如
在这里插入图片描述

上边nacos中默认的各模块配置文件,在程序的ry_config_2021xxxx.sql 的config_info中,大家可自行获取
在这里插入图片描述

注:如果我们使用ruoyi-cloud自带的nacos数据库,那么打开nacos就会出现上边的配置。如果使用的是其他的nacos,大家可以从这里进行对应配置的获取。

四、功能模块说明

1:新建子模块

Maven多模块下新建子模块流程案例。

1、在ruoyi-modules下新建业务模块目录,例如:ruoyi-test。

2、在ruoyi-test业务模块下新建pom.xml文件以及src\main\java,src\main\resources目录

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>com.ruoyi</groupId>
        <artifactId>ruoyi-modules</artifactId>
        <version>x.x.x</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
	
    <artifactId>ruoyi-modules-test</artifactId>

    <description>
        ruoyi-modules-test系统模块
    </description>
	
    <dependencies>
    	
    	<!-- SpringCloud Alibaba Nacos -->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        </dependency>
        
        <!-- SpringCloud Alibaba Nacos Config -->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>
        
    	<!-- SpringCloud Alibaba Sentinel -->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
        </dependency>
        
    	<!-- SpringBoot Actuator -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
		
        <!-- Mysql Connector -->
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
        </dependency>
        
        <!-- Ruoyi Common Security -->
        <dependency>
            <groupId>com.ruoyi</groupId>
            <artifactId>ruoyi-common-security</artifactId>
        </dependency>
        
        <!-- Ruoyi Common Swagger -->
        <dependency>
            <groupId>com.ruoyi</groupId>
            <artifactId>ruoyi-common-swagger</artifactId>
        </dependency>
		
		<!-- RuoYi Common Log -->
        <dependency>
            <groupId>com.ruoyi</groupId>
            <artifactId>ruoyi-common-log</artifactId>
        </dependency>
        
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
   
</project>

3、在ruoyi-modules目录下pom.xml模块节点modules添加业务模块

<module>ruoyi-test</module>

4、src/main/resources添加bootstrap.yml文件

# Tomcat
server:
  port: 9301

# Spring
spring: 
  application:
    # 应用名称
    name: ruoyi-test
  profiles:
    # 环境配置
    active: dev
  cloud:
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 127.0.0.1:8848
      config:
        # 配置中心地址
        server-addr: 127.0.0.1:8848
        # 配置文件格式
        file-extension: yml
        # 共享配置
        shared-configs:
          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

5、com.ruoyi.test包下添加主启动类

package com.ruoyi.test;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import com.ruoyi.common.security.annotation.EnableCustomConfig;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;

/**
 * 测试模块
 * 
 * @author ruoyi
 */
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringCloudApplication
public class RuoYiTestApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(RuoYiTestApplication.class, args);
        System.out.println("(♥◠‿◠)ノ゙  测试模块启动成功   ლ(´ڡ`ლ)゙  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");
    }
}

2:系统接口-springDoc冒烟测试

  • ruoyi-cloud版本<3.6.4 时,使用的是swagger 作为系统接口文档展示,
  • ruoyi-cloud版本>3.6.4 时,改用了SpringDoc作为系统接口文档展示。

3:ruoyi-cloud版本<3.6.4 时,使用的是swagger

swagger的基础使用,请看:swagger-springboot详解

1>:使用ruoyi框架后自己创建swagger

1):添加依赖
添加依赖

<!-- SpringBoot Web -->
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- Swagger -->
<dependency>
	<groupId>io.springfox</groupId>
	<artifactId>springfox-swagger2</artifactId>
	<version>${swagger.fox.version}</version>
</dependency>

<!-- Swagger UI -->
<dependency>
	<groupId>io.springfox</groupId>
	<artifactId>springfox-swagger-ui</artifactId>
	<version>${swagger.fox.version}</version>
2):在application.yml添加服务配置
swagger:
  title: 系统模块接口文档
  license: Powered By ruoyi
  licenseUrl: https://ruoyi.vip

3):在Application启动类加入注解@SpringBootApplication和@EnableSwagger2。
@EnableSwagger2
@SpringBootApplication
public class RuoYiSwaggerApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(RuoYiSwaggerApplication.class, args);
        System.out.println("(♥◠‿◠)ノ゙  Swagger启动成功   ლ(´ڡ`ლ)゙  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");
    }
}

2>:项目中存在ruoyi-common-swagger模块,可忽略上边三个步骤,可以直接依赖后使用。

1)、业务模块添加依赖
<!-- ruoyi common swagger -->
<dependency>
	<groupId>com.ruoyi</groupId>
	<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
2):增加配置文件参数
# swagger配置
swagger:
  title: 系统模块接口文档
  license: Powered By ruoyi
  licenseUrl: https://ruoyi.vip
3):在Application启动类加入系统接口注解@EnableCustomSwagger2
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringCloudApplication
public class RuoYiSystemApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(RuoYiSystemApplication.class, args);
        System.out.println("(♥◠‿◠)ノ゙  系统模块启动成功   ლ(´ڡ`ლ)゙  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");
    }
}
4):测试验证

访问http://{ip}:{port}/swagger-ui/index.html地址,出现如下图表示成功。

4:ruoyi-cloud版本>3.6.4 时,改用了SpringDoc

1>:使用ruoyi框架后自己创建swagger

1)、添加依赖
<!-- RuoYi Common Swagger -->
<dependency>
	<groupId>com.ruoyi</groupId>
	<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
2)、在application.yml添加服务配置
server:
  port: 6666

spring:
  application:
    name: ruoyi-xxxx

# springdoc配置
springdoc:
  # 通过网关使用地址
  # gatewayUrl: http://localhost:8080/${spring.application.name}
  # 单独运行使用本机
  gatewayUrl: http://localhost:6666
  api-docs:
    # 是否开启接口文档
    enabled: true
  info:
    # 标题
    title: '测试接口文档'
    # 描述
    description: '测试接口描述'
    # 作者信息
    contact:
      name: RuoYi
      url: https://ruoyi.vip
3)、在Application启动类加入注解@SpringBootApplication。
@SpringBootApplication
public class RuoYiSwaggerApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(RuoYiSwaggerApplication.class, args);
        System.out.println("(♥◠‿◠)ノ゙  Swagger启动成功   ლ(´ڡ`ლ)゙  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");
    }
}

2>:项目中存在ruoyi-common-swagger模块,可忽略上边三个步骤,可以直接依赖后使用。

1)、业务模块添加依赖
<!-- ruoyi common swagger -->
<dependency>
	<groupId>com.ruoyi</groupId>
	<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
2)、在ruoyi-xxxx-dev.yml添加接口配置
springdoc方式,ruoyi-cloud版本 > 3.6.4 使用
# springdoc配置  
springdoc:
  # 通过网关使用地址
  # gatewayUrl: http://localhost:8080/${spring.application.name}
  # 单独运行使用本机
  gatewayUrl: http://localhost:6666
  api-docs:
    # 是否开启接口文档
    enabled: true
  info:
    # 标题
    title: '测试接口文档'
    # 描述
    description: '测试接口描述'
    # 作者信息
    contact:
      name: RuoYi
      url: https://ruoyi.vip
3):测试验证

访问http://{ip}:{port}/swagger-ui/index.html地址

5:其他拓展功能

除了ruoyi内置的很多功能以外,如果我们想对系统代码进行中间技术框架替换,如knife4j替换swagger,使用minio,使用es等,我们都可以从容的增加和使用,在ruoyi网站中也有类似的文档指导,大家可以参考:
在这里插入图片描述

6:如何更换项目包路径

我们使用过程中还有很多问题,比如因为ruoyi默认的是com.ruoyi路径,我们实际使用过程中要改成公司名,比如com.baidu。此时ruoyi也为我们提供了很多常用工具。

在这里插入图片描述
在这里插入图片描述

<think>好的,用户想了解Ruoyi微服务架构的实现、源码和配置。首先,我需要回忆一下关于Ruoyi框架的知识。Ruoyi是一个开源的企业级快速开发平台,微服务版本是基于Spring Cloud的。用户提到了引用中的组件视图和配置文件,比如ruoyi-cloud,还有各种yml文件。 首先,我应该介绍Ruoyi微服务架构的整体结构,可能包括核心组件如注册中心、配置中心、网关等。然后需要分模块说明,比如系统模块、认证模块、任务调度等,每个模块对应的子项目和使用的技术,比如Nacos、Spring Cloud Gateway、Sentinel等。 接下来是源码结构部分,用户可能需要知道各个子模块的作用,比如ruoyi-auth负责认证,ruoyi-system是系统核心。需要列出主要的子项目,并简要说明每个的功能。 然后是配置说明,用户提到了ruoyi-system-dev.yml等配置文件,应该解释这些配置文件的作用,以及如何配置数据库、Redis、Nacos等。同时,后台运行的命令也需要提及,比如nohup命令启动各个服务。 部署步骤也是用户关心的,需要给出从克隆代码到启动的步骤,确保用户能按照流程操作。可能还需要提到Maven构建和端口配置。 最后,相关问题部分要覆盖架构设计、模块功能、配置管理、扩展方法以及与其他框架的比较,这样用户如果有后续问题可以继续深入。 需要注意引用中的内容,比如引用[1]提到的组件视图和重要特征,引用[2]中的配置文件和后台运行命令,要在回答中适当引用这些内容,比如在架构设计和配置说明部分。同时要使用正确的LaTeX格式,比如变量用$符号包裹,确保格式正确。还要用中文回答,结构清晰,分点说明。</think>### Ruoyi 微服务架构解析 #### 一、架构设计 Ruoyi-cloud采用标准Spring Cloud微服务架构,包含以下核心组件: 1. **注册中心**:基于Nacos实现服务注册与发现,服务启动时向Nacos注册实例信息[^1] 2. **配置中心**:通过Nacos统一管理所有微服务的配置,支持动态刷新 3. **API网关**:使用Spring Cloud Gateway实现路由转发和权限过滤 4. **服务保护**:集成Sentinel实现流量控制和服务熔断 5. **监控系统**:通过Spring Boot Admin实现服务监控 典型架构分层: $$ \begin{cases} \text{网关层} & \text{(Gateway)} \\ \text{业务层} & \text{(System/Gen/Job)} \\ \text{支撑层} & \text{(Auth/Common)} \\ \text{基础设施} & \text{(Nacos/Redis/MySQL)} \end{cases} $$ #### 二、模块划分 | 模块名称 | 功能说明 | 核心技术 | |----------------|------------------------------|------------------------| | ruoyi-gateway | API网关 | Spring Cloud Gateway | | ruoyi-auth | 认证中心 | OAuth2.0 | | ruoyi-system | 系统管理核心业务 | MyBatis-Plus | | ruoyi-gen | 代码生成器 | Velocity模板引擎 | | ruoyi-job | 分布式任务调度 | XXL-JOB | | ruoyi-monitor | 系统监控 | Spring Boot Admin | #### 、源码结构 主要子项目结构: ``` ruoyi-cloud ├── ruoyi-common # 公共模块 ├── ruoyi-gateway # 网关服务 ├── ruoyi-auth # 认证服务 ├── ruoyi-system # 系统模块 ├── ruoyi-gen # 代码生成 ├── ruoyi-job # 定时任务 └── ruoyi-visual # 可视化模块 ``` #### 四、配置说明 1. **环境配置**(以ruoyi-system-dev.yml为例): ```yaml spring: datasource: url: jdbc:mysql://localhost:3306/ry-cloud?useSSL=false username: root password: 123456 redis: host: localhost port: 6379 ``` 2. **Nacos配置**: ```bash nacos: discovery: server-addr: 127.0.0.1:8848 config: file-extension: yml ``` 3. **服务启动命令**: ```bash nohup java -jar ruoyi-gateway.jar > gateway.log & nohup java -jar ruoyi-auth.jar > auth.log & ``` #### 五、部署流程 1. 克隆代码库 2. 初始化数据库(执行SQL脚本) 3. 启动Nacos服务 4. 按顺序启动核心服务: ``` Gateway → Auth → System → 其他模块 ``` 5. 访问管理后台:`http://localhost:8080`
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

苍煜

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

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

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

打赏作者

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

抵扣说明:

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

余额充值