Commit 40bd75c7 authored by Steven's avatar Steven

fix: create memo with resource name

parent b2fc3076
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"time" "time"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"
"github.com/lithammer/shortuuid/v4"
"github.com/pkg/errors" "github.com/pkg/errors"
"go.uber.org/zap" "go.uber.org/zap"
...@@ -894,6 +895,7 @@ func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store ...@@ -894,6 +895,7 @@ func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store
createdTs = *memoCreate.CreatedTs createdTs = *memoCreate.CreatedTs
} }
return &store.Memo{ return &store.Memo{
ResourceName: shortuuid.New(),
CreatorID: memoCreate.CreatorID, CreatorID: memoCreate.CreatorID,
CreatedTs: createdTs, CreatedTs: createdTs,
Content: memoCreate.Content, Content: memoCreate.Content,
......
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"strconv" "strconv"
"unicode/utf16" "unicode/utf16"
"github.com/lithammer/shortuuid/v4"
"github.com/pkg/errors" "github.com/pkg/errors"
apiv1 "github.com/usememos/memos/api/v1" apiv1 "github.com/usememos/memos/api/v1"
...@@ -58,6 +59,7 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot, ...@@ -58,6 +59,7 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot,
} }
create := &store.Memo{ create := &store.Memo{
ResourceName: shortuuid.New(),
CreatorID: creatorID, CreatorID: creatorID,
Visibility: store.Private, Visibility: store.Private,
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment