Hello, I’m Xiaofu~
Recently, I came into contact with a new project and found that it used an interesting framework, which can be said to realize my dream when I first entered the industry, so I keep sharing it with you.
I haven’t separated the front and back end of the projects I just started working with. I often need the back end to maintain the page. Sometimes I feel that I’m not suitable for the front end. If you let me study the back-end technology, look at the middleware source code, and analyze the underlying principle of the framework, it’s not a big problem. I do it occasionally
JSit’s fine too. If you let me write a
cssStyle, that’s terrible. I’m not interested at all. I don’t know if it’s the same as me.
There is no need to write a page for the framework to be introduced today. Let’s go straight to the topic below
EruptA general background management framework is said to haveUltra low code volume、 Zero front end code、Zero curd operation、There is no need to create a table，Pure Java annotation developmentIt is claimed that a complete background management system can be built in three minutes.
Er ~ it sounds like a lot of criticism. Is it so magical? Let’s use it together and feel it.
First, let’s build an environment. At present
application.ymlAs long as you simply configure the data source, prepare a database in advance. When it comes to the database, I’ll say a little episode.
I was in
GithubWhen submitting case code（
https://github.com/chengxy-nds/Springboot-Notebook）, because I didn’t pay much attention to the sensitive information, the cloud database account was leaked. Recently, I found that a small partner had run a project on the database. I looked carefully at the data structure inside and found that it looked like a completed project.
The library itself is me
demoA test library of cases is designed to enable small partners to spend more time on the technical points of studying cases and reduce the trivial matters of building an environment without technical content.
I found that I didn’t change my password or delete their library here. If you want to use it, you can continue to use it, but play it, make it, make it,You can’t move. It’s not your data！ It’s not good to affect others’ study.
spring: datasource: url: jdbc:mysql://18.104.22.168:3306/erupt2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root password: 123456 jpa: show-sql: true generate-ddl: true database-platform: org.hibernate.dialect.MySQL5InnoDBDialect database: mysql profiles: active: dev mail: username: [email protected] password: xxxxxxx host: smtp.qq.com properties: mail.smtp.ssl.auth: true mail.smtp.ssl.enable: true mail.smtp.ssl.required: true server: port: 8888
A little digression, let’s continue~
EruptThe environment is finished, eh ~, is it finished?
We haven’t done anything. The project is an empty shell. We haven’t written a line of code. It seems that we haven’t even built a table!
Don’t worry. Let’s start the project first and see that many table creation and insertion statements are printed on the console because
EruptFramework underlying application
JPAFor persistence, the preset creates some system tables and data.
EruptThe preset table will only be built once when the project is started for the first time. If you want to recreate it, you need to delete it
.EruptFile (usually in the workspace of the project), how to obtain the file location
Look at the 16 system tables created in the database, including
e_upms_userTable is a user table. By default, there is only one administrator account, and the user name and password are
Then we visited
http://127.0.0.1:8888/, let’s see what the effect is. There is a complete login page.
Log in directly with the user name and password above,
eruptThe complete permission control and other functions have been realized in advance, and we have hardly written any code here. They are all encapsulated by the framework. All menu data are dynamically obtained from the database, and a basic background management system is built. It’s a little wow.
So here comes the question…? What if you want to customize the page?
We said it at the beginning
eruptZero front-end code, all based on
JavaAnnotation development, next use
JavaNotes to write a simple page experience.
eruptThere are two core annotations
@EruptAnnotation modifier class, representing the definition of a page
@EruptFieldAnnotation modifies the field, representing the field name displayed on the page
@PowerAnnotation controls whether to operate buttons, such as add, delete, modify, query, import, export, etc
@SearchAnnotation indicates that the field is a search condition
@TableAnnotation indicates that the page takes the table corresponding to the data. If it is not set, a table name consistent with the class name will be automatically created according to the class field value when the page is initialized for the first time.
There are a lot of annotation types. I won’t list them one by one. I’ll go to the official website to see more:
Next, we define a
@EruptFieldAnnotation, so that even if the pages and elements are finished, is it a bit subversive.
However, the newly created page will not be displayed at this time. We need to manually make a mapping relationship and customize a menu in menu maintenance,Type valueBe sure to create a newClass name
After saving and refreshing, we will see that our new page appears, and the function of the page is very complete. The basic operation, query, import and export functions are automatically realized.
A new student information is added to the page, corresponding to
StudentThe table also has more records, and the persistence process is completely done by the framework.
EruptThe framework deeply encapsulates the front and back-end code, but it provides rich and flexible user-defined interfaces to meet our personalized needs.
For example, when we enter new student information, we want to block the name as
Zhang SanYou can act as an agent for the page button function
dataProxyTo implement custom logic, you can implement the corresponding method for which button agent, such as
afterAddIs a proxy for the new button.
When we enter the name as
Zhang SanWhen the students successfully shielded. There are many other similar functions, not one by one. Look at the documents~
If we want to develop the interface in the traditional way, we don’t have to worry about it
EruptThe page generation rules of are in conflict and will not be affected at all. and
JPA, off the shelf
daoInterface, just call the corresponding API to start development.
If you don’t want to write
JavaThe code doesn’t matter,
EruptIt also provides a code generator to customize
JavaClass name and field name can generate code directly
Speaking of this, I only introduced
EruptThe basic feature of yidui is mainly to let the little partner know that there is such an agile weapon.
Not only that, it also supports rich data types and built-in timing
Multi table joint query、
Front and rear end separation deployment、
Multiple data sources、
Black and white listAnd many other practical functions can be used by directly calling the API.
Say in the back
EruptThe advantages of the framework are obvious, fast, efficient, easy to use, and very friendly to novices. However, in the actual production environment, I just use it to do some data management of configuration dictionary.
Because its deep encapsulation makes development simple and efficient, but for systems with relatively complex business and highly customized,
EruptThe framework is inadequate. More importantly, its community is not particularly active. After all, it is a niche framework.
However, technology has always served the business, if your business and
EruptMatch your temperament. Don’t hesitate to use it!
Hundreds of various technical e-books were sorted out and sent to our friends. Pay attention to the official account.Something inside the programmer】Reply【666】Collect by yourself. We have set up a technical exchange group with some partners to discuss technology and share technical materials, so as to learn and progress together. If you are interested, join us!
This work adoptsCC agreement, reprint must indicate the author and the link to this article