A list,
1.1 an overview of the
Xxl – Code Generator is a “controller/service/dao/mybatis/model” layers of Code generation platform. Just provide the SQL and all the code will be generated automatically.
1.2 features
- 1, simple: interface operation, simple and intuitive, can be used quickly;
- 2, lightweight: only need to provide table building SQL, can automatically complete code generation, simple and efficient;
- 3, multi-layer code generation: automatically generated “controller/service/dao/mybatis/model” multilayer code, all involved in the development process;
- 4, efficient: from SQL to API interface, all code support automatic generation, greatly improve productivity and efficiency;
- 5, online preview: after code generation, support real-time online preview, directly copy use;
1.3 download
The document address
- Chinese document
Source repository address
Source repository address | Release Download |
---|---|
Github.com/xuxueli/xxl… | Download |
Gitee.com/xuxueli0323… | Download |
Technical communication
- Community communication
1.4 environment
- The JDK: 1.7 +
Quick start
Step 1: Compile the project
The project directory structure is as follows:
-xxl-code-generator-xxl-code-generator-core: indicates the core dependency for code generation and performs OPERATIONS such as SQL parsing. -xxl-code-generator-admin: indicates a code generation platform. To use this platform, you only need to deploy the project.Copy the code
Step 2: Prepare the SQL
Code generation, is based on the database table for dimension generation. Therefore, you need to have table SQL scripts ready to generate code. Then enter the code generation platform, fill in the SQL script to build a table into the “table structure information” input box. (Default has provided a reference to the Demo table SQL script, you can experience the operation)
Step 2: Generate code
Click the “Generate code button” in the upper right corner to generate a complete multi-layer code, which is very convenient;
Step 3: Finish
Code generation, can be used in the interface to view and “controller/service/dao/mybatis/model” multi-layer source code. Some screenshots are as follows:
Iii. Overall design
Design idea
slightly
ReturnT
Unifying the data type returned by interfaces is beneficial for interface interconnection and efficiency improvement. Therefore, the generated multi-layer code interaction, using unified ReturnT, the source code is as follows:
import java.io.Serializable;
/**
* common return
* @author xuxueli 2015-12-4 16:32:31
*/
public class ReturnT<T> implements Serializable {
public static final long serialVersionUID = 42L;
public static final int SUCCESS_CODE = 200;
public static final int FAIL_CODE = 500;
public static final ReturnT<String> SUCCESS = new ReturnT<String>(null);
public static final ReturnT<String> FAIL = new ReturnT<String>(FAIL_CODE, null);
private int code;
private String msg;
private T data;
public ReturnT(int code, String msg) {
this.code = code;
this.msg = msg;
}
public ReturnT(T data) {
this.code = SUCCESS_CODE;
this.data = data;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) { this.data = data; }}Copy the code
Version update log
Version V0.0.1, new features [2018-05-03]
- 1, simple: interface operation, simple and intuitive, can be used quickly;
- 2, lightweight: only need to provide table building SQL, can automatically complete code generation, simple and efficient;
- 3, multi-layer code generation: automatically generated “controller/service/dao/mybatis/model” multilayer code, all involved in the development process;
- 4, efficient: from SQL to API interface, all code support automatic generation, greatly improve productivity and efficiency;
- 5, online preview: after code generation, support real-time online preview, directly copy use;
TODO LIST
- 1. Multi-template support: the current template is “SpringMVC + Mybatis + Mysql” technology stack; Plans to add different code generation templates;
- 2, extension, multilayer: at present, the support generated “controller/service/dao/mybatis/model” layer code. Plan to add front-end code, such as “jquery, vuejs, React “, etc.
Five, the other
5.1 Project Contribution
Welcome to contribute to the project! Such as submitting PR to fix a bug, or creating an Issue to discuss new features or changes.
5.2 User Access Registration
More access companies are welcome to register at the registration address, registration only for product promotion.
5.3 Open Source Agreements and Copyrights
The product is open source and free, and will continue to provide free community technical support. Free access and use within individuals or enterprises.
- Licensed under the GNU General Public License (GPL) v3.
- Copyright (c) 2015-present, xuxueli.
donation
No matter how much is enough to show your love, thank you very much 🙂 to donate