owl-blogs/web/editor_handler.go

27 lines
557 B
Go
Raw Normal View History

2023-06-25 19:32:36 +00:00
package web
import (
"owl-blogs/app"
2023-06-25 20:09:27 +00:00
"owl-blogs/domain/model"
"owl-blogs/web/editor"
2023-06-25 19:32:36 +00:00
"github.com/gofiber/fiber/v2"
)
type EditorHandler struct {
entrySvc *app.EntryService
}
func NewEditorHandler(entryService *app.EntryService) *EditorHandler {
return &EditorHandler{entrySvc: entryService}
}
func (h *EditorHandler) HandleGet(c *fiber.Ctx) error {
2023-06-25 20:09:27 +00:00
form := editor.NewEditorFormService(&model.ImageEntry{})
return c.SendString(form.HtmlForm())
2023-06-25 19:32:36 +00:00
}
func (h *EditorHandler) HandlePost(c *fiber.Ctx) error {
return c.SendString("Hello, Editor!")
}