如何用Ktor / Kotlin
開發Chatbot
Day17. 我的第一個 Line Bot (8):
將Line Bot收到的訊息寫入Ktor的database吧~
Chatbot小萌新攻略
~Exposed的寫法~
Ktor DB
~準備工作:請開啟Day13的練習專案,& 接好webhook~
icon Switch
1. 環境設置
2. 建立DB連線
3. 建立資料表
4. 寫入資料
5. 取出資料
~操作步驟~
Ktor DB:DSL
~1. 環境設置:在build.gradle增加 Exposed 及 H2 相依套件~
Ktor DB:DSL
不要加入dao
~1. 環境設置:在build.gradle增加 Exposed 及 H2 相依套件~
Ktor DB:DSL
DSL要建立的套件
DAO要建立的套件
1. 建立H2連線
2. Table (create, object & 條件)
3. my first DSL
4. 建立查詢的API路徑
~複習~
Ktor DB:DSL
實作過程請參閱影片
~Demo~
Ktor DB:DSL

Day17. Ktor Exposed - DSL 實作 #將聊天機器人收到的訊息,寫入Ktor的資料庫吧~