From dc37dd2c34d49cb340ea7fae0dd5d3fac031d924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AD=E9=80=B8?= Date: Fri, 21 Aug 2026 09:56:48 +0800 Subject: [PATCH] fix(oa): remove DDAttachment from unsupported table and use testseam.Swap to #666 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 从 oa-form-components.md (mono/multi) 的"API 不支持的控件"表中移除 DDAttachment,避免 Agent 误判为不支持 - computeFileMD5 测试注入改为 testseam.Swap,符合仓库包变量注入约定 --- internal/helpers/oa_attachment_test.go | 6 ++---- skills/mono/references/products/oa/oa-form-components.md | 1 - .../multi/dingtalk-misc/references/oa/oa-form-components.md | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/helpers/oa_attachment_test.go b/internal/helpers/oa_attachment_test.go index 52d6a38c..66f1d83b 100644 --- a/internal/helpers/oa_attachment_test.go +++ b/internal/helpers/oa_attachment_test.go @@ -686,11 +686,9 @@ func TestCrossPlatformCoverageOAAttachmentUploadMD5Failure(t *testing.T) { filePath, _ := writeOAAttachmentTempFile(t, "test.bin", "hello") put := mockOAAttachmentPut(t) - original := computeFileMD5 - computeFileMD5 = func(string) (string, error) { + testseam.Swap(t, &computeFileMD5, func(string) (string, error) { return "", errors.New("permission denied") - } - t.Cleanup(func() { computeFileMD5 = original }) + }) caller := &scriptedToolCaller{format: "json"} _, err := executeOAAttachmentCommandCapturingOutput(t, caller, diff --git a/skills/mono/references/products/oa/oa-form-components.md b/skills/mono/references/products/oa/oa-form-components.md index b54408e3..7da45277 100644 --- a/skills/mono/references/products/oa/oa-form-components.md +++ b/skills/mono/references/products/oa/oa-form-components.md @@ -328,7 +328,6 @@ | 流水号 | `SeqNumberField` | 由系统自动生成 | | OCR 文本识别 | `OcrTextField` | 需要客户端 OCR 交互 | | OCR 身份证识别 | `OcrIdCardField` | 需要客户端 OCR 交互 | -| 附件控件 | `DDAttachment` | 已支持:value 需要 spaceId、fileName、fileSize、fileType、fileId,先用 `dws oa approval attachment upload --file ` 上传获取再组装提交 | > **部分支持的控件:** `DDPhotoField`(图片控件)**支持通过 URL 直接提交**,但不支持本地文件上传(CLI 未封装钉盘 CDN 上传流程)。若用户只有本地文件,需告知在钉钉客户端补充。详见本文 [DDPhotoField](#ddphotofield图片控件) 章节。 diff --git a/skills/multi/dingtalk-misc/references/oa/oa-form-components.md b/skills/multi/dingtalk-misc/references/oa/oa-form-components.md index 2b319dcc..ab985fd9 100644 --- a/skills/multi/dingtalk-misc/references/oa/oa-form-components.md +++ b/skills/multi/dingtalk-misc/references/oa/oa-form-components.md @@ -328,7 +328,6 @@ | 流水号 | `SeqNumberField` | 由系统自动生成 | | OCR 文本识别 | `OcrTextField` | 需要客户端 OCR 交互 | | OCR 身份证识别 | `OcrIdCardField` | 需要客户端 OCR 交互 | -| 附件控件 | `DDAttachment` | 已支持:value 需要 spaceId、fileName、fileSize、fileType、fileId,先用 `dws oa approval attachment upload --file ` 上传获取再组装提交 | > **部分支持的控件:** `DDPhotoField`(图片控件)**支持通过 URL 直接提交**,但不支持本地文件上传(CLI 未封装钉盘 CDN 上传流程)。若用户只有本地文件,需告知在钉钉客户端补充。详见本文 [DDPhotoField](#ddphotofield图片控件) 章节。