setup(save_note): setup save handler

This commit is contained in:
Kristian Borgwarth 2026-04-06 22:37:59 +02:00
parent f9b9a06b70
commit 716a541005
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,33 @@
package handlers
import (
"context"
"encoding/json"
"github.com/KristianJBorgwarth/dendrite.daemon/persistence/repositories"
)
type saveNoteCommand struct {
Title string `json:"title"`
Content string `json:"content"`
Directory string `json:"directory"`
Tags []string `json:"tags"`
}
type SaveNoteHandler struct {
uow *repositories.UnitOfWork
}
func NewSaveNoteHandler() *SaveNoteHandler {
return &SaveNoteHandler{repositories.NewUnitOfWork()}
}
func (h *SaveNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (any, error) {
var cmd saveNoteCommand
if err := json.Unmarshal(raw, &cmd); err != nil {
return nil, err
}
return nil, nil
}

BIN
dendrite

Binary file not shown.