The source address
Github.com/javanan/sli…
slife
Spring Boot builds an enterprise-class rapid development scaffolding.Copy the code
Technology stack
- Spring Boot
- MySQL
- Freemark
- SiteMesh
- Shiro
- Bootstrap
- Mybatis, mybatisPlus
- redis
- Activiti
Coding conventions
The system is divided into controller, Service and DAO layers. Controller is mainly responsible for forwarding, Service is mainly responsible for business logic, and DAO is mainly for database operations.
File name Convention
In the page folder, set up different folders to store pages according to the function modules. For example, the user’s page is placed in the User folder, while the role’s is placed in the Role folder.
- If the page is a list type. The file name of the page is list.ftl.
- If the page is of the detail type. The file name of the page is detail.ftl.
Controller, Service, and DAO method name conventions
- If you are adding data, prefix it with insert.
- For delete operations, prefix delete with delete
- For modification operations, prefix them with update
- Use select as prefix for query operations
Database read/write separation
Cache ecache and redis
The new module
- new Module
- GroupId —>com.slife
- ArtifactId– > slife- Module name like slife-activiti
- Version –> Version number such as 1.0SNAPSHOT
- Module-name –> slife- The Module Name is slife-activiti
- Submit a new module
- Pom files are imported
<name>slife </name> <dependency> <groupId>com.slife</groupId> <artifactId>slife </artifactId> </dependency> . . . Other dependencies. </dependencies>Copy the code
JDK version 1.8
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> The < version > 3.6.1 < / version > < configuration > <source> 1.8 < /source> <target>1.8</target> <encoding>UTF-8</encoding> <arg>-parameters</arg> </compilerArgs> <useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
</plugins>
</build>
Copy the code
Create a function module
1. Create a database
2. Create entity class
Create the service class
Create the Controller class
5. Create a list interface
5.1 Copy the code to another list over 5.2 Modify <script> var url ="${base}/sys/user/"; The URL in </script> is the controller class @controller@requestMapping (value =) that you just created"/sys/user") public class SysUserController extends BaseController {@requestMapping (value ="/sys/user"The current search criteria are /** * = */ public static final String SEARCH_EQ="search_eq_"; Public static final String SEARCH_LLIKE="search_llike_"; Public static final String SEARCH_RLIKE="search_rlike_"; /*** * full blur */ public static final String SEARCH_LIKE="search_like_";
<input type="text" class="form-filter input-sm _search" name="search_eq_login_name"> Add the search_eq_ prefix to the name of the input and add the name of the field in the databaseCopy the code
Project Screenshot Introduction
System User Management
System Menu Management
System Role Management
RBAC permission management modelCopy the code
Log monitoring
System custom annotations, combined with AOP, monitor user action behaviorCopy the code
Spring Boot Admin monitoring
[Img-erd7CAOP -1577440125214)(YA)]
Activit workflow
The API documentation
SwaggerUi Interface document displayCopy the code
Database Monitoring
Use druid to monitor database health. Originally there were three data sources, using AOP to dynamically write switches. Did not upload to Git, students who need to private meCopy the code
Maven builds multi-module development
According to different business, do not develop in different business modules, if the basic user, organization, etc management in sys module log business logic in the log moduleCopy the code
Pluggable deployment packages different modules into JARS, and the corresponding freemark files are packaged into the corresponding module JARS. The function module can be pluggable deployment.