v2 #43
|
@ -24,3 +24,6 @@ users/
|
||||||
|
|
||||||
.vscode/
|
.vscode/
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
|
|
||||||
|
*.db
|
4
main.go
4
main.go
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"owl-blogs/app"
|
"owl-blogs/app"
|
||||||
|
"owl-blogs/domain/model"
|
||||||
"owl-blogs/infra"
|
"owl-blogs/infra"
|
||||||
"owl-blogs/web"
|
"owl-blogs/web"
|
||||||
)
|
)
|
||||||
|
@ -9,6 +10,9 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
db := infra.NewSqliteDB("owlblogs.db")
|
db := infra.NewSqliteDB("owlblogs.db")
|
||||||
registry := app.NewEntryTypeRegistry()
|
registry := app.NewEntryTypeRegistry()
|
||||||
|
|
||||||
|
registry.Register(&model.ImageEntry{})
|
||||||
|
|
||||||
repo := infra.NewEntryRepository(db, registry)
|
repo := infra.NewEntryRepository(db, registry)
|
||||||
entryService := app.NewEntryService(repo)
|
entryService := app.NewEntryService(repo)
|
||||||
webApp := web.NewWebApp(entryService)
|
webApp := web.NewWebApp(entryService)
|
||||||
|
|
BIN
owlblogs.db
BIN
owlblogs.db
Binary file not shown.
|
@ -39,7 +39,8 @@ func (h *EditorHandler) HandlePost(c *fiber.Ctx) error {
|
||||||
|
|
||||||
// create entry
|
// create entry
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
err = h.entrySvc.Create(&model.ImageEntry{}, &now, metaData)
|
entry := &model.ImageEntry{}
|
||||||
|
err = h.entrySvc.Create(entry, &now, metaData.MetaData())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue