溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Easycode自動化springboot中curd是怎么樣的

發(fā)布時間:2022-01-24 09:24:58 來源:億速云 閱讀:120 作者:小新 欄目:開發(fā)技術(shù)

這篇文章主要介紹了Easycode自動化springboot中curd是怎么樣的,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

Easycode自動化springboot中curd是怎么樣的

只需要輸入密碼 測試即可:

Easycode自動化springboot中curd是怎么樣的

顯示成功 個人連接時遇到問題有
顯示時區(qū)問題

Easycode自動化springboot中curd是怎么樣的

數(shù)據(jù)顯示不全 所有數(shù)據(jù)表都會展示到idea

Easycode自動化springboot中curd是怎么樣的

Easycode自動化springboot中curd是怎么樣的

中間 path 選擇代碼生成的位置 店家choose進行選擇 選擇java包下的路徑

Easycode自動化springboot中curd是怎么樣的

代碼生成后 需要做的調(diào)整

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 驅(qū)動 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.25</version>
        </dependency>
        <!-- c3p0 數(shù)據(jù)源 -->
        <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

## 數(shù)據(jù)源配置
spring:
  ## 熱部署配置
  devtools:
    restart:
      enabled: true
      # 設(shè)置重啟的目錄,添加目錄的文件需要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:
    ## 下劃線轉(zhuǎn)駝峰配置
    map-underscore-to-camel-case: true

## pageHelper
pagehelper:
  helper-dialect: mysql

## 顯示dao 執(zhí)行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是怎么樣的”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,更多相關(guān)知識等著你來學習!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI