Product Introduction
Code-Toolkit is a practical tool developed based on IntelliJ IDEA, integrating functions of rapid code generation and SQL statement auxiliary generation. It can quickly create various files such as controller.java, provider.java, and service.java, and rapidly write methods into the corresponding files. Additionally, it can generate SQL ALTER and CREATE TABLE statements based on class definitions, enabling developers to focus on business logic development.
Usage Instructions
Global Settings
Paging Wrapper Setting: Used for paging wrapping of return parameters when writing methods. You need to set the fully qualified name, for example, com...Page. Example: public Page testMethod(){}.
View Wrapper Setting: This is the wrapper class for parameters returned to the front - end page when writing methods. Set the fully qualified name, such as com...CommonResponse. Example: public CommonResponse> testMethod(){}.
ORM Framework Setting: Used for template selection when creating dao.java, service.java, and serviceImpl.java files. The templates for MyBatis and MyBatis - Plus are different.
Remote Invocation Framework Setting: Used for template selection when creating files and writing methods. Dubbo is used to create provider files and write methods; OpenFeign is used to create Controller files and write methods.
Creation of Business Logic Files
Directory Rules: The parent directory of business logic files is based on the SpringApplication directory. The mapper.xml file is created in the resources/mapper directory.
Creation Methods:
Creation from Database Source Table Structure: Select the table structure in the database section of the IDEA navigation bar, then right - click and select 【Database To Business Logic】.
Entity Class Creation: You can select an entity class in the left - hand project directory or within the entity class code, then right - click and select 【Entity To Business Logic】.
Writing Business Logic Methods
Writing Scope: Supports various files such as mapper.xml and dao.java.
Writing Rules: For files like dao.java, the methods are written automatically. For controller or provider, the selection is based on the remote invocation setting. For mapper.xml, the writing depends on whether the XML method is selected.
Usage Steps: Right - click on the corresponding file and select 【Method To Business Logic】, then select the parameters.
SQL Auxiliary Functions
Function Purpose: Generate ALTER statements for newly added fields in an entity class and CREATE TABLE statements for newly added entity classes.
Type Correspondence: Java data types generally correspond to MySQL data types. Special types need to be manually modified.
Usage Steps:
Generate ALTER Statements: Select a field, right - click, and select 【Class Member To SQL】.
Generate CREATE TABLE Statements: You can select an entity class in the left - hand project directory or within the code, then right - click and select 【Class To SQL】.
Contact Information
GitHub Issue: GitHub - little - kelp/code - toolkit
Email: sunflower.on.sun@gmail.com
QQ Group: 1030094275
Top comments (0)