Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
im-pool
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
haoyanbin
im-pool
Commits
206bf171
Commit
206bf171
authored
Jan 09, 2023
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strcut
parent
f9a37051
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
private.go
pool/private.go
+12
-0
publicApi.go
pool/publicApi.go
+2
-0
No files found.
pool/private.go
View file @
206bf171
...
...
@@ -2,6 +2,7 @@ package pool
import
(
"encoding/json"
"strings"
)
...
...
@@ -34,4 +35,15 @@ func SerializeJson(data interface{}) []byte {
func
UnserislizeJson
(
str
[]
byte
,
data
interface
{})
{
_
=
json
.
Unmarshal
(
str
,
data
)
}
func
StrCut
(
s
string
)
string
{
if
s
==
""
{
return
""
}
sMap
:=
strings
.
Split
(
s
,
"_"
)
if
len
(
sMap
)
<
4
{
return
""
}
return
sMap
[
1
]
+
"_"
+
sMap
[
2
]
+
"_"
+
sMap
[
3
]
}
\ No newline at end of file
pool/publicApi.go
View file @
206bf171
...
...
@@ -491,6 +491,8 @@ func GetAllList(key string) map[string]string {
}
func
AppendConversationRecord
(
msg
*
SetMsgReq
)
{
msg
.
Sender
=
StrCut
(
msg
.
Sender
)
msg
.
Receiver
=
StrCut
(
msg
.
Receiver
)
Redis
.
HSetNX
(
"msg:"
+
strconv
.
Itoa
(
msg
.
ConversationId
),
msg
.
Sender
+
":"
+
msg
.
Receiver
+
":"
+
msg
.
SendTime
,
string
(
SerializeJson
(
msg
)))
return
}
...
...
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