WIP first entry creation
This commit is contained in:
parent
ff193f62e9
commit
8fc82b86a3
|
@ -24,3 +24,6 @@ users/
|
|||
|
||||
.vscode/
|
||||
*.swp
|
||||
|
||||
|
||||
*.db
|
4
main.go
4
main.go
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"owl-blogs/app"
|
||||
"owl-blogs/domain/model"
|
||||
"owl-blogs/infra"
|
||||
"owl-blogs/web"
|
||||
)
|
||||
|
@ -9,6 +10,9 @@ import (
|
|||
func main() {
|
||||
db := infra.NewSqliteDB("owlblogs.db")
|
||||
registry := app.NewEntryTypeRegistry()
|
||||
|
||||
registry.Register(&model.ImageEntry{})
|
||||
|
||||
repo := infra.NewEntryRepository(db, registry)
|
||||
entryService := app.NewEntryService(repo)
|
||||
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
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue