/internal/notification/event-mappings
内部 API:以 (tenant_id, app_id, event_type, channel) 为唯一键幂等 upsert 映射, 供 seed/运维脚本收敛"某事件应使用哪个模板"。受 InternalAPIKeyMulti 保护。
请求参数
| 名称 | 位置 | 类型 | 必填 | 默认值 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|---|---|
X-Tenant-ID |
header |
string |
是 | 租户ID |
请求体
Schema: service-notification/internal/handler/dto.InternalUpsertEventMappingRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
event_type |
string |
是 | user.registered |
||
template_code |
string |
是 | welcome |
||
channel |
string |
否 | in_app |
空 → in_app | |
is_enabled |
boolean |
否 | 空 → true | ||
priority |
string |
否 | medium |
空 → medium |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 写入成功 | dto.DataResponse-service-notification/internal/handler/dto/EventMappingResponse |
| 400 | 请求参数无效 | service-core/base/dto.SimpleResponse |
| 401 | 未提供有效的X-API-Key | service-core/base/dto.SimpleResponse |
| 500 | 服务内部错误 | service-core/base/dto.SimpleResponse |
引用的 Schema
dto.DataResponse-service-notification/internal/handler/dto/EventMappingResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-notification/internal/handler/dto.EventMappingResponse |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-notification/internal/handler/dto.EventMappingResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
app_id |
string |
否 | |||
channel |
string |
否 | |||
event_type |
string |
否 | |||
id |
string |
否 | |||
is_enabled |
boolean |
否 | |||
priority |
string |
否 | |||
template_code |
string |
否 | |||
tenant_id |
string |
否 |