This commit is contained in:
1 parent
d0b1713410
commit
8fe6822545
5 files changed
+105
-4
No files matched your search
+36
-1
@@ -8,7 +8,7 @@ from celery import Task
|
||||
|
||||
from app.utils.utils import *
|
||||
from app.utils.yd_utils import get_token, get_activity_info
|
||||
from app.utils.feishu import create_doc, get_doc_block, create_doc_block, get_messages
|
||||
from app.utils.feishu import create_doc, get_doc_block, create_doc_block, get_messages, send_groud_message
|
||||
from app.utils.utils import update_record, add_record
|
||||
from app.utils.yd_utils import new_blank_robot, new_blank_activity
|
||||
|
||||
@@ -270,6 +270,41 @@ def sync_xbot_activity_info():
|
||||
print("新增的uuid: ", handle_list)
|
||||
|
||||
|
||||
@shared_task()
|
||||
def check_activity_help_link():
|
||||
"""判断指令的帮助文档是否缺失, 并推送消息"""
|
||||
xbot_username = os.environ["XBOT_USERNAME"]
|
||||
xbot_password = os.environ["XBOT_PASSWORD"]
|
||||
app_id = os.environ["APP_ID"]
|
||||
app_secret = os.environ["APP_SECRET"]
|
||||
|
||||
xbot_username = os.environ["XBOT_USERNAME"]
|
||||
xbot_password = os.environ["XBOT_PASSWORD"]
|
||||
chat_id = os.environ["FEISHU_GROUP_CHAT_ID"]
|
||||
|
||||
client = lark.Client.builder().app_id(app_id).app_secret(app_secret).build()
|
||||
|
||||
token = get_token(xbot_username, xbot_password)
|
||||
activities_info = get_activity_info(token)
|
||||
|
||||
messages = []
|
||||
messages.append("==========市场指令缺失文档==========")
|
||||
|
||||
for activity_info in activities_info:
|
||||
package_viewN_name = activity_info.get("packageViewName")
|
||||
activities = activity_info.get("activities", "空")
|
||||
for activity in activities:
|
||||
name = activity.get("name")
|
||||
help_link = activity.get("helpLink", "")
|
||||
if not help_link:
|
||||
# print(f"{package_viewN_name}: {name} 缺失文档")
|
||||
messages.append(f"{package_viewN_name}: {name}")
|
||||
|
||||
message_content = "\n".join(messages)
|
||||
|
||||
send_groud_message(client, chat_id, message_content)
|
||||
|
||||
|
||||
@shared_task(include_result=False)
|
||||
def process_new_demand(app_id, app_secret, table_id, record_id, data):
|
||||
|
||||
|
||||
Reference in new issue
Block a user