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
7363daf8
Commit
7363daf8
authored
Aug 02, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主播-推荐袋添加尾款券(主播账号为机构或医生)
parent
39c06d5e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
3 deletions
+64
-3
janus_live_request.py
all_backend_api/janus_live_request.py
+15
-3
janus_live_request.yaml
all_backend_api/janus_live_request.yaml
+14
-0
path_setting.py
path_setting.py
+4
-0
test_add_live_gift.py
test_backend_case/janus_live_case/test_add_live_gift.py
+20
-0
add_live_gift.yaml
test_backend_data/janus_live_data/add_live_gift.yaml
+11
-0
No files found.
all_backend_api/janus_live_request.py
View file @
7363daf8
...
...
@@ -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
.
ADDLIVEGIFT_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
POP_SERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
POP_GIFT_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
GET_GIFT_CONFIG
)
...
...
@@ -70,6 +71,15 @@ class live_request(BaseRequest):
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"pop_service"
])
#主播-推荐袋添加尾款券(主播账号为机构或医生)
def
add_live_gift
(
self
,
channel_id
,
doctor_gift_ids
,
platform_gift_ids
,
stream_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"channel_id"
]
=
channel_id
self
.
params
[
"doctor_gift_ids"
]
=
doctor_gift_ids
self
.
params
[
"platform_gift_ids"
]
=
platform_gift_ids
self
.
params
[
"stream_id"
]
=
stream_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"add_live_gift"
])
#om后台-弹出美券
def
pop_gift
(
self
,
stream_id
,
gift_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"stream_id"
]
=
stream_id
...
...
@@ -131,9 +141,11 @@ if __name__ == '__main__':
# print(live_request().search_service("beijing", "745", "", "0", "20", "7.45.0"))
# 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().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"))
# print(live_request().pop_service("4266", "7324", "1", "746.0"))
print
(
live_request
()
.
add_live_gift
(
"739"
,
"59127"
,
""
,
"4283"
,
"7.45.0"
))
print
(
live_request
()
.
delete_live_gift
(
"739"
,
"59127"
,
"1"
,
"4283"
,
"7.45.0"
))
# print(live_request().pop_gift("4271", "59124", "746.0"))
print
(
live_request
()
.
get_gift
(
"59124"
,
"746.0"
))
\ No newline at end of file
# print(live_request().get_gift( "59124", "746.0"))
\ No newline at end of file
all_backend_api/janus_live_request.yaml
View file @
7363daf8
...
...
@@ -65,6 +65,20 @@ pop_service:
json
:
{}
isLogin
:
1
#主播-推荐袋添加尾款券(主播账号为机构或医生)
add_live_gift
:
method
:
POST
url
:
/api/janus/live/add_live_gift
params
:
version
:
${version}
data
:
channel_id
:
${channel_id}
doctor_gift_ids
:
${doctor_gift_ids}
platform_gift_ids
:
${platform_gift_ids}
stream_id
:
${stream_id}
json
:
{}
isLogin
:
1
#om后台-弹出美券
pop_gift
:
method
:
GET
...
...
path_setting.py
View file @
7363daf8
...
...
@@ -615,6 +615,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"
)
#主播-推荐袋添加尾款券(主播账号为机构或医生)
ADDLIVEGIFT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
ADDLIVEGIFT
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"add_live_gift.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"
)
...
...
test_backend_case/janus_live_case/test_add_live_gift.py
0 → 100644
View file @
7363daf8
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
TestAddLiveGift
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ADDLIVEGIFT
)
addlivegift_case
,
addlivegift_data
=
get_ids
(
data
,
"add_live_gift"
)
@pytest.mark.parametrize
(
"param"
,
addlivegift_data
,
ids
=
addlivegift_case
)
def
test_add_live_gift
(
self
,
param
):
print
(
111111111111111111111
)
r
=
live_request
()
.
add_live_gift
(
param
[
"channel_id"
],
param
[
"doctor_gift_ids"
],
param
[
"platform_gift_ids"
],
param
[
"stream_id"
],
param
[
"version"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"toast"
]
==
param
[
"assert"
]
live_request
()
.
delete_live_gift
(
"739"
,
"59127"
,
"1"
,
"4283"
,
"7.45.0"
)
\ No newline at end of file
test_backend_data/janus_live_data/add_live_gift.yaml
0 → 100644
View file @
7363daf8
add_live_gift
:
#主播-推荐袋添加尾款券(主播账号为机构或医生)
-
case
:
"
主播-推荐袋添加尾款券(主播账号为机构或医生),尾款券添加成功"
channel_id
:
"
739"
doctor_gift_ids
:
"
59127"
platform_gift_ids
:
"
"
stream_id
:
"
4283"
version
:
"
7.45.0"
assert
:
成功添加1个美券
\ 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