Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
test(smoba): campGetTaskReward
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Jun 18, 2024
1 parent 2636ea8 commit 67b03e9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/smoba/SmobaEntry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import time
from datetime import datetime

from src.smoba.http import HttpApi
Expand Down Expand Up @@ -99,7 +98,7 @@ def do_task_reward():


def do_camp_list():
resp_json = HttpApi.camp_task_list()
resp_json = HttpApi.camp_get_task_list()
if resp_json is not None:
group_tasks = resp_json["data"]["data"]["taskgroup"]["grouptasks"]
for group_task in group_tasks:
Expand Down Expand Up @@ -129,12 +128,13 @@ def camp_complete(task_id, task_desc):


def do_camp_reward():
# test sleep
time.sleep(2)
global send_content
resp_json = HttpApi.camp_task_reward()
resp_json = HttpApi.camp_get_task_reward()
if resp_json is not None:
send_content += f">领取成功: {resp_json}\n"
send_content += f">领取成功: 领取奖励完成\n"
resp_json = HttpApi.camp_set_task_finish_count()
if resp_json is not None:
send_content += f">刷新成功: 刷新数量完成\n"


def entry():
Expand Down
24 changes: 20 additions & 4 deletions src/smoba/http/HttpApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,29 @@ def play_task_data(task_type):
return resp_json


def camp_task_list():
resp_json = HttpUtil.post_api_native("campGetTaskList")
def camp_get_task_list():
resp_json = HttpUtil.post_api_native(
"campGetTaskList",
{}
)
return resp_json


def camp_get_task_reward():
resp_json = HttpUtil.post_api_native(
"campGetTaskReward",
{}
)
return resp_json


def camp_task_reward():
resp_json = HttpUtil.post_api_native("campGetTaskReward")
def camp_set_task_finish_count():
resp_json = HttpUtil.post_api_native(
"campSetTaskFinishCount",
{
"taskIds": []
}
)
return resp_json


Expand Down
3 changes: 2 additions & 1 deletion src/smoba/http/HttpUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ def post_api_data(api, param_data):
return None


def post_api_native(name):
def post_api_native(name, data):
try:
resp = requests.post(
url="https://yxzjfaas.native.qq.com/backend_polaris/?namespace=Faas&pdr_appid=3732&fn=" + name,
json={
"data": data,
"base": {
"userinfo": {
"sPartition": "1277",
Expand Down

0 comments on commit 67b03e9

Please sign in to comment.