@microi.net/cli 5.5.9 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codebuddy-plugin/marketplace.json +2 -2
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/assets/build-meta.json +5 -5
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
- package/scripts/mcp-server.js +99 -99
- package/scripts/microi-cli.js +39 -36
- package/scripts/microi-skills.meta.json +341 -338
- package/skills/.microi-skills-version.json +2 -2
- package/skills/.progressive-disclosure-manifest.json +3566 -3566
- package/skills/README.md +4 -4
- package/skills/ai-engine/SKILL.md +45 -45
- package/skills/ai-platform-governance/SKILL.md +177 -177
- package/skills/ai-platform-governance/references/progressive-01-/345/212/237/350/203/275/345/274/200/345/205/263.md +190 -190
- package/skills/app-store/SKILL.md +21 -4
- package/skills/business-blueprint/SKILL.md +85 -85
- package/skills/datasource-engine/SKILL.md +91 -91
- package/skills/dos-orm/SKILL.md +15 -0
- package/skills/dos-orm/references/api-reference.md +229 -229
- package/skills/email-engine/SKILL.md +80 -80
- package/skills/email-engine/references/v8-email.md +34 -34
- package/skills/job-engine/SKILL.md +154 -154
- package/skills/message-notification/SKILL.md +27 -1
- package/skills/message-notification/agents/openai.yaml +5 -5
- package/skills/message-notification/references/contracts.md +102 -102
- package/skills/microi-ai-app-auth.js +652 -652
- package/skills/microi-ai-application/SKILL.md +102 -102
- package/skills/microi-ai-application/agents/openai.yaml +4 -4
- package/skills/microi-ai-application/references/frontend-baseline.md +164 -164
- package/skills/microi-client-frontend/SKILL.md +47 -41
- package/skills/microi-client-frontend/references/progressive-01-3-/345/212/250/346/200/201/346/214/211/351/222/256/347/263/273/347/273/237.md +4 -4
- package/skills/microi-client-frontend/references/progressive-02-8-/350/277/220/350/241/214/346/227/266/351/253/230/351/242/221/345/235/221/345/244/215/347/233/230.md +30 -30
- package/skills/microi-client-frontend/references/progressive-03-vue3-/345/211/215/347/253/257/345/276/256/346/234/215/345/212/241/345/256/277/344/270/273/350/247/204/345/210/231.md +58 -58
- package/skills/microi-codex/SKILL.md +2 -0
- package/skills/microi-codex-installer/SKILL.md +216 -216
- package/skills/microi-codex-installer/agents/openai.yaml +7 -7
- package/skills/microi-datasource-mapping/SKILL.md +67 -67
- package/skills/microi-db-schema/SKILL.md +6 -6
- package/skills/microi-db-schema/references/core-tables.md +18 -18
- package/skills/microi-db-schema/references/form-component-options.md +256 -256
- package/skills/microi-db-schema/references/schema-overview.md +11 -11
- package/skills/microi-db-schema/references/schema.md +46 -46
- package/skills/microi-db-schema/references/table-catalog.md +57 -57
- package/skills/microi-deployment/SKILL.md +18 -1
- package/skills/microi-deployment/references/deployment-matrix.md +101 -101
- package/skills/microi-docs-coverage/SKILL.md +10 -0
- package/skills/microi-docs-coverage/references/capability-map.md +3 -2
- package/skills/microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs +894 -894
- package/skills/microi-form-engine/SKILL.md +27 -3
- package/skills/microi-form-engine/references/component-catalog.md +218 -218
- package/skills/microi-form-engine/references/data-source-events.md +124 -124
- package/skills/microi-form-layout/SKILL.md +13 -13
- package/skills/microi-form-layout/references/progressive-01-3-/344/270/211/347/247/215/345/210/206/347/273/204/347/232/204/345/255/230/345/202/250/344/270/216/351/205/215/347/275/256.md +235 -235
- package/skills/microi-frontend-sdk/SKILL.md +4 -4
- package/skills/microi-frontend-sdk/references/progressive-01-token-/345/275/223/345/211/215/347/231/273/345/275/225/347/224/250/346/210/267/344/270/216/345/275/223/345/211/215/347/273/210/347/253/257/347/231/273/345/275/225/345/215/217/350/256/256.md +175 -175
- package/skills/microi-left-right-layout/SKILL.md +141 -141
- package/skills/microi-microservice/SKILL.md +2 -1
- package/skills/microi-microservice/references/runtime-delivery.md +278 -278
- package/skills/microi-mobile-app-quality/references/progressive-01-4-/351/207/215/350/246/201/346/214/211/351/222/256/345/277/205/351/241/273/345/270/246/345/233/276/346/240/207.md +213 -213
- package/skills/microi-solution-quotation/SKILL.md +78 -78
- package/skills/microi-solution-quotation/agents/openai.yaml +4 -4
- package/skills/microi-solution-quotation/scripts/build_solution_quote.py +296 -296
- package/skills/microi-sso/SKILL.md +6 -0
- package/skills/microi-sso/references/acceptance.md +49 -49
- package/skills/microi-sso/references/configuration-and-security.md +53 -53
- package/skills/microi-sso/references/inbound.md +53 -53
- package/skills/microi-sso/references/outbound.md +39 -39
- package/skills/microi-system-delivery/SKILL.md +5 -4
- package/skills/microi-system-delivery/references/progressive-02-/350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/345/277/205/351/241/273/350/246/206/347/233/226/347/232/204/345/235/221.md +7 -2
- package/skills/microi-ui/SKILL.md +7 -2
- package/skills/microi-uniapp-frontend/SKILL.md +134 -134
- package/skills/microi-uniapp-frontend/references/progressive-01-/347/247/273/345/212/250/347/253/257/345/210/206/347/261/273-/345/217/214/346/240/217/345/210/227/350/241/250/347/213/254/347/253/213/346/273/232/345/212/250.md +136 -136
- package/skills/microi-uniapp-frontend/references/progressive-02-/345/205/263/351/224/256/344/270/232/345/212/241/350/265/204/344/272/247/344/270/215/345/276/227/351/273/230/350/256/244/351/200/211/344/270/255.md +124 -124
- package/skills/module-engine/SKILL.md +30 -14
- package/skills/ocr-engine/SKILL.md +2 -2
- package/skills/ocr-engine/agents/openai.yaml +1 -1
- package/skills/page-engine/SKILL.md +28 -28
- package/skills/page-engine/references/progressive-01-/346/211/200/346/234/211/347/273/204/344/273/266/347/261/273/345/236/213.md +126 -126
- package/skills/page-engine/references/progressive-02-/347/211/210/346/234/254/345/216/206/345/217/262-/345/271/266/345/217/221/344/277/235/345/255/230/344/270/216/345/233/236/346/273/232.md +42 -42
- package/skills/performance-testing/SKILL.md +120 -120
- package/skills/playwright-e2e/SKILL.md +84 -84
- package/skills/playwright-e2e/references/progressive-01-/345/205/250/350/207/252/345/212/250/347/231/273/345/275/225-/345/205/215/351/252/214/350/257/201/347/240/201-/344/275/206/344/270/215/345/205/215/345/257/206/347/240/201-/345/277/205/350/257/273.md +68 -68
- package/skills/playwright-e2e/references/progressive-02-/346/226/207/345/255/227/345/257/271/346/257/224/345/272/246/344/270/216/345/217/257/350/257/273/346/200/247/350/207/252/345/212/250/345/214/226/346/243/200/346/237/245-/345/277/205/345/201/232.md +64 -64
- package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +20 -20
- package/skills/playwright-e2e/references/progressive-04-ci-/345/273/272/350/256/256.md +69 -69
- package/skills/print-engine/SKILL.md +11 -3
- package/skills/production-readonly-audit/SKILL.md +41 -41
- package/skills/report-engine/SKILL.md +71 -71
- package/skills/scripts/optimize-progressive-disclosure.mjs +204 -204
- package/skills/scripts/refresh-progressive-disclosure.mjs +64 -64
- package/skills/scripts/sync-embedded-skills.mjs +46 -0
- package/skills/scripts/validate-progressive-disclosure.mjs +8 -3
- package/skills/search-engine/SKILL.md +75 -75
- package/skills/spider-engine/SKILL.md +190 -190
- package/skills/system-observability/SKILL.md +169 -157
- package/skills/system-observability/references/memory-incident-triage.md +73 -73
- package/skills/translate-engine/SKILL.md +1 -1
- package/skills/ui-design/SKILL.md +3 -1
- package/skills/uniapp-mall-assets/SKILL.md +170 -170
- package/skills/unity-integration/SKILL.md +155 -155
- package/skills/unity-integration/agents/openai.yaml +4 -4
- package/skills/unity-integration/references/ai-app-delivery.md +103 -103
- package/skills/unity-integration/references/sdk-api.md +82 -82
- package/skills/unity-integration/references/toolbox-migration.md +66 -66
- package/skills/unity-integration/references/webgl-hosting.md +57 -57
- package/skills/v8-api-config/SKILL.md +4 -0
- package/skills/v8-cache-pattern/SKILL.md +306 -306
- package/skills/v8-crud-api/SKILL.md +29 -29
- package/skills/v8-crud-api/references/progressive-01-/346/237/245/350/257/242/345/210/227/350/241/250-/345/210/206/351/241/265.md +56 -56
- package/skills/v8-debugging/SKILL.md +143 -143
- package/skills/v8-explorer-tree/SKILL.md +64 -64
- package/skills/v8-export-import/references/progressive-01-excellayout-/351/253/230/347/272/247/350/207/252/347/224/261/345/270/203/345/261/200.md +201 -201
- package/skills/v8-export-import/references/progressive-02-powerpoint-/345/257/274/345/207/272.md +118 -118
- package/skills/v8-export-import/references/progressive-03-/345/256/211/345/205/250-/346/200/247/350/203/275/346/263/250/346/204/217.md +32 -32
- package/skills/v8-file-upload/SKILL.md +5 -2
- package/skills/v8-file-upload/references/progressive-01-/345/205/254/346/234/211/346/241/266-vs-/347/247/201/346/234/211/346/241/266.md +2 -2
- package/skills/v8-file-upload/references/progressive-02-office-/346/226/207/344/273/266/345/234/250/347/272/277/347/274/226/350/276/221/347/211/210/346/234/254/345/217/267/350/247/204/345/210/231.md +138 -138
- package/skills/v8-formengine-http/SKILL.md +126 -108
- package/skills/v8-frontend-events/SKILL.md +22 -22
- package/skills/v8-frontend-events/references/bluetooth-print-api.md +135 -135
- package/skills/v8-frontend-events/references/bluetooth-print.md +247 -247
- package/skills/v8-frontend-events/references/progressive-01-/345/210/227/350/241/250/344/272/213/344/273/266.md +50 -50
- package/skills/v8-http-integration/SKILL.md +106 -106
- package/skills/v8-http-integration/references/progressive-01-get-/350/257/267/346/261/202.md +31 -31
- package/skills/v8-http-integration/references/progressive-02-/351/224/231/350/257/257/345/244/204/347/220/206/346/250/241/345/274/217.md +5 -5
- package/skills/v8-image-processing/SKILL.md +190 -190
- package/skills/v8-image-processing/agents/openai.yaml +4 -4
- package/skills/v8-image-processing/references/api-reference.md +623 -623
- package/skills/v8-menu-buttons/SKILL.md +103 -103
- package/skills/v8-menu-buttons/references/progressive-01-2-/346/214/211/351/222/256/345/257/271/350/261/241-schema.md +145 -145
- package/skills/v8-menu-buttons/references/progressive-02-8-/346/250/241/345/274/217-f-/345/220/216/345/217/260/344/273/273/345/212/241/346/214/211/351/222/256-/351/225/277/344/273/273/345/212/241.md +228 -228
- package/skills/v8-menu-buttons/references/progressive-03-10-/345/217/215/346/250/241/345/274/217-/351/201/277/345/205/215.md +43 -43
- package/skills/v8-mongodb/SKILL.md +65 -65
- package/skills/v8-mq-mqtt/SKILL.md +175 -175
- package/skills/v8-mq-mqtt/references/mqtt-production.md +342 -342
- package/skills/v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-/347/211/251/350/201/224/347/275/221.md +137 -137
- package/skills/v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs +203 -203
- package/skills/v8-saas-multi-tenant/SKILL.md +223 -223
- package/skills/v8-security/SKILL.md +1 -1
- package/skills/v8-security/references/progressive-01-2-/346/235/203/351/231/220/346/240/241/351/252/214.md +122 -122
- package/skills/v8-sql-query/SKILL.md +7 -5
- package/skills/v8-table-event/SKILL.md +9 -2
- package/skills/v8-table-event/references/progressive-01-informv8-js-/350/241/250/345/215/225/346/211/223/345/274/200/344/272/213/344/273/266.md +1 -1
- package/skills/v8-table-event/references/progressive-02-/345/211/215/347/253/257/344/272/213/344/273/266/345/220/215-v8-eventname-/345/217/257/350/203/275/347/232/204/345/200/274.md +15 -15
- package/skills/v8-tcp-integration/SKILL.md +1 -1
- package/skills/v8-tcp-integration/agents/openai.yaml +4 -4
- package/skills/v8-template-engine/SKILL.md +59 -59
- package/skills/v8-utilities/SKILL.md +92 -92
- package/skills/v8-utilities/references/client-api-index.md +143 -143
- package/skills/v8-utilities/references/platform-http-routes.md +83 -83
- package/skills/v8-utilities/references/server-api-index.md +74 -74
- package/skills/v8-workflow/SKILL.md +13 -4
- package/skills/vision-engine/SKILL.md +19 -19
- package/skills/vision-engine/references/architecture-and-acceptance.md +34 -34
- package/skills/workspace-conventions/SKILL.md +35 -12
- package/skills/workspace-conventions/references/progressive-01-/347/211/210/346/234/254/346/233/264/346/226/260/346/227/245/345/277/227/344/277/235/346/212/244/350/247/204/345/210/231-/345/274/272/345/210/266.md +2 -2
- package/skills/workspace-conventions/references/progressive-02-microi-net-api-/346/234/254/345/234/260/345/220/257/345/212/250/347/272/246/345/256/232.md +179 -179
- package/skills/workspace-conventions/references/progressive-03-cli-/344/270/216-ide-/346/217/222/344/273/266/351/224/231/347/211/210/345/205/261/345/255/230/347/272/246/345/256/232.md +21 -21
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
# 消息通知契约
|
|
2
|
-
|
|
3
|
-
## 表结构并集
|
|
4
|
-
|
|
5
|
-
### `mic_msgset`
|
|
6
|
-
|
|
7
|
-
| 字段 | 用途 |
|
|
8
|
-
|---|---|
|
|
9
|
-
| `Key` | 稳定业务键,租户内唯一 |
|
|
10
|
-
| `Title` | 配置名称/默认标题 |
|
|
11
|
-
| `IsEnable` | 总开关 |
|
|
12
|
-
| `Type` | 多选渠道:微信公众号模板消息、短信、邮件、平台内部 |
|
|
13
|
-
| `Receivers` | 固定接收用户 JSON |
|
|
14
|
-
| `ReceiversRoles` | 固定接收角色 JSON |
|
|
15
|
-
| `WxTplMsgId` | 公众号模板配置 Id |
|
|
16
|
-
| `ChannelApiEngineMap` | 渠道到适配器接口引擎 Key 的 JSON 映射 |
|
|
17
|
-
| `TenantId/TenantName` | 业务层租户信息;不能替代 MCP 的 OsClient 边界 |
|
|
18
|
-
| `TableChild99` | 兼容已有子表配置 |
|
|
19
|
-
|
|
20
|
-
### `wx_tpl_msg`
|
|
21
|
-
|
|
22
|
-
| 字段 | 用途 |
|
|
23
|
-
|---|---|
|
|
24
|
-
| `Key/Title/TemplateId/Content/Remark/LinkUrl` | 模板业务键、标题、微信模板 Id、内容与普通跳转 |
|
|
25
|
-
| `WxMpId/WxMpName` | 发送模板消息的公众号或服务号;关联 `wx_mp` |
|
|
26
|
-
| `MiniProgramId/MiniProgramName` | 可选小程序配置;关联 `wx_mini_program` |
|
|
27
|
-
| `MiniProgramAppId/MiniProgramPagePath` | 模板消息的可选小程序跳转目标 |
|
|
28
|
-
|
|
29
|
-
公众号和服务号都属于微信公众帐号,由 `wx_mp` 保存发送凭据。小程序由 `wx_mini_program` 保存,不能使用小程序 AppId 调用公众号模板消息发送接口。
|
|
30
|
-
|
|
31
|
-
### `mic_msg_event_log`
|
|
32
|
-
|
|
33
|
-
| 字段 | 用途 |
|
|
34
|
-
|---|---|
|
|
35
|
-
| `EventId` | 调用方稳定幂等键 |
|
|
36
|
-
| `MsgEventId` | 关联的消息设置 Id |
|
|
37
|
-
| `ChannelType` | 本条日志对应的渠道 |
|
|
38
|
-
| `ReceiverUserId` | 单一接收用户 Id |
|
|
39
|
-
| `Receivers` | 接收人安全快照 JSON |
|
|
40
|
-
| `Title/MsgContent/LinkUrl/Payload` | 通知展示快照 |
|
|
41
|
-
| `IsRead/ReadTime` | 平台内部通知已读状态 |
|
|
42
|
-
| `IsSuccess/MsgResult` | 分发状态和经过脱敏的结果 |
|
|
43
|
-
|
|
44
|
-
索引基线:
|
|
45
|
-
|
|
46
|
-
- 唯一:`EventId, ChannelType, ReceiverUserId`;共享表模型再前置 `OsClient`。
|
|
47
|
-
- 普通:`ReceiverUserId, ChannelType, IsRead, CreateTime`。
|
|
48
|
-
- `mic_msgset.Key`、`wx_tpl_msg.Key` 在租户业务库内唯一。
|
|
49
|
-
|
|
50
|
-
## V8 接口
|
|
51
|
-
|
|
52
|
-
### `msg_event`
|
|
53
|
-
|
|
54
|
-
输入:
|
|
55
|
-
|
|
56
|
-
```js
|
|
57
|
-
{
|
|
58
|
-
MsgKey: '策略 Key',
|
|
59
|
-
EventId: '稳定幂等键',
|
|
60
|
-
ReceiverUserId: '可选单用户',
|
|
61
|
-
ReceiverUserIds: ['可选用户数组'],
|
|
62
|
-
Title: '可覆盖配置标题',
|
|
63
|
-
Content: '正文',
|
|
64
|
-
LinkUrl: '/#/route',
|
|
65
|
-
Payload: { BusinessId: '...' }
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
处理顺序:校验当前租户与登录上下文 → 读取启用策略 → 合并固定用户、角色用户和参数用户 → 去重/限流 → 按接收人和渠道插入日志 claim → 仅对 claim 成功项分发 → 汇总成功、失败、重复。出现部分失败时仍要提交已经产生的日志与外部副作用,并把失败逐项返回,不能为了漂亮的 `Code` 回滚成功事实。
|
|
70
|
-
|
|
71
|
-
### `msg_internal_list`
|
|
72
|
-
|
|
73
|
-
- 仅返回 `V8.CurrentUser.Id` 的 `ChannelType=平台内部` 记录。
|
|
74
|
-
- 支持 `PageIndex/PageSize`,`PageSize` 最大 100。
|
|
75
|
-
- `DataAppend.UnreadCount` 返回同一用户权威未读数。
|
|
76
|
-
- 每条记录统一投影 `SenderUserId/Account=AI`、`SenderName=AI助手`、`ReadOnly=false`;聊天侧只能固定一个 AI 助手联系人,并将通知权威历史与 AI 聊天历史按时间合并。
|
|
77
|
-
- 兼容旧 `MICROI_PLATFORM_ADMIN/admin` 元数据时只改显示投影,不批量删除或改写 `mic_msg_event_log` 历史事实。
|
|
78
|
-
|
|
79
|
-
### `msg_internal_mark_read`
|
|
80
|
-
|
|
81
|
-
- `{ Id }` 只允许更新当前用户拥有的单条平台内部通知。
|
|
82
|
-
- `{ All: true }` 更新当前用户全部未读平台内部通知。
|
|
83
|
-
- 不接受客户端指定 `ReceiverUserId` 越权操作。
|
|
84
|
-
|
|
85
|
-
### `V8.Notification.Send`
|
|
86
|
-
|
|
87
|
-
`ReceiverUserId/ReceiverUserIds` 必填其一,最多 200 个;`Title` 最长 200 字符;`Content` 与序列化后的 `Payload` 各最多 32 KiB;`LinkUrl` 最长 500 字符且只允许站内路径、锚点、HTTP/HTTPS。事件名固定为 `ReceivePlatformNotification`。
|
|
88
|
-
|
|
89
|
-
## 验收矩阵
|
|
90
|
-
|
|
91
|
-
| 场景 | 断言 |
|
|
92
|
-
|---|---|
|
|
93
|
-
| 重复请求 | 同一接收人/渠道只存在一条日志,适配器不重复产生业务副作用 |
|
|
94
|
-
| 两节点同时发送 | 唯一索引只有一个 claim 成功,两节点都不崩溃 |
|
|
95
|
-
| 写入后节点退出 | 日志仍可查询;发送状态可审计、可补偿 |
|
|
96
|
-
| SignalR/Redis 短故障 | 业务写入不回滚,客户端列表回读恢复 |
|
|
97
|
-
| SignalR Hub 调用聊天运行时 | `StopHttp=1` 保持关闭;仅固定 Key/租户/权威用户绑定的一次性宿主上下文可通过,V8 原子消费一次 |
|
|
98
|
-
| 事务回滚 | 不产生实时通知,业务日志随事务回滚 |
|
|
99
|
-
| 离线用户 | 下次打开通知中心能看到并标记已读 |
|
|
100
|
-
| 越权读取/已读 | 其它用户 Id 无效,记录不改变 |
|
|
101
|
-
| 微信配置 | `WxMpId` 决定发送主体,小程序字段只决定跳转 |
|
|
102
|
-
| 应用安装 | 无密钥、OpenId、历史日志或固定用户;安装后字段/索引/接口回读一致 |
|
|
1
|
+
# 消息通知契约
|
|
2
|
+
|
|
3
|
+
## 表结构并集
|
|
4
|
+
|
|
5
|
+
### `mic_msgset`
|
|
6
|
+
|
|
7
|
+
| 字段 | 用途 |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `Key` | 稳定业务键,租户内唯一 |
|
|
10
|
+
| `Title` | 配置名称/默认标题 |
|
|
11
|
+
| `IsEnable` | 总开关 |
|
|
12
|
+
| `Type` | 多选渠道:微信公众号模板消息、短信、邮件、平台内部 |
|
|
13
|
+
| `Receivers` | 固定接收用户 JSON |
|
|
14
|
+
| `ReceiversRoles` | 固定接收角色 JSON |
|
|
15
|
+
| `WxTplMsgId` | 公众号模板配置 Id |
|
|
16
|
+
| `ChannelApiEngineMap` | 渠道到适配器接口引擎 Key 的 JSON 映射 |
|
|
17
|
+
| `TenantId/TenantName` | 业务层租户信息;不能替代 MCP 的 OsClient 边界 |
|
|
18
|
+
| `TableChild99` | 兼容已有子表配置 |
|
|
19
|
+
|
|
20
|
+
### `wx_tpl_msg`
|
|
21
|
+
|
|
22
|
+
| 字段 | 用途 |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `Key/Title/TemplateId/Content/Remark/LinkUrl` | 模板业务键、标题、微信模板 Id、内容与普通跳转 |
|
|
25
|
+
| `WxMpId/WxMpName` | 发送模板消息的公众号或服务号;关联 `wx_mp` |
|
|
26
|
+
| `MiniProgramId/MiniProgramName` | 可选小程序配置;关联 `wx_mini_program` |
|
|
27
|
+
| `MiniProgramAppId/MiniProgramPagePath` | 模板消息的可选小程序跳转目标 |
|
|
28
|
+
|
|
29
|
+
公众号和服务号都属于微信公众帐号,由 `wx_mp` 保存发送凭据。小程序由 `wx_mini_program` 保存,不能使用小程序 AppId 调用公众号模板消息发送接口。
|
|
30
|
+
|
|
31
|
+
### `mic_msg_event_log`
|
|
32
|
+
|
|
33
|
+
| 字段 | 用途 |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `EventId` | 调用方稳定幂等键 |
|
|
36
|
+
| `MsgEventId` | 关联的消息设置 Id |
|
|
37
|
+
| `ChannelType` | 本条日志对应的渠道 |
|
|
38
|
+
| `ReceiverUserId` | 单一接收用户 Id |
|
|
39
|
+
| `Receivers` | 接收人安全快照 JSON |
|
|
40
|
+
| `Title/MsgContent/LinkUrl/Payload` | 通知展示快照 |
|
|
41
|
+
| `IsRead/ReadTime` | 平台内部通知已读状态 |
|
|
42
|
+
| `IsSuccess/MsgResult` | 分发状态和经过脱敏的结果 |
|
|
43
|
+
|
|
44
|
+
索引基线:
|
|
45
|
+
|
|
46
|
+
- 唯一:`EventId, ChannelType, ReceiverUserId`;共享表模型再前置 `OsClient`。
|
|
47
|
+
- 普通:`ReceiverUserId, ChannelType, IsRead, CreateTime`。
|
|
48
|
+
- `mic_msgset.Key`、`wx_tpl_msg.Key` 在租户业务库内唯一。
|
|
49
|
+
|
|
50
|
+
## V8 接口
|
|
51
|
+
|
|
52
|
+
### `msg_event`
|
|
53
|
+
|
|
54
|
+
输入:
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
{
|
|
58
|
+
MsgKey: '策略 Key',
|
|
59
|
+
EventId: '稳定幂等键',
|
|
60
|
+
ReceiverUserId: '可选单用户',
|
|
61
|
+
ReceiverUserIds: ['可选用户数组'],
|
|
62
|
+
Title: '可覆盖配置标题',
|
|
63
|
+
Content: '正文',
|
|
64
|
+
LinkUrl: '/#/route',
|
|
65
|
+
Payload: { BusinessId: '...' }
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
处理顺序:校验当前租户与登录上下文 → 读取启用策略 → 合并固定用户、角色用户和参数用户 → 去重/限流 → 按接收人和渠道插入日志 claim → 仅对 claim 成功项分发 → 汇总成功、失败、重复。出现部分失败时仍要提交已经产生的日志与外部副作用,并把失败逐项返回,不能为了漂亮的 `Code` 回滚成功事实。
|
|
70
|
+
|
|
71
|
+
### `msg_internal_list`
|
|
72
|
+
|
|
73
|
+
- 仅返回 `V8.CurrentUser.Id` 的 `ChannelType=平台内部` 记录。
|
|
74
|
+
- 支持 `PageIndex/PageSize`,`PageSize` 最大 100。
|
|
75
|
+
- `DataAppend.UnreadCount` 返回同一用户权威未读数。
|
|
76
|
+
- 每条记录统一投影 `SenderUserId/Account=AI`、`SenderName=AI助手`、`ReadOnly=false`;聊天侧只能固定一个 AI 助手联系人,并将通知权威历史与 AI 聊天历史按时间合并。
|
|
77
|
+
- 兼容旧 `MICROI_PLATFORM_ADMIN/admin` 元数据时只改显示投影,不批量删除或改写 `mic_msg_event_log` 历史事实。
|
|
78
|
+
|
|
79
|
+
### `msg_internal_mark_read`
|
|
80
|
+
|
|
81
|
+
- `{ Id }` 只允许更新当前用户拥有的单条平台内部通知。
|
|
82
|
+
- `{ All: true }` 更新当前用户全部未读平台内部通知。
|
|
83
|
+
- 不接受客户端指定 `ReceiverUserId` 越权操作。
|
|
84
|
+
|
|
85
|
+
### `V8.Notification.Send`
|
|
86
|
+
|
|
87
|
+
`ReceiverUserId/ReceiverUserIds` 必填其一,最多 200 个;`Title` 最长 200 字符;`Content` 与序列化后的 `Payload` 各最多 32 KiB;`LinkUrl` 最长 500 字符且只允许站内路径、锚点、HTTP/HTTPS。事件名固定为 `ReceivePlatformNotification`。
|
|
88
|
+
|
|
89
|
+
## 验收矩阵
|
|
90
|
+
|
|
91
|
+
| 场景 | 断言 |
|
|
92
|
+
|---|---|
|
|
93
|
+
| 重复请求 | 同一接收人/渠道只存在一条日志,适配器不重复产生业务副作用 |
|
|
94
|
+
| 两节点同时发送 | 唯一索引只有一个 claim 成功,两节点都不崩溃 |
|
|
95
|
+
| 写入后节点退出 | 日志仍可查询;发送状态可审计、可补偿 |
|
|
96
|
+
| SignalR/Redis 短故障 | 业务写入不回滚,客户端列表回读恢复 |
|
|
97
|
+
| SignalR Hub 调用聊天运行时 | `StopHttp=1` 保持关闭;仅固定 Key/租户/权威用户绑定的一次性宿主上下文可通过,V8 原子消费一次 |
|
|
98
|
+
| 事务回滚 | 不产生实时通知,业务日志随事务回滚 |
|
|
99
|
+
| 离线用户 | 下次打开通知中心能看到并标记已读 |
|
|
100
|
+
| 越权读取/已读 | 其它用户 Id 无效,记录不改变 |
|
|
101
|
+
| 微信配置 | `WxMpId` 决定发送主体,小程序字段只决定跳转 |
|
|
102
|
+
| 应用安装 | 无密钥、OpenId、历史日志或固定用户;安装后字段/索引/接口回读一致 |
|