Introduction to Quickly - Code - Toolkit
Quickly - Code - Toolkit is a tool based on the Idea code - development IDE, which realizes the functions of [quick code generation] and [assisted SQL statement generation]. Code - Toolkit can assist us in development by quickly [creating files such as controller.java, provider.java, service.java, dao.java, and mapper.xml], quickly writing methods into [controller.java, provider.java, service.java, dao.java, mapper.xml, etc.], and rapidly [generating ALTER statements for adding fields to a class or CREATE TABLE statements for a class], thus improving efficiency and enabling us to focus more on business - logic code development. You can search for [Quickly - Code - Toolkit] in the Idea marketplace.
Instructions for Using Code - Toolkit
I. Global Settings
1. Paging Wrapper Setting (Paging Settings)
Explanation 1: It is mainly used for writing methods and serves as a paging wrapper class for return parameters.
Explanation 2: The setting method is the fully qualified name of the paging wrapper class: com...Page.
Explanation 3: Example of return parameter - public Page testMethod(){}
2. View Wrapper Setting (Return Front - End Page Parameter Wrapper Settings)
Explanation 1: It is mainly used for writing methods and is a wrapper class for parameters returned to the front - end page.
Explanation 2: The setting method is the fully qualified name of the return front - end parameter wrapper class: com...CommonResponse.
Explanation 3: Example of return parameter: public CommonResponse testMethod(){}
3. ORM Framework (orm Framework Settings)
Explanation 1: It is mainly used for selecting file - creation templates for dao.java, service.java, and serviceImpl.java files. The file - creation templates for Mybaits and Mybatis - plus are different.
4. Remote Invocation Framework (Remote Invocation Settings)
Explanation 1: It is mainly used for selecting templates during file creation and writing methods.
Explanation 2: The Dubbo Framework is mainly for creating provider files and writing methods into provider files.
Explanation 3: Openfeign is mainly used for creating Controller files and writing methods into controller files.
II. Creation of Business - Logic Files
Explanation 1: The parent directory of the business - logic file directory is based on the directory of the SpringApplication. For example, if the directory of SpringApplication is /src/java/com/test, then the directory of Entity is: /src/java/com/test/entity/Entity.
Explanation 2: The mapper.xml file is created under the resources directory, and the default file directory is mapper. For example, src/resources/mapper//EntityMapper.xml.
Explanation 3: The way to create files from the database source table structure includes creating entity.java, mapper.xml, dao.java, service.java, serviceImpl.java, controller.java, or provider.java (for Dubbo) files.
Explanation 4 - Steps for [Creating Files from the Database Source Table Structure]:
a. Select the database in the Idea side navigation bar.
b. Select the table structure, such as the activity table.
c. Right - click and select the [Database To Business Logic] button.
Explanation 5: The scope of business - logic files created from an entity class includes mapper.xml, dao.java, service.java, serviceImpl.java, controller.java, or provider.java (for Dubbo) files.
Explanation 6 - Steps for [Creating Business - Logic Files from an Entity Class]:
Method 1:
a. In the left - hand side project directory.
b. Select the entity class for which you want to create business - logic files.
c. Right - click and select the [Entity To Business Logic] button.
Method 2:
a. Select within the code of the entity class for which you want to create business - logic files.
b. Right - click and select the [Entity To Business Logic] button.
III. Business - Logic Methods
Explanation 1: Methods are written into files such as mapper.xml, dao.java, service.java, serviceImpl.java, controller.java, or provider.java (for Dubbo).
Explanation 2: Methods are automatically written into dao.java, service.java, and serviceImpl.java. For controller or provider (Dubbo) files, it depends on the [Remote Invocation Framework] to decide whether to write into the controller or provider. Writing into mapper.xml depends on whether an xml method is selected.
Explanation 3: The paging of methods and the packaging of return - page parameters are set respectively in Paging Wrapper Setting (Paging Settings) and View Wrapper Setting (Return Front - End Parameter Wrapper Settings).
Explanation 4: It supports writing methods starting from files such as dao.java, service.java, serviceImpl.java, controller.java, or provider.java (for Dubbo) to other files. For example, when writing a method in the mapper.java file, it will also write to mapper.xml, service.java, serviceImpl.java, controller.java, or provider.java (for Dubbo) files.
Explanation 5 - Steps for Use: In mapper.xml, dao.java, service.java, serviceImpl.java, controller.java, or provider.java (for Dubbo) files, right - click [Method To Business Logic] and select the required parameters.
IV. SQL Assistant Functions
Explanation 1: The SQL assistant functions are used to generate ALTER statements for adding fields to an entity class and CREATE TABLE statements for adding an entity class to generate a table structure.
Explanation 2: Since Java data types and MySQL data types do not have a one - to - one correspondence, only a basic general correspondence can be achieved. For example, for a status (1\2\3) that uses Integer in Java, the generated MySQL SQL statement uses the int type for reception, and the tinyint type in MySQL cannot be used. If you want to change the type, it needs to be modified manually.
Explanation 3 - Steps for [Generating ALTER Statements for Table Structure Fields]:
a. Select the field for which you want to generate the ALTER statement.
b. Right - click and select the [Class Member To SQL] button.
Explanation 4 - Steps for [Generating CREATE TABLE Statements for Table Structure]:
Method 1:
a. In the left - hand side project directory.
b. Select the entity class for which you want to create business - logic files.
c. Right - click and select the [Class To SQL] button.
Method 2:
a. Select within the code of the entity class for which you want to create business - logic files.
b. Right - click and select the [Class To SQL] button.
EMAIL: sunflower.on.sun@gmail.com
github issue:γhttps://github.com/little-kelp/code-toolkitγ
QQ Group: 1030094275
Odd - numbered versions are for Idea version 242.* and below. Even - numbered versions are for versions above 242. (excluding 242.)
Top comments (0)