/internal/notification/templates
内部API,由seed脚本调用,通过请求体直接传入模板title、locale等信息创建模板。受InternalAPIKeyMulti保护。
请求体
Schema: service-notification/internal/handler/dto.InternalCreateTemplateRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
string |
否 | |||
content |
string |
否 | |||
format |
string |
否 | |||
locale |
string |
否 | |||
name |
string |
否 | |||
priority |
string |
否 | |||
title |
string |
否 | |||
type |
string |
否 | |||
variables |
array of string |
否 |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 201 | 创建成功 | dto.DataResponse-service-notification/internal/handler/dto/TemplateResponse |
| 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/TemplateResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-notification/internal/handler/dto.TemplateResponse |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-notification/internal/handler/dto.TemplateResponse
通知模板信息
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
content |
string |
否 | 亲爱的{{user_name}},欢迎加入{{app_name}}! |
内容 | |
created_at |
string |
否 | 2026-01-01T00:00:00Z |
创建时间 | |
name |
string |
否 | welcome_notification |
模板名称 | |
subject |
string |
否 | 欢迎加入{{app_name}} |
主题 | |
template_id |
string |
否 | tpl_abc123 |
模板ID | |
type |
string |
否 | system |
类型 | |
variables |
array of string |
否 | ['["user_name"', '"app_name"]'] |
变量 |