add some features
continuous-integration/drone/push Build is passing

This commit is contained in:
jianxin committed 2024-06-06 17:59:59 +08:00
1 parent ae3428d422
commit 60d4f2a8e3
3 files changed
+50 -14

No files matched your search

+32 -4
View File
@@ -9,8 +9,8 @@ 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.utils import update_record
from app.utils.yd_utils import new_blank_robot
from app.utils.utils import update_record, add_record
from app.utils.yd_utils import new_blank_robot, new_blank_activity
def parse_history_message(data):
@@ -275,5 +275,33 @@ def process_new_demand(app_id, app_secret, table_id, record_id, data):
@shared_task(include_result=False)
def process_new_robot():
new_blank_robot("测试-根据需求生成应用")
def process_new_robot(app_id, app_secret, action_data):
user_id = action_data["deal_person_id"]
name = action_data["title"]
category = action_data.get("category")
robot_uuid = ""
catagory_table_record = {"UUID": robot_uuid, "名称": name, "分类": "官方指令"}
if category == "opt5xydmUE":
robot_uuid = new_blank_robot(name, user_id)
catagory_table_record["分类"] = "官方应用"
if category == "optRTwYcra":
robot_uuid = new_blank_activity(name, user_id)
catagory_table_record["分类"] = "官方指令"
# 更新多维表格分类管理
table_id = "tbl2GcBvkvMtOBnl"
bitable_token = os.environ["OFFICE_XBOT_BITABLE_TOKEN"]
# 在开发计划中创建记录
client = (
lark.Client.builder()
.app_id(app_id)
.app_secret(app_secret)
.log_level(lark.LogLevel.DEBUG)
.build()
)
add_record(client, bitable_token, table_id, catagory_table_record)