1
0

Renamed sqlite DB for guestbook as gbsqlite.

This commit is contained in:
Alexander Andreev 2023-05-14 03:33:55 +04:00
parent f3288d9869
commit de8f042019
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -14,6 +14,7 @@ import (
"git.arav.su/Arav/dwelling-home/internal/http" "git.arav.su/Arav/dwelling-home/internal/http"
"git.arav.su/Arav/dwelling-home/pkg/mindflow/database/sqlite" "git.arav.su/Arav/dwelling-home/pkg/mindflow/database/sqlite"
gbsqlite "git.arav.su/Arav/justguestbook/database/sqlite"
) )
var version string var version string
@ -50,7 +51,7 @@ func main() {
} }
} }
guestbookDB, err := sqlite.New(path.Join(*databasesPath, "guestbook.sqlite")) guestbookDB, err := gbsqlite.New(path.Join(*databasesPath, "guestbook.sqlite"))
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} }
@ -92,7 +93,12 @@ func main() {
srv.PATCH("/api/guestbook/:id/reply", guestbookApi.EditReply) srv.PATCH("/api/guestbook/:id/reply", guestbookApi.EditReply)
srv.DELETE("/api/guestbook/:id/reply", guestbookApi.DeleteReply) srv.DELETE("/api/guestbook/:id/reply", guestbookApi.DeleteReply)
mindflowApi := http.NewMindflowApiHandlers() mindflowDB, err := sqlite.NewSQLiteMindflow(path.Join(*databasesPath, "mindflow.sqlite"))
if err != nil {
log.Fatalln(err)
}
mindflowApi := http.NewMindflowApiHandlers(mindflowDB)
srv.POST("/api/mindflow", mindflowApi.New) srv.POST("/api/mindflow", mindflowApi.New)
srv.POST("/api/mindflow/:id", mindflowApi.Edit) srv.POST("/api/mindflow/:id", mindflowApi.Edit)