Skip to content

Commit 5307260

Browse files
committed
refactor(TaskAppService): remove file URL retrieval and content handling logic
1 parent 88185c9 commit 5307260

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

backend/super-magic-module/src/Application/SuperAgent/Event/Subscribe/TopicTaskMessageSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
exchange: 'super_magic_topic_task_message',
2727
routingKey: 'super_magic_topic_task_message',
2828
queue: 'super_magic_topic_task_message',
29-
nums: 3
29+
nums: 1
3030
)]
3131
class TopicTaskMessageSubscriber extends ConsumerMessage
3232
{

backend/super-magic-module/src/Application/SuperAgent/Service/TaskAppService.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -794,18 +794,6 @@ private function getOutputContent(TaskContext $taskContext, array $attachments,
794794
}
795795

796796
if (! empty($file)) {
797-
// 获取文件URL
798-
$fileLink = $this->fileAppService->getLink(
799-
$taskContext->getDataIsolation()->getCurrentOrganizationCode(),
800-
$file['file_key']
801-
);
802-
if (empty($fileLink)) {
803-
// 如果获取URL失败,跳过
804-
return;
805-
}
806-
$fileUrl = $fileLink->getUrl();
807-
// 读取文件内容,放到 content 中
808-
$content = file_get_contents($fileUrl);
809797
$tool = [
810798
'id' => (string) IdGenerator::getSnowId(),
811799
'name' => 'finish_task',
@@ -815,7 +803,8 @@ private function getOutputContent(TaskContext $taskContext, array $attachments,
815803
'type' => $file['file_extension'] === 'html' ? 'html' : ($file['file_extension'] === 'md' ? 'md' : 'text'),
816804
'data' => [
817805
'file_name' => $file['filename'],
818-
'content' => $content,
806+
'content' => '',
807+
'file_id' => $file['file_id'],
819808
],
820809
],
821810
'remark' => '',

0 commit comments

Comments
 (0)