当前位置:网站首页>Simple use of idea plug-in easy code
Simple use of idea plug-in easy code
2022-06-22 05:57:00 【xiaozhuxuejava】
idea plug-in unit Easy Code Simple use
This blog uses github Picture bed , Maybe pictures sometimes load slowly , If the picture fails to load, go to
https://blog.csdn.net/qq_54650406/article/details/124955763?spm=1001.2014.3001.5501
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 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

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
边栏推荐
- MinGW download and installation
- EPP (Enhanced Parallel Port 增强型并口)
- Implementation of lazy loading of pictures (summary and sorting)
- [soft test] senior system architecture designer learning experience sharing
- Go language uses JWT
- 數據的存儲(進階)
- 常用CMOS模拟开关功能和原理
- Learning method 4 for promotion of big factories: play learning method
- 性能优化最佳实践之缩减游戏大小
- AUTOSAR from getting started to mastering 100 lectures (150) -soa architecture and Application
猜你喜欢

D3D10 截图功能 保存Texture到本地

线性回归:最小二乘、泰尔森估计、RANSAC

TCP连接细节问题

The first week of wechat applet development: page setup, page Jump and data binding

Delete the packaging use of pop-up components

格雷码与二进制的转换

性能优化 之 3D资产优化及顶点数据管理

自控原理之系统辨识

常用CMOS模拟开关功能和原理

Machine learning Note 6: number recognition of multiple classification problems in logistic regression
随机推荐
P1061 [noip2006 popularization group] counting method of jam
RGB及sRGB与XYZ坐标转换
CLion安装下载
vscode极简安装教程
Development prospect and investment potential prediction report of China's rare earth permanent magnet industry during the "14th five year plan" period 2022-2027
Why is "CPS alliance marketing" the most cost-effective promotion method?
Academic circle of cattle II (daily question 49 in spring)
C指針的理解
Implementation of Nacos server source code
Working method: 3C scheme design method
Dos Bat 语法记录一
idea插件Easy Code的简单使用
以太网UDP帧发包设计
Serial port (RS - 232)
PID笔记
服务器php相关网页开发环境搭建
性能优化 之 3D资产优化及顶点数据管理
vcpkg:If you are sure you want to rebuild the above packages, run the command with the --recurse opt
Golang Viper库入门教学
Development prospect forecast and investment strategy analysis report of global and Chinese manganese oxide nano powder industry 2022-2028