温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Easycode自动化springboot中curd是怎么样的

发布时间:2022-01-24 09:24:58 来源:亿速云 阅读:108 作者:小新 栏目:开发技术

这篇文章主要介绍了Easycode自动化springboot中curd是怎么样的,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

Easycode自动化springboot中curd是怎么样的

只需要输入密码 测试即可:

Easycode自动化springboot中curd是怎么样的

显示成功 个人连接时遇到问题有
显示时区问题

Easycode自动化springboot中curd是怎么样的

数据显示不全 所有数据表都会展示到idea

Easycode自动化springboot中curd是怎么样的

Easycode自动化springboot中curd是怎么样的

中间 path 选择代码生成的位置 店家choose进行选择 选择java包下的路径

Easycode自动化springboot中curd是怎么样的

代码生成后 需要做的调整

pom.xml

   <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.2.1</version>
        </dependency>
        <!--    测试依赖-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13</version>
            <scope>test</scope>
        </dependency>
        <!-- springboot 分页插件 -->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.13</version>
        </dependency>
        <!-- mysql 驱动 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.25</version>
        </dependency>
        <!-- c3p0 数据源 -->
        <dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.5.5</version>
        </dependency>
        <!--StringUtils-->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <!--当前这个项目被继承之后,这个不向下传递-->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <version>2.2.3.RELEASE</version>
        </dependency>
    </dependencies>

Application.yml

## 数据源配置
spring:
  ## 热部署配置
  devtools:
    restart:
      enabled: true
      # 设置重启的目录,添加目录的文件需要restart
      additional-paths: src/main/java
      # 解决项目自动重新编译后接口报404的问题
      poll-interval: 3000
      quiet-period: 1000
  datasource:
    type: com.mchange.v2.c3p0.ComboPooledDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/springboot_mybatis?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
    username: root
    password: 123456
    ##视图的配置
    freemarker:
      template-loader-path: classpath*:/views/
      charset: UTF-8
      content-type: text/html
      cache: false
      suffix: .ftl

## mybatis 配置
mybatis:
  #映射文件的存放路径
  mapper-locations: classpath*:/mapper/*.xml
  type-aliases-package: com.liuyang.bean,com.liuyang.vo,com.liuyang.query
  configuration:
    ## 下划线转驼峰配置
    map-underscore-to-camel-case: true

## pageHelper
pagehelper:
  helper-dialect: mysql

## 显示dao 执行sql语句
logging:
  level:
    com:
      xxxx:
        mapper: debug

在dao层加上@mapper注解

在启动类上加上 @MapperScan(“com.liuyang.dao”)

Easycode自动化springboot中curd是怎么样的

启动测试
添加操作

Easycode自动化springboot中curd是怎么样的

查询

Easycode自动化springboot中curd是怎么样的

还可以修改生成的模板

Easycode自动化springboot中curd是怎么样的

默认是 mybatis

感谢你能够认真阅读完这篇文章,希望小编分享的“Easycode自动化springboot中curd是怎么样的”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI