Easycode自动化实现springboot的curd

Easycode自动化实现springboot的curd_第1张图片

只需要输入密码 测试即可

Easycode自动化实现springboot的curd_第2张图片
显示成功 个人连接时遇到问题有
显示时区问题
Easycode自动化实现springboot的curd_第3张图片
数据显示不全 所有数据表都会展示到idea中
Easycode自动化实现springboot的curd_第4张图片
Easycode自动化实现springboot的curd_第5张图片
Easycode自动化实现springboot的curd_第6张图片
中间 path 选择代码生成的位置 店家choose进行选择 选择java包下的路径

Easycode自动化实现springboot的curd_第7张图片

代码生成后 需要做的调整

pom.xml

    
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            2.2.1
        
        
        
            junit
            junit
            4.13
            test
        
        
        
            com.github.pagehelper
            pagehelper-spring-boot-starter
            1.2.13
        
        
        
            mysql
            mysql-connector-java
            8.0.25
        
        
        
            com.mchange
            c3p0
            0.9.5.5
        
        
        
            org.apache.commons
            commons-lang3
        
        
            org.springframework.boot
            spring-boot-devtools
            
            true
        
        
            org.springframework.data
            spring-data-commons
            2.2.3.RELEASE
        
    

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_第8张图片
启动测试
添加操作

Easycode自动化实现springboot的curd_第9张图片
查询
Easycode自动化实现springboot的curd_第10张图片

还可以修改生成的模板

Easycode自动化实现springboot的curd_第11张图片

默认是 mybatis

你可能感兴趣的:(自动化,spring,boot,运维)