adjust node token
continuous-integration/drone/push Build is passing

This commit is contained in:
jianxin committed 2024-04-16 16:42:51 +08:00
1 parent e8e058abb8
commit 2beb23a1d5
3 files changed
+23 -6

No files matched your search

+12 -4
View File
@@ -9,6 +9,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
from app.utils.utils import update_record
@shared_task(include_result=False)
@@ -127,7 +128,7 @@ def sync_xbot_activity_info():
@shared_task(include_result=False)
def process_new_demand(app_id, app_secret, data):
def process_new_demand(app_id, app_secret, table_id, record_id, data):
title = data.get("title")
background = data.get("background")
@@ -143,6 +144,7 @@ def process_new_demand(app_id, app_secret, data):
)
space_id = "7268552249415319554"
bitable_token = os.environ["OFFICE_XBOT_BITABLE_TOKEN"]
# 放官方应用下
if category == "opt5xydmUE":
@@ -151,7 +153,13 @@ def process_new_demand(app_id, app_secret, data):
if category == "optRTwYcra":
parent_node_token = "SvWCwlWJ8iuFKpkXp1rcd9u2n3c"
doc_id = create_doc(client, space_id, parent_node_token, title)
block_id = get_doc_block(client, doc_id)
doc_node_toke = create_doc(client, space_id, parent_node_token, title)
block_id = get_doc_block(client, doc_node_toke)
create_doc_block(client, doc_id, block_id, background, features)
create_doc_block(client, doc_node_toke, block_id, background, features)
doc_node_url = f"https://ying-dao.feishu.cn/wiki/{doc_node_toke}"
update_record(
client, bitable_token, table_id, record_id, {"需求文档链接": doc_node_url}
)