This commit is contained in:
1 parent
cc31732bec
commit
97ee9a03d4
2 files changed
+65
-3
No files matched your search
+2
-2
@@ -145,9 +145,9 @@ def process_new_demand(app_id, app_secret, data):
|
||||
space_id = "7268552249415319554"
|
||||
|
||||
if category == "opt5xydmUE":
|
||||
parent_node_token = "BfyPdfzuyoIg7exaCZycnYoBnIf"
|
||||
parent_node_token = "SvWCwlWJ8iuFKpkXp1rcd9u2n3c"
|
||||
if category == "optRTwYcra":
|
||||
parent_node_token = "FVAJdZ9cDoK7MHxGNMcccP37nch"
|
||||
parent_node_token = "F4ivwKrgyiQ4zOkuLVFcTq9Bnee"
|
||||
|
||||
doc_id = create_doc(client, space_id, parent_node_token, title)
|
||||
block_id = get_doc_block(client, doc_id)
|
||||
|
||||
+63
-1
@@ -3,6 +3,7 @@ import os
|
||||
import http
|
||||
import requests
|
||||
import lark_oapi as lark
|
||||
from dotenv import load_dotenv
|
||||
|
||||
import lark_oapi as lark
|
||||
from lark_oapi.api.docx.v1 import *
|
||||
@@ -223,6 +224,34 @@ def create_doc_block(
|
||||
.build()
|
||||
)
|
||||
.build(),
|
||||
Block.builder()
|
||||
.block_type(4)
|
||||
.heading2(
|
||||
Text.builder()
|
||||
.elements(
|
||||
[
|
||||
TextElement.builder()
|
||||
.text_run(TextRun.builder().content("需求实现").build())
|
||||
.build(),
|
||||
]
|
||||
)
|
||||
.build()
|
||||
)
|
||||
.build(),
|
||||
Block.builder()
|
||||
.block_type(4)
|
||||
.heading2(
|
||||
Text.builder()
|
||||
.elements(
|
||||
[
|
||||
TextElement.builder()
|
||||
.text_run(TextRun.builder().content("常见问题").build())
|
||||
.build(),
|
||||
]
|
||||
)
|
||||
.build()
|
||||
)
|
||||
.build(),
|
||||
]
|
||||
)
|
||||
.index(0)
|
||||
@@ -253,7 +282,40 @@ def create_doc_block(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
load_dotenv()
|
||||
|
||||
app_id = os.environ["APP_ID"]
|
||||
app_secret = os.environ["APP_SECRET"]
|
||||
|
||||
data = {
|
||||
"title": "测试",
|
||||
"features": "测试",
|
||||
"background": "测试",
|
||||
"category": "opt5xydmUE",
|
||||
}
|
||||
|
||||
title = data.get("title")
|
||||
background = data.get("background")
|
||||
features = data.get("features")
|
||||
category = data.get("category")
|
||||
|
||||
client = (
|
||||
lark.Client.builder()
|
||||
.app_id(app_id)
|
||||
.app_secret(app_secret)
|
||||
.log_level(lark.LogLevel.DEBUG)
|
||||
.build()
|
||||
)
|
||||
|
||||
space_id = "7268552249415319554"
|
||||
|
||||
# 官方应用
|
||||
if category == "opt5xydmUE":
|
||||
parent_node_token = "SvWCwlWJ8iuFKpkXp1rcd9u2n3c"
|
||||
if category == "optRTwYcra":
|
||||
parent_node_token = "F4ivwKrgyiQ4zOkuLVFcTq9Bnee"
|
||||
|
||||
doc_id = create_doc(client, space_id, parent_node_token, title)
|
||||
|
||||
pass
|
||||
|
||||
|
||||
Reference in new issue
Block a user