Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
kefu_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fce02260
authored
Dec 29, 2019
by
chenxianqi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update default data sql And message soft delete And update postman api json
parent
13cc5b7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
im/message_into.go
im/message_p2p.go
kefu_server.postman_collection.json
sql/kefu_server.sql
im/message_into.go
View file @
fce02260
...
...
@@ -19,10 +19,10 @@ func MessageInto(message models.Message, isKF bool) {
return
}
// 判断是否是撤回消息(
删掉数据库消息
)
// 判断是否是撤回消息(
软删除
)
if
message
.
BizType
==
"cancel"
{
key
,
_
:=
strconv
.
ParseInt
(
message
.
Payload
,
10
,
64
)
_
,
_
=
o
.
Raw
(
"
DELETE FROM message
WHERE from_account = ? AND to_account = ? AND `key` = ?"
,
message
.
FromAccount
,
message
.
ToAccount
,
key
)
.
Exec
()
_
,
_
=
o
.
Raw
(
"
UPDATE message SET `delete` = 1
WHERE from_account = ? AND to_account = ? AND `key` = ?"
,
message
.
FromAccount
,
message
.
ToAccount
,
key
)
.
Exec
()
}
// message create time
...
...
im/message_p2p.go
View file @
fce02260
...
...
@@ -93,6 +93,8 @@ func MessageP2P(message models.Message) {
// 不处理的消息类型
if
message
.
BizType
==
"cancel"
{
key
,
_
:=
strconv
.
ParseInt
(
message
.
Payload
,
10
,
64
)
_
,
_
=
o
.
Raw
(
"UPDATE message SET `delete` = 1 WHERE from_account = ? AND to_account = ? AND `key` = ?"
,
message
.
FromAccount
,
message
.
ToAccount
,
key
)
.
Exec
()
return
}
...
...
kefu_server.postman_collection.json
View file @
fce02260
...
...
@@ -1030,7 +1030,7 @@
],
"body"
:
{
"mode"
:
"raw"
,
"raw"
:
"{
\n\t\"
type
\"
: 0,
\n\t\"
uid
\"
: 0,
\n\t\"
address
\"
:
\"
广州
\"
,
\n\t\"
platform
\"
: 2,
\n\t\"
account_id
\"
:
215474
6
\n
}
\n
"
"raw"
:
"{
\n\t\"
type
\"
: 0,
\n\t\"
uid
\"
: 0,
\n\t\"
address
\"
:
\"
广州
\"
,
\n\t\"
platform
\"
: 2,
\n\t\"
account_id
\"
:
1018
6
\n
}
\n
"
},
"url"
:
{
"raw"
:
"{{HOST}}/v1/public/register"
,
...
...
@@ -1351,6 +1351,11 @@
"key"
:
"file"
,
"type"
:
"file"
,
"src"
:
"/Users/chenxianqi/Downloads/avatar_default.png"
},
{
"key"
:
"file_name"
,
"value"
:
"sdfsdfsdf.jpg"
,
"type"
:
"text"
}
]
},
...
...
@@ -1370,6 +1375,42 @@
"response"
:
[]
},
{
"name"
:
"/v1/public/messages"
,
"request"
:
{
"method"
:
"POST"
,
"header"
:
[
{
"key"
:
"token"
,
"type"
:
"text"
,
"value"
:
"bJRLeg7AgtSh0T13YjL/IFDdK0JTjCJG4KdSfB9L7c0N56uq0EiflNyh2H5qmlOwqeOEcudSjEicejSfy+BJz2ui/bkYYYPpT9rKkuChjVDMAXpIv1L7ItYzsCaYjygYQD/FuVQ+0xiiFJqDudzL2vHwjH/X7NJbH7JCqycZkfW1zemCFfMmd2X/MaLFoNJViuwJ2SSX9LBI38wn1xjcB5vdf/iemXgkphP/681AbulvHLRLZ66k+UlpgCdSARnyRYH9FpopjYrwJP3szMd6RU0It7bQ5/sveyu7f/+hKdXvxQOCwP/Kvr6f3GTz8HDk6Q8Mi7sUArG3HKxxpY1Q8ItJk/KjE+pORbjJ9mc5QP7jfqICozzHGsKs30rQVIHn2Rm4HLToaQs9V+58inqH+hwDyomOK4JqKNfY4ZTsWP7k/qUEf4euSwFRp56NyKHjhTG333qEitsojbGZiH3HSg=="
},
{
"key"
:
"Content-Type"
,
"name"
:
"Content-Type"
,
"type"
:
"text"
,
"value"
:
"application/json"
}
],
"body"
:
{
"mode"
:
"raw"
,
"raw"
:
"{
\n
\"
timestamp
\"
: 1572347076,
\n
\"
page_size
\"
: 10,
\n
\"
account
\"
: 10186
\n
}"
},
"url"
:
{
"raw"
:
"{{HOST}}/v1/public/messages"
,
"host"
:
[
"{{HOST}}"
],
"path"
:
[
"v1"
,
"public"
,
"messages"
]
},
"description"
:
"获取聊天记录"
},
"response"
:
[]
},
{
"name"
:
"/v1/shortcut"
,
"request"
:
{
"method"
:
"POST"
,
...
...
sql/kefu_server.sql
View file @
fce02260
This diff could not be displayed because it is too large.
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