If you add a new module according to the framework

The first step is to build the database first, import the Ruoyi front-end code generator, generate a zip compressed file, download and decompress it, and run the sql file in the file in Navicat in the ry database to generate relevant data in the menu table.

The second step, 1. Create a new module with the name of the function name

  1. Configuration Environment

①If you add the dependencies of the new module to the pom.xml of the main file

   <dependency>

       <groupId>com.ruoyi</groupId>

       <artifactId>New module name<artifactId>

       <version>$rouyi.version</version>

</dependency>

            ②Add new module dependencies in pom.xml in the ruoyi-admin module

Among them, com.ruoyi and ruoyi-common may become popular, just add them outside <dependencies></dependencies>

<dependencyManagment></dependencyManagement> will not

<dependency>

       <groupId>com.ruoyi</groupId>

       <artifactId>New module name<artifactId>

       <version>$rouyi.version</version>

</dependency>

③The automatic code will use the content in ruoyi-common, so add the dependency of the common module in the pom.xml of the new module

<dependencies>

      <dependency>

       <groupId>com.ruoyi</groupId>

       <artifactId>ruoyi-common</artifactId>

</dependency>

</dependencies>

④Copy the student file in the main/java/com/ruoyi directory in the downloaded file to src/main/java/com.ruoyi under the ruoyi-admin module

⑤ Copy the mapper file in main/resources in the next file into ruoyi-admin and put it into resources

The third step is to copy the code files to the project

①Backend code

Copy the com file in main/java in the downloaded file to the java file of the new module

②Front-end code

Copy the api file in vue and the student file in views of the downloaded file to ruoyi-ui respectively.

Go to the api file and views file

After completion, restart the front-end and back-end of Ruoyi

New module added successfully

The fourth step is to add functions to the front end

①Add menu in menu management

The routing address is the new module name

②Create new menu

Finish!

Guess you like

Origin blog.csdn.net/m0_57665268/article/details/129536808