SpringBoot版的低代碼開發(fā)平臺(tái),關(guān)聯(lián)無 SQL,性能高10倍!
diboot 的設(shè)計(jì)理念 diboot 主要技術(shù)棧 diboot 基礎(chǔ)組件 diboot-core (diboot-core-starter) 使用步驟 1.引入依賴 2.配置參數(shù)(數(shù)據(jù)源) 3.配置config類 diboot 新手體驗(yàn) 在 IDE 中克隆 playground 項(xiàng)目

diboot 的設(shè)計(jì)理念
Web 開發(fā)需要一個(gè)普適的基礎(chǔ)框架,把復(fù)雜的問題簡(jiǎn)單化,最好還能做到更佳性能,規(guī)避常見的坑 程序員很難被替代,但程序員應(yīng)該聚焦于數(shù)據(jù)結(jié)構(gòu)設(shè)計(jì)、業(yè)務(wù)實(shí)現(xiàn)、難點(diǎn)解決,重復(fù) CRUD 沒啥長(zhǎng)進(jìn) 低代碼是未來的趨勢(shì),CRUD 類重復(fù)有規(guī)律的工作是可以被自動(dòng)化甚至被省掉的
diboot 主要技術(shù)棧
后端 Java + 關(guān)系數(shù)據(jù)庫,跟緊 Spring 體系 (Spring Boot、Spring Cloud) ORM 站隊(duì) Mybatis,通用 Mappe r框架選用 Mybatis-plus 權(quán)限: spring boo 版本使用 Shiro+JWT;spring cloud 版本使用 spring security + oauth2 前后分離,前端選型 Vue,支持 ElementUI 和 Antd vue pro
diboot 基礎(chǔ)組件
diboot-core: 精簡(jiǎn)優(yōu)化內(nèi)核:寫得更少,性能更好 IAM 身份認(rèn)證基礎(chǔ)組件 及 配套 VUE 前端框架(diboot-antd-admin、diboot-element-admin) diboot-file 文件相關(guān)處理組件 diboot-scheduler 定時(shí)任務(wù)組件 diboot-message 消息通知組件 diboot-mobile 移動(dòng)端組件
diboot-core (diboot-core-starter) 使用步驟
1.引入依賴
<dependency>
<groupId>com.diboot</groupId>
<artifactId>diboot-core-spring-boot-starter</artifactId>
<version>{latestVersion}</version>
</dependency>
或 Gradle:
compile("com.diboot:diboot-core-spring-boot-starter:{latestVersion}")
2.配置參數(shù)(數(shù)據(jù)源)
#datasource config
spring.datasource.url=jdbc:mysql://localhost:3306/diboot_example?characterEncoding=utf8&serverTimezone=GMT%2B8
spring.datasource.username=diboot
spring.datasource.password=123456
spring.datasource.hikari.maximum-pool-size=5
spring.datasource.hikari.driver-class-name=com.mysql.cj.jdbc.Driver
-------------------------------------------------------------------------
#diboot-core-spring-boot-starter的可選參數(shù)配置:
# 是否初始化sql,默認(rèn)true,初始化之后(或非開發(fā)環(huán)境)可以改為false關(guān)閉檢測(cè)
diboot.core.init-sql=false
3.配置config類
diboot-core-starter 默認(rèn)預(yù)置了 mybatis-plus 的分頁配置(使用 mybatis-plus 3.4.x的 MybatisPlusInterceptor 最新配置方式)。如果您依賴的是core-starter,則無需再次配置 mybatis-plus 的分頁。如果需要添加其他Interceptor,則需要重新定義 MybatisPlusInterceptor。示例如下:
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
return interceptor;
}
#同時(shí)core-starter中也默認(rèn)配置了HttpMessageConverters,如果需要更改默認(rèn)配置, 則需要在配置類中重新定義HttpMessageConverters。
@Bean
public HttpMessageConverters jacksonHttpMessageConverters() {
...
}
注意:diboot-core-starter 預(yù)置了默認(rèn)的配置以及字典表相關(guān)的接口實(shí)現(xiàn),如果是老項(xiàng)目中僅依賴 diboot-core(非diboot-core-starter),則還需要將 diboot 的包路徑加入 ComponentScan 中
diboot 新手體驗(yàn)
在 IDE 中克隆 playground 項(xiàng)目
"File -> New -> Project from version control..."菜單打開克隆項(xiàng)目對(duì)話框:

URL 中輸入如下 playground 項(xiàng)目路徑,指定項(xiàng)目本地路徑(避免中文路徑),點(diǎn)擊 Clone 按鈕 :https://gitee.com/dibo_software/playground.git

待克隆完成后,在右側(cè) Maven 視圖中,添加 demo 項(xiàng)目下的 pom.xml

準(zhǔn)備數(shù)據(jù)庫后使用 devtools 初始化代碼
點(diǎn)擊控制臺(tái)中打印出的 URL,進(jìn)入devtools操作頁面。(個(gè)人用戶初次使用需要掃碼) 初次啟動(dòng) devtools 會(huì)提示初始化組件的基礎(chǔ)代碼(為了方便自定義修改,devtools 將controller 等代碼生成到本地項(xiàng)目中)。依次點(diǎn)擊各組件的"生成代碼"按鈕。 
打開 demo 目錄下的 java 目錄,將會(huì)看到相關(guān)組件的初始化代碼已生成。
注意:如果啟動(dòng)前端發(fā)現(xiàn)驗(yàn)證碼無法顯示,則需要檢查是否執(zhí)行了這個(gè)步驟并重啟了項(xiàng)目。登錄驗(yàn)證相關(guān)的 controller 需要此步驟中生成
開源地址:
https://gitee.com/dibo_software/diboot
推薦閱讀:
世界的真實(shí)格局分析,地球人類社會(huì)底層運(yùn)行原理
不是你需要中臺(tái),而是一名合格的架構(gòu)師(附各大廠中臺(tái)建設(shè)PPT)
企業(yè)IT技術(shù)架構(gòu)規(guī)劃方案
論數(shù)字化轉(zhuǎn)型——轉(zhuǎn)什么,如何轉(zhuǎn)?
企業(yè)10大管理流程圖,數(shù)字化轉(zhuǎn)型從業(yè)者必備!
【中臺(tái)實(shí)踐】華為大數(shù)據(jù)中臺(tái)架構(gòu)分享.pdf
華為如何實(shí)施數(shù)字化轉(zhuǎn)型(附PPT)
