当前位置:网站首页>Use of idea plug-in EASYCODE
Use of idea plug-in EASYCODE
2022-06-22 05:56:00 【xiaozhuxuejava】
idea plug-in unit Easy Code Simple use
Preface : We know mybatis-plus Have your own code generation template , But some versions need to introduce code and... Every time maven rely on , It may be inconvenient for people at this time , So we can use idea A plug-in for Easy Code
1. Easy Code Download plug-ins
We are directly in the idea Of plugins Download from the plug-in Market


2. EasyCode Template configuration
The specific steps are Settings ->Other Settings ->Easy Code ->Template

First, we can configure some templates , Here are some templates I usually use
2.1 entity Entity class template
## Import macro definition
$!{
define.vm}
## Save the file ( Macro definition )
#save("/entity", ".java")
## Package path ( Macro definition )
#setPackageSuffix("entity")
## Automatically import packages ( Global variables )
$!{
autoImport.vm}
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
## Table annotation ( Macro definition )
#tableComment(" Table entity class ")
@SuppressWarnings("serial")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("$!{tableInfo.obj.name}")
public class $!{
tableInfo.name} {
#foreach($column in $tableInfo.pkColumn)
#if(${
column.comment})//${column.comment}#end
@TableId
private $!{
tool.getClsNameByFullName($column.type)} $!{
column.name};
#end
#foreach($column in $tableInfo.otherColumn)
#if(${
column.comment})//${column.comment}#end
private $!{
tool.getClsNameByFullName($column.type)} $!{
column.name};
#end
}
2.2 mapper Interface templates
## Import macro definition
$!{
define.vm}
## Set table suffix ( Macro definition )
#setTableSuffix("Mapper")
## Save the file ( Macro definition )
#save("/mapper", "Mapper.java")
## Package path ( Macro definition )
#setPackageSuffix("mapper")
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
## Table annotation ( Macro definition )
#tableComment(" Table database access layer ")
public interface $!{
tableName} extends BaseMapper<$!tableInfo.name> {
}
2.3 service Interface templates
## Import macro definition
$!{
define.vm}
## Set table suffix ( Macro definition )
#setTableSuffix("Service")
## Save the file ( Macro definition )
#save("/service", "Service.java")
## Package path ( Macro definition )
#setPackageSuffix("service")
import com.baomidou.mybatisplus.extension.service.IService;
## Table annotation ( Macro definition )
#tableComment(" Table service interface ")
public interface $!{
tableName} extends IService<$!tableInfo.name> {
}
2.4 serviceImpl Implement class templates
## Import macro definition
$!{
define.vm}
## Set table suffix ( Macro definition )
#setTableSuffix("ServiceImpl")
## Save the file ( Macro definition )
#save("/service/Impl", "ServiceImpl.java")
## Package path ( Macro definition )
#setPackageSuffix("service.Impl")
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
## Table annotation ( Macro definition )
#tableComment(" Table service implementation class ")
@Service("$!tool.firstLowerCase($tableInfo.name)Service")
public class $!{
tableName} extends ServiceImpl<$!{
tableInfo.name}Mapper, $!{
tableInfo.name}> implements $!{
tableInfo.name}Service {
}
3. EasyCode Basic use of
3.1 idea Connect to database
- find Database
- Click on the top left +
- choice Data Source
- choice MySQL

- Improve your database information
Database Is your data name
User It's your database user name
Password It's your code

At the same time, we should pay attention to the MySQL Driver, When we first connected to the database idea May prompt us to download
MySQL Driver , We are in accordance with the idea You can download the prompt directly

- test Test Connection
appear Successful It means that we have successfully connected


3.2 For official use


- Package It's the name of the bag
- Path It's the path
- RemovePre Is a prefix that can be removed from the table
- Template It is the template we configured before , Just choose what we need
边栏推荐
- Trigger
- 非传递骰子(春季每日一题 51)
- Understanding of C pointer
- QEMU ARM interrupt system architecture 2
- Learning method 3 for promotion of large enterprises: chain learning method
- 微信小程序开发 第一周:页面设置、页面跳转、数据绑定
- 时序构成的测试平台
- An unordered array of N integers. Find the first number after each element that is larger than it. The time complexity is O (n)
- Redis connection error: err client send auth, but no password is set 2 solutions
- Grabcut analysis
猜你喜欢

Independent station optimization list - how to effectively improve the conversion rate in the station?

微信小程序开发 第一周:页面设置、页面跳转、数据绑定

vscode 远程连接错误:Server status check failed - waiting and retrying

Ethernet communication protocol

Key points of Facebook account "unsealing, anti sealing and maintaining ID" have been collected!

电脑卡顿怎么办?

数据的存储(进阶)

nacos server 源码运行实现

Data storage (Advanced)

I2C接口
随机推荐
RGB及sRGB与XYZ坐标转换
Analysis report on market demand trend and investment prospect of global and Chinese pulse transistor industry 2022-2027
Development prospect forecast and investment strategy analysis report of global and Chinese manganese oxide nano powder industry 2022-2028
北峰助力南昌市应急管理局打造公专融合应急通信保障网
为Cortex-M4编写优化的DSP代码
Signal output library
vscode极简安装教程
线性回归:最小二乘、泰尔森估计、RANSAC
Development forecast and investment risk outlook report of China's GaAs industry during the 14th Five Year Plan period 2022-2027
The first week of wechat applet development: page setup, page Jump and data binding
数据的存储(进阶)
I2C interface
n个整数的无序数组,找到每个元素后面比它大的第一个数,要求时间复杂度为O(N)
Compréhension du pointeur C
nacos server 源码运行实现
以太网UDP帧发包设计
vscode 远程连接错误:Server status check failed - waiting and retrying
Implementation of Nacos server source code
Hide symbol of dynamic library
Go language uses zap log Library