Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
40bd75c7
Commit
40bd75c7
authored
Jan 21, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: create memo with resource name
parent
b2fc3076
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
memo.go
api/v1/memo.go
+6
-4
telegram.go
server/integration/telegram.go
+4
-2
No files found.
api/v1/memo.go
View file @
40bd75c7
...
@@ -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,10 +895,11 @@ func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store
...
@@ -894,10 +895,11 @@ func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store
createdTs
=
*
memoCreate
.
CreatedTs
createdTs
=
*
memoCreate
.
CreatedTs
}
}
return
&
store
.
Memo
{
return
&
store
.
Memo
{
CreatorID
:
memoCreate
.
CreatorID
,
ResourceName
:
shortuuid
.
New
(),
CreatedTs
:
createdTs
,
CreatorID
:
memoCreate
.
CreatorID
,
Content
:
memoCreate
.
Content
,
CreatedTs
:
createdTs
,
Visibility
:
store
.
Visibility
(
memoCreate
.
Visibility
),
Content
:
memoCreate
.
Content
,
Visibility
:
store
.
Visibility
(
memoCreate
.
Visibility
),
}
}
}
}
...
...
server/integration/telegram.go
View file @
40bd75c7
...
@@ -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,8 +59,9 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot,
...
@@ -58,8 +59,9 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot,
}
}
create
:=
&
store
.
Memo
{
create
:=
&
store
.
Memo
{
CreatorID
:
creatorID
,
ResourceName
:
shortuuid
.
New
(),
Visibility
:
store
.
Private
,
CreatorID
:
creatorID
,
Visibility
:
store
.
Private
,
}
}
if
message
.
Text
!=
nil
{
if
message
.
Text
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment