25d895d 🐛 fix(gitea_workflow): clean up temp repos after job steps 2bc3b11 🐛 fix(gitea_workflow): clean up temporary repo dirs in workflows 98c3f30 📝 docs(agent_rules): allow plan execution on current branch 16c7230 📝 docs(prompts): define custom verify layering 8efc4dd 🐛 fix(skills): quote commit-message description bc8498f 🐛 fix(ci): install tomli for gitea tests 55cda3b 🐛 fix(tests): report missing toml parser clearly c0729c7 🐛 fix(playbook): import Optional for cli compatibility 63e24bf 📦 deps(skills): sync thirdparty skills d2f9356 🐛 fix(ci): isolate gitea workflow repos 588b81d 🐛 fix(ci): inline gitea workflow bootstrap e0b1c3a ♻️ refactor(skills): standardize first-party skill contracts 2c5050d ♻️ refactor(skills): rename repo skills source dir f049dfb 📦 deps(skills): drop duplicate first-party superpowers skills 234b335 ✨ feat(workflow): add superpowers planning and execution state tracking c1702a6 📝 docs(markdown): format tracked markdown and drop stale templates 2325409 📝 docs(markdown): clarify optional markdownlint usage 214c44e 🔧 chore(markdown): add markdownlint baseline and lint fixes a22b324 📝 docs(templates): add execution and memory-bank prompt templates 223a797 📝 docs(templates): update README for Claude Code and current features 4ac8672 📝 docs: simplify README + platform-agnostic tools + auto-create local rules 2431c9d 📝 docs: add claude_md config and use cross-platform paths d64b248 📝 docs: fix README.md inaccuracies and add Claude Code info c8d6bf2 🐛 fix(playbook): use relative paths in CLAUDE.md when not at project root 6518f0f ✨ feat(playbook): auto-create CLAUDE.md with path discovery 6ec9a45 ✨ feat(skills): add skill_link symlink support + platform-agnostic prompt 9f8b6b5 📝 docs: update README and config example for Claude Code support 79cff6c 📝 docs(skills): add Claude Code platform support 452c6f5 ✨ feat(playbook): auto-inject AGENTS.md into CLAUDE.md e1dbf3c 🐛 fix(skills): remove dual-path from commit-message skill f3a7259 🔧 chore(ci): use prepare_repo.sh in both workflows da08212 🔧 chore(ci): extract prepare_repo.sh and clean up workflows 7ade85e 🗑️ remove(tsl): drop syntax_book/, data/ source and build script f94dba0 ♻️ refactor(skills): update playbook.py and tests for thirdparty/ layout b3df412 ♻️ refactor(skills): separate thirdparty skills into thirdparty/ subdirectory 64950e7 📦 deps(skills): sync thirdparty skills a2e3cb0 ✨ feat(playbook): add no_backup deploy controls 8609d59 🐛 fix(docs): repair reference catalog source links 956da11 🐛 fix(playbook): publish hidden ci test fixes 3f67754 📦 deps(skills): sync thirdparty skills 08ca87b 📦 deps(skills): add karpathy thirdparty sync 96b705b 📝 docs(tsl): rebuild canonical syntax and routing manual 3ed5052 📦 deps(skills): sync thirdparty skills 60108dd 📦 deps(skills): sync thirdparty skills da85d4e 🐛 fix(thirdparty): prune nested project snapshots a2a697e 📦 deps(skills): sync thirdparty skills 9df610a 🐛 fix(thirdparty): exclude duplicated superpowers skills 33dd5bb 🐛 fix(thirdparty): preserve optional manifest fields 91b0ea7 🐛 fix(thirdparty): preserve manifest during snapshot update 2e26f98 🔧 chore(thirdparty): generalize skills sync pipeline 5b9c1e3 📦 deps(skills): sync superpowers 2f2d34a 📝 docs(readme): normalize subtree command spacing 62db7db 🐛 fix(ci): serialize superpowers update and sync 3463223 🐛 fix(ci): use literal superpowers sync paths 48f6de8 📦 deps(skills): sync superpowers 4b23529 🔧 chore(ci): merge superpowers update and sync workflow a56d75b 📦 deps(skills): sync superpowers 84bcefa 🔧 chore(ci): use ci[bot] commit author name 00a07e5 📦 deps(skills): sync superpowers 7b84daf 🐛 fix(templates): enforce main loop progress tracking 51373d7 🔧 chore(ci): automate superpowers sync workflow eaaa39c 🐛 fix(ci): prevent stale superpowers sync from restoring skills block 79755c6 📦 deps(skills): sync superpowers 836d878 📦 deps(skills): sync superpowers 8216c9f 📦 deps(skills): sync superpowers 9439505 🐛 fix(playbook): address reported repo issues git-subtree-dir: docs/standards/playbook git-subtree-split: 25d895d8b3f56624ccfe99ad7289e9eb49e0f316
88 lines
3.7 KiB
Markdown
88 lines
3.7 KiB
Markdown
# 发送微信消息使用说明
|
|
|
|
文档类型:模块摘要
|
|
是否可直接用于生成代码:仅部分
|
|
是否含已验证可执行示例:否
|
|
是否含已验证反例:否
|
|
遇到不确定时跳转到:调用侧账户体系文档、项目实际接口说明、[index.md](index.md)
|
|
|
|
本页用于确认接口名称、参数含义和风险边界,不替代项目级接入文档。
|
|
|
|
## 适用场景
|
|
|
|
- 通过“天软科技服务号”向微信客户端发送模板消息。
|
|
- 支持同步/异步发送,异步可用消息 ID 查询状态。
|
|
|
|
## 前置条件
|
|
|
|
- 用户关注并绑定天软科技服务号,获得 `userid`。
|
|
- 给他人发送消息需对方授权其 `userid`。
|
|
|
|
## 核心接口
|
|
|
|
- `send_wechat_message(userid, url, title, first, remark[, k1..k6])`
|
|
- 同步发送;成功返回 `success`,否则返回错误信息。
|
|
- `send_wechat_message_async(userid, url, title, first, remark[, k1..k6])`
|
|
- 异步发送;返回 16 位消息 ID(时间戳 + 随机数)。
|
|
- `get_wechat_message_status(userid, username, wechat_message_id)`
|
|
- 查询异步发送结果;返回 “成功” 或错误信息。
|
|
|
|
## 参数说明(模板消息)
|
|
|
|
- `userid`:绑定账户后获取的用户标识(必需)。
|
|
- `username`:查询异步发送状态时使用的用户名 / 账户标识;当前页只确认查询接口需要它,具体来源以项目实际账户体系或调用侧约定为准。如果调用侧拿不到该值,当前页不支持生成状态查询代码。
|
|
- `url`:详情地址(必需,可为空字符串)。
|
|
- `title`:模板消息标题(必需)。
|
|
- `first`:副标题(一般需要)。
|
|
- `remark`:备注(一般需要)。
|
|
- `k1..k6`:模板关键字参数(根据模板类型变化)。常见模板示例:
|
|
- 监控报告通知:运行状态/时间
|
|
- 系统运行简报:系统名称/简报内容/发布时间
|
|
- 告警通知:告警内容/发生时间
|
|
|
|
## 同步 vs 异步
|
|
|
|
- 同步:阻塞等待结果,适合紧急通知。
|
|
- 异步:立即返回,适合非紧急通知;用 `get_wechat_message_status` 查询。
|
|
- 如果你无法确认 `username` 的来源,不要自行猜测;先回调用侧或账户体系文档确认。
|
|
|
|
## 当前只确认的范围
|
|
|
|
- 当前页已经确认的范围是:发送接口名、异步发送会返回消息 ID、状态查询接口需要 `userid` + `username` + `wechat_message_id`。
|
|
- 当前页没有确认的范围是:`username` 的正式来源、不同模板关键字的完整映射、项目侧的统一封装方式。
|
|
|
|
## 不要猜的部分
|
|
|
|
- 不要把 `"username"` 当成可用实参,也不要凭空拼接账户名。
|
|
- 如果调用侧没有提供 `username`,当前页只支持生成发送代码,不支持生成状态查询代码。
|
|
- `k1..k6` 的含义随模板类型变化;需要和具体模板一起核对。
|
|
|
|
## 发送示例(配置片段,可参考参数组织)
|
|
|
|
代码块身份:配置片段 / 概念骨架
|
|
代码块说明:可参考参数组织,不是已验证可执行示例。
|
|
|
|
```tsl
|
|
// 定义参数
|
|
url := "http://tinysoft.com.cn";
|
|
user_id := "190F1826267E0EB45658FB81836636A7";
|
|
|
|
title := "监控报告通知";
|
|
first := "运行状态";
|
|
keyword_1 := "运行正常";
|
|
keyword_2 := "";
|
|
DateTimeToString(keyword_2, "YYYY-MM-DD HH:NN:SS", Now());
|
|
remark := "如有疑问请与技术人员联系!";
|
|
|
|
// 同步发送
|
|
echo send_wechat_message(user_id, url, title, first, remark, keyword_1, keyword_2);
|
|
|
|
// 异步发送
|
|
wechat_message_id := send_wechat_message_async(user_id, url, title, first, remark, keyword_1, keyword_2);
|
|
```
|
|
|
|
## 状态查询示例
|
|
|
|
- 当前页不提供状态查询代码块。
|
|
- 只有在调用侧已经明确提供 `username` 来源时,才继续生成 `get_wechat_message_status(...)` 调用。
|