Mybatis Plus自动生成代码

article/2025/11/10 2:51:01

mybatis-plus自动生成代码

  • 一、简易生成代码
  • 二、指定生成的样式,并且不在一个模块
    • 1.父pom文件配置
    • 2.子模块pom文件配置
    • 3.准备vm文件
    • 4.设置MyBatisPlusGenerator.java
    • 5.运行MyBatisPlusGenerator.java文件
    • 6.运行sign-auth模块,解决异常

一、简易生成代码

/*** 代码生成器* @since 2022-03-21*/
public class MpCode {public static void main(String[] args) {generate();}private  static  void generate(){FastAutoGenerator.create("jdbc:mysql://127.0.0.1:3306/life-sign?serverTimezone=UTC", "root", "root").globalConfig(builder -> {builder.author("lh") // 设置作者/*.enableSwagger() */// 开启 swagger 模式.fileOverride() // 覆盖已生成文件.outputDir("E:\\IDEA_MY\\life-sign\\sign-common\\sign-code\\src\\main\\java"); // 指定输出目录  和自己项目src一一对应}).packageConfig(builder -> {builder.parent("com.luck.sign") // 设置父包名.moduleName(null) // 设置父包模块名  解决路径冲突.serviceImpl("service.impl") //自定义包名imp 官方的是impi.entity("entity") //设置实体包为pojo.pathInfo(Collections.singletonMap(OutputFile.mapperXml, "E:\\IDEA_MY\\life-sign\\sign-common\\sign-code\\src\\main\\resources\\mapper")); // 设置mapperXml生成路径}).strategyConfig(builder -> {builder.entityBuilder().enableLombok();//使用lombokbuilder.controllerBuilder().enableHyphenStyle().enableRestStyle();//开启RestControllerbuilder.addInclude("sign_tag"); // 设置需要生成的表名})
//                  .templateEngine(new VelocityTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板.execute();}
}

在这里插入图片描述

二、指定生成的样式,并且不在一个模块

在这里插入图片描述

1.父pom文件配置

我是在父pom文件里进行的依赖管理

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.luck</groupId><artifactId>life-sign</artifactId><version>1.0-SNAPSHOT</version><modules><module>sign-auth</module><module>sign-common</module><module>sign-work</module></modules><!--    打包方式 pom--><packaging>pom</packaging><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target></properties><dependencyManagement><dependencies><!--swagger本身不支持spring mvc的,springfox把swagger包装了一下,让他可以支持springmvc--><!-- swagger-ui --><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger-ui</artifactId><version>2.9.2</version></dependency><!-- swagger2 --><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>2.9.2</version></dependency><!--spring cloud Hoxton.SR1--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Hoxton.SR1</version><type>pom</type><scope>import</scope></dependency><!--spring boot 2.2.2--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>2.2.2.RELEASE</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.27</version></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.1.4</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.1</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.1.23</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.13</version><scope>test</scope></dependency><!--      lombok 包含了lombok.extern.slf4j.Slf4j --><!--      https://blog.csdn.net/xiaozhuangyumaotao/article/details/106009846--><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.22</version></dependency></dependencies></dependencyManagement></project>

2.子模块pom文件配置

父模块管理了依赖,对于父模块里面有的,子模块导入,就不需要写版本号了

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>sign-common</artifactId><groupId>com.luck</groupId><version>1.0-SNAPSHOT</version></parent><modelVersion>4.0.0</modelVersion><packaging>jar</packaging><artifactId>sign-code</artifactId><dependencies><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger-ui</artifactId></dependency><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId></dependency><!-- mybatis plus 代码生成器引擎依赖--><dependency><groupId>org.apache.velocity</groupId><artifactId>velocity</artifactId><version>1.7</version></dependency><!-- mybatis plus 代码生成器依赖 --><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-generator</artifactId><version>3.4.1</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency></dependencies></project>

以上模块的导入,针对mybatis-plus自动生成代码的功能,主要如下几个依赖

<!-- mybatis plus 代码生成器引擎依赖--><dependency><groupId>org.apache.velocity</groupId><artifactId>velocity</artifactId><version>1.7</version></dependency><!-- mybatis plus 代码生成器依赖 --><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-generator</artifactId><version>3.4.1</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId></dependency>

3.准备vm文件

资源链接如下,若下载不了,可留言
mybatis-plus自动生成代码的自定义引擎文件(vm文件)

4.设置MyBatisPlusGenerator.java

用心看,铁子们应该看的懂

package com.luck.sign.util;import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.VelocityTemplateEngine;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.WordUtils;import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;/*** mybatis plus 代码自动生成器* 参考: https://blog.csdn.net/ChunwaiLeung/article/details/121629340*/
public class MyBatisPlusGenerator {private static String module;private static String PACKAGE = "com.luck.sign";private static String AUTHOR = "lh";private static String DATA_USER_NAME = "root";private static String DATA_PASSWORD = "root";private static String DATA_DRIVER_NAME = "com.mysql.cj.jdbc.Driver";private static String DATA_URL = "jdbc:mysql://127.0.0.1:3306/life-sign?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai";private static String PATH_MAPPER  = "/src/main/java/com/luck/sign/";private static String PATH_MAPPER_XML = "/src/main/resources/mapper/";private static String PATH_CONTROLLER = "/src/main/java/com/luck/sign/";private static String PATH_SERVICE = "/src/main/java/com/luck/sign/";private static String PATH_SERVICE_IMP = "/src/main/java/com/luck/sign/";private static String PATH_ENTITY = "/sign-common/sign-code/src/main/java/com/luck/sign/";public static void main(String[] args) {module = "/" + scanner("要输入到哪个项目?");String[] tables = scanner("请输入要生成的表名多个用 , 分割").split(",");for (String table : tables) {shell(table);}}public static String scanner(String someThing) {Scanner scanner = new Scanner(System.in);StringBuilder help = new StringBuilder();help.append("请输入" + someThing + ":");System.out.println(help.toString());if (scanner.hasNext()) {String sc = scanner.next();if ("" != sc && null != sc) {return sc;}}throw new MybatisPlusException("请输入正确的" + someThing + "!");}private static void shell(String table) {// 代码生成器AutoGenerator mpg = new AutoGenerator();// 数据源配置DataSourceConfig dsc = new DataSourceConfig();dsc.setDriverName(DATA_DRIVER_NAME);dsc.setUsername(DATA_USER_NAME);dsc.setPassword(DATA_PASSWORD);dsc.setUrl(DATA_URL);mpg.setDataSource(dsc);// 全局配置final String projectPath = System.getProperty("user.dir"); // 默认定位到的当前用户目录("user.dir")(即工程根目录) https://blog.csdn.net/qq_29964641/article/details/86686585GlobalConfig gc = new GlobalConfig();gc.setAuthor(AUTHOR);//作者名称gc.setDateType(DateType.ONLY_DATE);gc.setOpen(false); //生成后是否打开资源管理器gc.setServiceName("%sService"); //自定义文件命名,注意 %s 会自动填充表实体属性! %s作为占位符gc.setServiceImplName("%sServiceImpl");gc.setMapperName("%sMapper");gc.setXmlName("%sMapper");gc.setSwagger2(true);// 是否开启Swagger2模式gc.setFileOverride(true); //重新生成时文件是否覆盖gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为falsegc.setEnableCache(false);// XML 二级缓存gc.setBaseResultMap(true);// XML ResultMapgc.setBaseColumnList(false);// XML columList
//        gc.setIdType(IdType.ID_WORKER_STR); //主键策略
//        gc.setOutputDir(projectPath + "/src/main/java");
//        gc.setControllerName("%sController");mpg.setGlobalConfig(gc);// 包配置PackageConfig pc = new PackageConfig();pc.setParent(PACKAGE);pc.setMapper("mapper");//daopc.setService("service");//servciepc.setController("controller");//controllerpc.setEntity("entity");
//        pc.setModuleName("model名"); 自定义包名// 自定义配置InjectionConfig cfg = new InjectionConfig() {@Overridepublic void initMap() {
//                //表信息String name = this.getConfig().getStrategyConfig().getColumnNaming().name();}};// 模板引擎是 freemarker// 自定义controller的代码模板// 如果模板引擎是 velocityString templatePath = "/template/Mapper.xml.vm";// 自定义输出配置List<FileOutConfig> focList = new ArrayList<>();// 自定义配置会被优先输出,配置mapper.xmlfocList.add(new FileOutConfig(templatePath) {@Overridepublic String outputFile(TableInfo tableInfo) {//根据自己的位置修改return projectPath  + module + PATH_MAPPER_XML + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;}});//控制层templatePath = "/template/Controller.java.vm";// 自定义配置会被优先输出focList.add(new FileOutConfig(templatePath) {@Overridepublic String outputFile(TableInfo tableInfo) {// 自定义输出文件名 + pc.getModuleName()String expand = projectPath  + module + PATH_CONTROLLER + "controller";String entityFile = String.format((expand + File.separator + "%s" + ".java"), tableInfo.getControllerName());return entityFile;}});//业务层templatePath = "/template/Service.java.vm";// 自定义配置会被优先输出focList.add(new FileOutConfig(templatePath) {@Overridepublic String outputFile(TableInfo tableInfo) {// 自定义输出文件名 + pc.getModuleName()String expand = projectPath  + module + PATH_SERVICE + "service";String entityFile = String.format((expand + File.separator + "%s" + ".java"), tableInfo.getServiceName());return entityFile;}});templatePath = "/template/ServiceImpl.java.vm";// 自定义配置会被优先输出focList.add(new FileOutConfig(templatePath) {@Overridepublic String outputFile(TableInfo tableInfo) {// 自定义输出文件名 + pc.getModuleName()String expand = projectPath  + module + PATH_SERVICE_IMP + "service/impl";String entityFile = String.format((expand + File.separator + "%s" + ".java"), tableInfo.getServiceImplName());return entityFile;}});//数据层templatePath = "/template/Mapper.java.vm";// 自定义配置会被优先输出focList.add(new FileOutConfig(templatePath) {@Overridepublic String outputFile(TableInfo tableInfo) {// 自定义输出文件名 + pc.getModuleName()String expand = projectPath + module +PATH_MAPPER + "mapper";String entityFile = String.format((expand + File.separator + "%s" + ".java"), tableInfo.getMapperName());return entityFile;}});//数据层templatePath = "/template/Entity.java.vm";// 自定义配置会被优先输出focList.add(new FileOutConfig(templatePath) {@Overridepublic String outputFile(TableInfo tableInfo) {// 自定义输出文件名 + pc.getModuleName()String expand = projectPath + PATH_ENTITY + "entity";String entityFile = String.format((expand + File.separator + "%s" + ".java"), tableInfo.getEntityName());return entityFile;}});mpg.setPackageInfo(pc);cfg.setFileOutConfigList(focList);mpg.setCfg(cfg);// 配置模板TemplateConfig templateConfig = new TemplateConfig();// 配置自定义输出模板//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别templateConfig.setService("/template/Service.java.vm");templateConfig.setServiceImpl("/template/ServiceImpl.java.vm");templateConfig.setEntity("/template/Entity.java.vm");templateConfig.setMapper("/template/Mapper.java.vm");templateConfig.setController("/template/Controller.java.vm");//        //此处设置为null,就不会再java下创建xml的文件夹了templateConfig.setXml("/template/Mapper.xml.vm");mpg.setTemplate(templateConfig);// 策略配置StrategyConfig strategy = new StrategyConfig();strategy.setNaming(NamingStrategy.underline_to_camel); // 数据库表映射到实体的命名策略strategy.setColumnNaming(NamingStrategy.underline_to_camel); //数据库表字段映射到实体的命名策略strategy.setEntityLombokModel(true);strategy.setRestControllerStyle(true);strategy.setInclude(table); //table 表名对那一张表生成代码strategy.setControllerMappingHyphenStyle(true);strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
//        strategy.setSuperEntityClass("com.baomidou.ant.common.BaseEntity");
//        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController"); // 公共父类
//        strategy.setSuperEntityColumns("id"); //         写于父类中的公共字段
//        strategy.setTablePrefix("t_");  //生成实体时去掉表前缀
//        strategy.setRestControllerStyle(true); //restful api风格控制器
//        strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符mpg.setStrategy(strategy);mpg.setTemplateEngine(new VelocityTemplateEngine());//默认模板引擎mpg.execute();}/*** 表名转换成Java类名*/private String tableToJava(String tableName, String tablePrefix) {if (StringUtils.isNotBlank(tablePrefix)) {tableName = tableName.replaceFirst(tablePrefix, "");}return columnToJava(tableName);}/*** 列名转换成Java属性名*/public String columnToJava(String columnName) {return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", "");}
}

5.运行MyBatisPlusGenerator.java文件

在这里插入图片描述
在这里插入图片描述

6.运行sign-auth模块,解决异常

问题:
因为在MyBatisPlusGenerator.java 的全局参数配置重开启了swagger,但是模块并没有引入相关依赖
解决:
1.因为其他模块都会引入sign-code模块,所以在sign-code模块里引入
2.配置swagger.config,否则swagger不能正常访问<dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger-ui</artifactId></dependency><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId></dependency>
报错:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'signOpenidController' defined in file [E:\IDEA_MY\life-sign\sign-auth\target\classes\com\luck\sign\controller\SignOpenidController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'signOpenidServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.luck.sign.mapper.SignOpenidMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:798) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE]... ...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'signOpenidServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.luck.sign.mapper.SignOpenidMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE]... ...
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.luck.sign.mapper.SignOpenidMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1695) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE]... ...
解决方式:
在启动类加注释 @MapperScan("com.luck.sign.mapper"),再运行即可@MapperScan("com.luck.sign.mapper")
@SpringBootApplication
public class AuthApplication {public static void main(String[] args){SpringApplication.run(AuthApplication.class,args);}
}

http://chatgpt.dhexx.cn/article/P1WPcasQ.shtml

相关文章

Simulink自动代码生成:数据类型别名自定义

在手写代码时&#xff0c;我们经常能看到自定义数据类型别名&#xff0c;例如有些代码中将计算机默认的数据类型改为我们自己习惯的名称&#xff0c;如图所示。 目录 一. 系统默认生成的别名二. 建立Simulink AliasType三. 修改Data Type Replacement四. 数据类型别名修改后的…

Simulink 自动代码生成原理

如下图&#xff0c;Simulink模型会先变成一个文本式的 .rtw 模型描述文件&#xff0c;然后再变成 .c,.h&#xff0c;最后编译为最终目标文件。 典型的 Simulink 用户通常都是&#xff0c;用Simulink设计好算法后&#xff0c;做到生成源代码这一步。然后把生成的算法的.c .h 源代…

如何自动生成SpringBoot项目代码

目录 1.RuoYi源码下载及启动若依服务1.1. RuoYi源码下载1.2. 启动若依服务 2.自动生成代码3.代码及sql文件链接 已经工作一段时间啦&#xff01;首先是从后端开发开始入手的&#xff0c;前端也是在自学阶段&#xff08;边学边问我身边的同事大佬&#xff09;&#xff0c;努力是…

Simulink自动代码生成:数据字典的建立及代码优化

在上一节《Simulink自动代码生成&#xff1a;生成代码的基本设置》的基础上&#xff0c;我们来对模型进行优化&#xff0c;使得生成的代码更能满足实际的需求&#xff0c;没看过我上一篇文章的可以点开如下链接&#xff1a;   Simulink自动代码生成&#xff1a;生成代码的基本…

推荐几个代码自动生成器

文章目录 老的代码生成器的地址&#xff1a;[https://www.cnblogs.com/skyme/archive/2011/12/22/2297592.html](https://link.zhihu.com/?targethttps%3A//www.cnblogs.com/skyme/archive/2011/12/22/2297592.html)1.懒猴子CG2.IT猿网3.listcode4.magicalcoder5.CodeSmith6. …

Mybatis代码自动生成

新启动的项目,数据库设计可能随时会变动,一些基础的接口,特别是xml文件和映射对象也需要变动,改动工作量大,用mybatis-plus代码自动生成工具自动生成代码,大大提高了效率 自动生成代码工具使用过程记录如下 首先手动创建一个springboot项目,可以去springboot官网上生成,也可以…

Simulink 自动代码生成电机控制:基于Keil软件集成

目录 系统软件架构 1.应用层全模型生成&#xff0c;底层手写代码 2.应用层模型生成&#xff0c;底层也是基于模型生成 3.Autosar 软件集成操作 接口配置 总结 系统软件架构 嵌入式软件开发包含应用层和底层&#xff0c;目前基于模型的开发软件架构总结为以下几种: 1.应…

mybatis自动生成代码

mybatis自动生成代码有三种方式&#xff1a;命令行、eclipse插件、maven插件。在这里主要介绍比较方便使用的一种方式–maven插件&#xff0c;它可以在eclipse、idea中通用。 在pom.xml文件中配置mybatis-generator插件&#xff1a; <plugin><groupId>org.mybatis…

idea自动生成代码

idea是完全可以自动生成一些基础代码&#xff0c;后续只需要根据生成的基础代码进行业务代码的编写&#xff0c;看看是如何生成的&#xff0c;教程比较全面&#xff0c;请耐心阅读&#xff0c;谢谢啦&#xff01; 1.首先检查自己的idea是否安装了自动生成代码的插件&#xff0…

Matlab/Simulink 自动代码生成详细步骤

最近一直在忙于FCU控制器的模型搭建&#xff0c;空闲之余也想分享一下自己对Simulink建模过程中的一些想法&#xff0c;从接触simulink到应用simulink大约已经两年多了&#xff0c;随着接触时间&#xff0c;慢慢发现simulink在模型搭建方面真的是非常的方面。今天我就和大家分享…

MybatisGenerator自动代码生成器的使用

之前有写过一篇文章通过RuoYi自动生成SpringBoot项目代码&#xff0c;这篇文章有介绍如何通过RuoYi框架来自动生成相关的SpringBoot代码。但并不是所有的小伙伴都会去下载RuoYi这一套框架代码去获取domain、mapper以及mapping&#xff0c;特此本人再推荐一款很实用并且也容易上…

Simulink自动代码生成(一)

一个simulink模型能够生成代码首先要满足的条件&#xff1a; 1&#xff1a;确保模型仿真的正确性2&#xff1a;将需要的输入和输出改成input和output模块3&#xff1a;离散化模型&#xff0c;设置求解器为离散&#xff0c;固定步长满足上面条件后&#xff0c;接下来怎么生成嵌入…

代码一键自动生成,拿走不谢

程序猿学社的GitHub&#xff0c;欢迎Star github技术专题 本文已记录到github 文章目录 前言起源环境实战sql脚本pom.xmlapplication.yml启动类代码自动生成controller类 测试 前言 隔壁老王&#xff1a; 社长&#xff0c;我工作有一段时间咯&#xff0c;我看其他的同事&#x…

4个免费代码自动生成神器

4个免费代码自动生成神器 日常写代码&#xff0c;是一件非常需要耐心的事情&#xff0c;尤其是那些没有技术含量重复使用到的一些代码排列组合&#xff0c;比如前端的一些html和css布局&#xff0c;简单繁杂&#xff0c;这个时候就会使用到一些免费代码自动生成神器&#xff0c…

java自动代码生成

1.概述 可在线自动生成代码&#xff0c;省去复制、修改通用模板代码的繁琐过程&#xff0c;减少团队70%以上的开发工作量 基于java的template模板引擎velocity&#xff0c;在定义好模板文件后&#xff0c;动态产生适应业务的java、xml、html、sql等代码文件 2.自动生成过程 …

Linux防火墙关闭方法

Linux防火墙关闭方法 关闭防火墙&#xff1a; 1、查看状态&#xff1a;systemctl status firewalld 2、关闭&#xff1a; systemctl stop firewalld&#xff08;只执行这个&#xff0c;重启后不行&#xff0c;还必须执行systemctl status firewalld&#xff09; 1.1、查看seli…

Linux中的Java项目服务器无故关闭

部署在Linux中的项目&#xff0c;最近一直无故关闭。找了很多都找不到原因。最近发现一个现象终于让我知道是什么原因导致我的开发服务器无故关闭了。 起因 部署在linux中的java开发服务器最近一直无故关闭。且是因为我在启动脚本中加了如下命令导致的。 tail -f log/game.lo…

Linux 系统下关闭防火墙

一、重启后永久性生效&#xff1a; 开启&#xff1a; chkconfig iptables on 关闭&#xff1a; chkconfig iptables off 二、即时生效&#xff0c;重启后失效&#xff1a; 开启&#xff1a; service iptables start 关闭&#xff1a; service iptables stop 需要说明的…

linux 桌面关闭防火墙,linux如何关闭防火墙的方法

火墙是一项协助确保信息安全的设备&#xff0c;会依照特定的规则&#xff0c;允许或是限制传输的数据通过。简单的来说防火墙的作用就是保护你的网络免受非法用户的侵入&#xff0c;虽然防火墙是为了你网络安全而存在&#xff0c;但是同时也限制了你上网操作&#xff0c;有很多…

LINUX系统下关闭防火墙

所谓防火墙指的是一个由软件和硬件设备组合而成、在内部网和外部网之间、专用网与公共网之间的界面上构造的保护屏障.是一种获取安全性方法的形象说法&#xff0c;它是一种计算机硬件和软件的结合&#xff0c;使Internet与Intranet之间建立起一个安全网关。 一、重启后永久性生…