Commit fce02260 by chenxianqi

update default data sql And message soft delete And update postman api json

parent 13cc5b7d
......@@ -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
......
......@@ -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
}
......
......@@ -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\": 2154746\n}\n"
"raw": "{\n\t\"type\": 0,\n\t\"uid\": 0,\n\t\"address\": \"广州\",\n\t\"platform\": 2,\n\t\"account_id\": 10186\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",
......
This diff could not be displayed because it is too large.
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 sign in to comment