Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
Details
Activity
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
邓莹莹
backend_auto
Commits
78adebda
Commit
78adebda
authored
Aug 18, 2021
by
edz
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
d0ec24e4
64702c5c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
im_request.py
all_backend_api/im_request.py
+14
-11
test_conversation_detail.py
test_backend_case/im_case/test_conversation_detail.py
+2
-2
test_send_msg.py
test_backend_case/im_case/test_send_msg.py
+2
-2
No files found.
all_backend_api/im_request.py
View file @
78adebda
...
...
@@ -6,13 +6,15 @@ class im_request(BaseRequest):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
CONVERSATION_DETAIL_CONFIG
)
def
conversation_detail
(
self
,
current_city_id
,
begin_msg_id
,
conversation_type
,
end_msg_id
,
referrer
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"begin_msg_id"
]
=
begin_msg_id
self
.
params
[
"conversation_type"
]
=
conversation_type
self
.
params
[
"end_msg_id"
]
=
end_msg_id
self
.
params
[
"referrer"
]
=
referrer
return
self
.
api_send
(
self
.
data
[
"conversation_detail"
])
#def conversation_detail(self, current_city_id, begin_msg_id, conversation_type, end_msg_id,referrer):
#咨询师聊天详情页
#self.params["current_city_id"] = current_city_id
#self.params["begin_msg_id"] = begin_msg_id
#self.params["conversation_type"] = conversation_type
#self.params["end_msg_id"] = end_msg_id
#self.params["referrer"] = referrer
#return self.api_send(self.data["conversation_detail"])
#该接口已下线
def
auto_msg
(
self
,
trace_id
,
conversation_id
):
self
.
params
[
"trace_id"
]
=
trace_id
...
...
@@ -20,6 +22,7 @@ class im_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"auto_msg"
])
def
send_msg
(
self
,
conversation_id
,
is_system
,
referrer
,
referrer_id
,
msg_type
,
content
,
extra
):
#给咨询师发送消息
self
.
params
[
"conversation_id"
]
=
conversation_id
self
.
params
[
"is_system"
]
=
is_system
self
.
params
[
"referrer"
]
=
referrer
...
...
@@ -28,6 +31,7 @@ class im_request(BaseRequest):
self
.
params
[
"content"
]
=
content
self
.
params
[
"extra"
]
=
extra
return
self
.
api_send
(
self
.
data
[
"send_msg"
])
# 该接口已下线
def
robot_get_second
(
self
,
page_type
):
" 获取页面触发私信时间 "
...
...
@@ -46,11 +50,10 @@ class im_request(BaseRequest):
if
__name__
==
'__main__'
:
print
(
im_request
()
.
conversation_detail
(
"beijing"
,
0
,
4
,
0
,
"message_home"
))
print
(
"第二个接口"
)
#print(im_request().conversation_detail("beijing", 0, 4, 0, "message_home"))
print
(
im_request
()
.
auto_msg
(
"2021/04/22/1722/70a1791606d5"
,
368
))
print
(
"send_msg"
)
print
(
im_request
()
.
send_msg
(
"368"
,
0
,
"message_home"
,
""
,
0
,
"您好,我想咨询一下"
,
{}))
#
print("send_msg")
#
print(im_request().send_msg("368", 0, "message_home", "", 0, "您好,我想咨询一下", {}))
print
(
im_request
()
.
robot_get_second
(
"3"
))
print
(
im_request
()
.
robot_send_msg
(
"715368769fea4a1ba0c85979112ed154"
,
1
,
"3"
,
"gengmei"
,
33909952
,
"7.46.0"
))
...
...
test_backend_case/im_case/test_conversation_detail.py
View file @
78adebda
...
...
@@ -6,7 +6,7 @@ from in_common.base_request import BaseRequest
from
all_backend_api.im_request
import
im_request
class
TestConversationDetail
:
'''
class TestConversationDetail:
data = BaseRequest().api_load(path_setting.CONVERSATION_DETAIL)
conversationdetail_case, conversationdetail_data = get_ids(data, "conversation_detail")
...
...
@@ -15,5 +15,5 @@ class TestConversationDetail:
r = im_request().conversation_detail(param["current_city_id"], param["begin_msg_id"], param["conversation_type"], param["end_msg_id"], param["referrer"])
if r["error"] == 0:
msg_list = r.get("data").get("msg_list",[])
assert
len
(
msg_list
)
>
param
[
"assert"
]
assert len(msg_list) > param["assert"]
'''
test_backend_case/im_case/test_send_msg.py
View file @
78adebda
...
...
@@ -6,7 +6,7 @@ from in_common.base_request import BaseRequest
from
all_backend_api.im_request
import
im_request
class
TestSendMsg
:
'''
class TestSendMsg:
data = BaseRequest().api_load(path_setting.SEND_MSG)
sendmsg_case, sendmsg_data = get_ids(data, "send_msg")
...
...
@@ -18,5 +18,5 @@ class TestSendMsg:
assert r["data"]["conversation_type"] == param["assert_conversation_type"]
assert r["data"]["message_type"] == param["assert_message_type"]
if r["error"] == 1:
assert
r
[
"message"
]
==
param
[
"assert_message"
]
assert r["message"] == param["assert_message"]
'''
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