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
fa87a8b6
Commit
fa87a8b6
authored
Dec 08, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
48c7ec6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
client.go
pool/client.go
+0
-2
publicApi.go
pool/publicApi.go
+5
-3
No files found.
pool/client.go
View file @
fa87a8b6
...
@@ -67,8 +67,6 @@ type SendMsg struct {
...
@@ -67,8 +67,6 @@ type SendMsg struct {
CmdData
[]
byte
`json:"cmdData"`
//对应指令的CmdData1的protobuf的message
CmdData
[]
byte
`json:"cmdData"`
//对应指令的CmdData1的protobuf的message
Status
int
`json:"status"`
//消息发送响应状态
Status
int
`json:"status"`
//消息发送响应状态
Priority
int
`json:"priority"`
//用于处理指令队列的优先级的权重值
Priority
int
`json:"priority"`
//用于处理指令队列的优先级的权重值
BusinessId
string
`json:"businessId"`
//客户端标识消息的id,主要区分相同cmd的不同消息,方便收到回复分发处理等效果,考虑长度问题定义成string
GroupId
string
`json:"groupId"`
//服务端发送消息的ID,主要区分相同cmd的不同消息,方便服务端收到回复分发处理等效果,考虑长度问题定义成string
Channel
[]
string
`json:"channel"`
//指定需要广播的频道,可以指定一个或多个频道
Channel
[]
string
`json:"channel"`
//指定需要广播的频道,可以指定一个或多个频道
ProcedureType
int
`json:"procedureType"`
//会话状态 1 开始导诊 2 等待连接 3 离线 4 双方建立连接 5 结束会话 6 对话 7 已读 8 超时关闭
ProcedureType
int
`json:"procedureType"`
//会话状态 1 开始导诊 2 等待连接 3 离线 4 双方建立连接 5 结束会话 6 对话 7 已读 8 超时关闭
MsgType
int
`json:"msgType"`
// msg类型 procedureType=6时填写 1 文本消息 2 图片消息
MsgType
int
`json:"msgType"`
// msg类型 procedureType=6时填写 1 文本消息 2 图片消息
...
...
pool/publicApi.go
View file @
fa87a8b6
...
@@ -29,6 +29,7 @@ type SetMsgReq struct {
...
@@ -29,6 +29,7 @@ type SetMsgReq struct {
Content
string
`json:"content" db:"content"`
Content
string
`json:"content" db:"content"`
Sender
string
`json:"sender" db:"sender"`
Sender
string
`json:"sender" db:"sender"`
Receiver
string
`json:"receiver" db:"receiver"`
Receiver
string
`json:"receiver" db:"receiver"`
ReadStatus
string
`json:"readStatus" db:"read_status"`
}
}
// 第一步,实例化连接对像
// 第一步,实例化连接对像
...
@@ -415,7 +416,8 @@ func SaveMsg(msg *SendMsg) {
...
@@ -415,7 +416,8 @@ func SaveMsg(msg *SendMsg) {
mqData
.
Content
=
msg
.
Msg
mqData
.
Content
=
msg
.
Msg
mqData
.
Sender
=
msg
.
FromClientId
mqData
.
Sender
=
msg
.
FromClientId
mqData
.
Receiver
=
msg
.
ToClientId
mqData
.
Receiver
=
msg
.
ToClientId
AppendConversationRecord
(
msg
)
mqData
.
ReadStatus
=
"0"
AppendConversationRecord
(
mqData
)
}
}
if
msg
.
ProcedureType
==
8
{
if
msg
.
ProcedureType
==
8
{
...
@@ -460,8 +462,8 @@ func GetAllList(key string) map[string]string {
...
@@ -460,8 +462,8 @@ func GetAllList(key string) map[string]string {
return
jsonDataAll
return
jsonDataAll
}
}
func
AppendConversationRecord
(
msg
*
Se
ndMsg
)
{
func
AppendConversationRecord
(
msg
*
Se
tMsgReq
)
{
Redis
.
HSetNX
(
"msg:"
+
strconv
.
Itoa
(
msg
.
ConversationId
),
msg
.
FromClientId
+
":"
+
msg
.
ToClientId
,
string
(
SerializeJson
(
msg
)))
Redis
.
HSetNX
(
"msg:"
+
strconv
.
Itoa
(
msg
.
ConversationId
),
msg
.
Sender
+
":"
+
msg
.
Receiver
+
":"
+
msg
.
SendTime
,
string
(
SerializeJson
(
msg
)))
return
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