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
8a791c22
Commit
8a791c22
authored
Jul 28, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主播添加商品后,购物车上方弹出商品卡片
parent
18af6ea7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
3 deletions
+62
-3
janus_live_request.py
all_backend_api/janus_live_request.py
+13
-3
janus_live_request.yaml
all_backend_api/janus_live_request.yaml
+13
-0
path_setting.py
path_setting.py
+4
-0
test_pop_service.py
test_backend_case/janus_live_case/test_pop_service.py
+22
-0
pop_service.yaml
test_backend_data/janus_live_data/pop_service.yaml
+10
-0
No files found.
all_backend_api/janus_live_request.py
View file @
8a791c22
...
...
@@ -8,6 +8,7 @@ class live_request(BaseRequest):
self
.
data
=
self
.
api_load
(
path_setting
.
LIVEGIFTS_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
SEARCHSERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
ADDLIVESERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
POP_SERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
DELETELIVESERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
DELETEGIFT_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
M_GET_CHANNEL_STATUS_CONFIG
)
...
...
@@ -59,6 +60,14 @@ class live_request(BaseRequest):
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"add_live_service"
])
#主播-添加商品后,购物车上方弹出商品卡片
def
pop_service
(
self
,
stream_id
,
live_service_id
,
pop_type
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"stream_id"
]
=
stream_id
self
.
params
[
"live_service_id"
]
=
live_service_id
self
.
params
[
"pop_type"
]
=
pop_type
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"pop_service"
])
#主播-推荐袋删除商品
def
delete_live_service
(
self
,
channel_id
,
live_service_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"channel_id"
]
=
channel_id
...
...
@@ -108,5 +117,6 @@ if __name__ == '__main__':
# print(live_request().add_live_service("745", "560641", "7.45.0"))
# print(live_request().delete_live_service("745", "7242", "7.45.0"))
#print(live_request().m_get_channel_status("745", "7.46.0"))
print
(
live_request
()
.
mark_live_service
(
"4233"
,
"745"
,
"7269"
,
"1"
,
"746.0"
))
print
(
live_request
()
.
audience_services
(
"4179"
,
"739"
,
"0"
,
"20"
))
\ No newline at end of file
# print(live_request().mark_live_service("4233", "745", "7269", "1", "746.0"))
# print(live_request().audience_services("4179","739","0","20"))
print
(
live_request
()
.
pop_service
(
"4266"
,
"7324"
,
"1"
,
"746.0"
))
\ No newline at end of file
all_backend_api/janus_live_request.yaml
View file @
8a791c22
...
...
@@ -52,6 +52,19 @@ add_live_service:
json
:
{}
isLogin
:
1
#主播-添加商品后,购物车上方弹出商品卡片
pop_service
:
method
:
GET
url
:
/api/janus/live/pop_service
params
:
stream_id
:
${stream_id}
live_service_id
:
${live_service_id}
pop_type
:
${pop_type}
version
:
${version}
data
:
{}
json
:
{
}
isLogin
:
1
#主播-推荐袋删除商品
delete_live_service
:
method
:
POST
...
...
path_setting.py
View file @
8a791c22
...
...
@@ -598,6 +598,10 @@ SEARCHGIFTS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_
ADDLIVESERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
ADDLIVESERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"add_live_service.yaml"
)
#主播-添加商品后,购物车上方弹出商品卡片
POP_SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
POP_SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"pop_service.yaml"
)
#主播-推荐袋删除商品
DELETELIVESERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
DELETELIVESERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"delete_live_service.yaml"
)
...
...
test_backend_case/janus_live_case/test_pop_service.py
0 → 100644
View file @
8a791c22
import
pytest
import
path_setting
from
all_backend_api.janus_live_request
import
live_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestPopService
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
POP_SERVICE
)
pop_service_case
,
pop_service_data
=
get_ids
(
data
,
"pop_service"
)
@pytest.mark.parametrize
(
"param"
,
pop_service_data
,
ids
=
pop_service_case
)
def
test_pop_service
(
self
,
param
):
r
=
live_request
()
.
pop_service
(
param
[
"stream_id"
],
param
[
"live_service_id"
],
param
[
"pop_type"
],
param
[
"version"
])
if
r
[
"error"
]
==
0
:
print
(
"成功弹出商品卡片"
)
assert
r
[
"data"
][
"live_service_id"
]
==
param
[
"assert"
]
else
:
print
(
"出错了!!!"
)
\ No newline at end of file
test_backend_data/janus_live_data/pop_service.yaml
0 → 100644
View file @
8a791c22
pop_service
:
#主播添加商品后,购物车上方成功弹出一个商品卡片
-
case
:
"
主播添加商品后,购物车上方成功弹出一个商品卡片"
stream_id
:
"
4266"
live_service_id
:
"
7324"
pop_type
:
"
1"
version
:
"
7.46.0"
assert
:
7324
\ No newline at end of file
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