/admin/notifications/templates
创建一个新的通知模板,用于后续基于模板发送通知 参考:CAN-SPAM Act (15 U.S.C. §7701) — Commercial Email Compliance。
Request Body
Schema: dto.CreateTemplateRequest
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
string |
Yes | welcome_notification |
||
content |
string |
Yes | 亲爱的{{user_name}} |
||
name |
string |
Yes | welcome_notification |
||
subject |
string |
Yes | 欢迎加入{{app_name}} |
||
type |
string |
Yes | system |
||
format |
string |
No | simple |
||
variables |
array of string |
No | ['["user_name"]'] |
Responses
| Status | Description | Schema |
|---|---|---|
| 201 | 创建成功 | dto.TemplateDetailResponse |
| 400 | 请求参数错误 | gitee_com_linmes_authms_base_dto.SimpleResponse |
| 401 | 未认证 | gitee_com_linmes_authms_base_dto.SimpleResponse |
| 403 | 权限不足 | gitee_com_linmes_authms_base_dto.SimpleResponse |
| 404 | 资源未找到 | gitee_com_linmes_authms_base_dto.SimpleResponse |
| 500 | 服务内部错误 | gitee_com_linmes_authms_base_dto.SimpleResponse |
Referenced Schemas
dto.TemplateDetailResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
data |
dto.TemplateResponse |
No | |||
message |
string |
No | |||
timestamp |
string |
No |
dto.TemplateResponse
通知模板信息
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
content |
string |
No | 亲爱的{{user_name}},欢迎加入{{app_name}}! |
内容 | |
created_at |
string |
No | 2026-01-01T00:00:00Z |
创建时间 | |
name |
string |
No | welcome_notification |
模板名称 | |
subject |
string |
No | 欢迎加入{{app_name}} |
主题 | |
template_id |
string |
No | tpl_abc123 |
模板ID | |
type |
string |
No | system |
类型 | |
variables |
array of string |
No | ['["user_name"', '"app_name"]'] |
变量 |
gitee_com_linmes_authms_base_dto.SimpleResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
message |
string |
No | |||
timestamp |
string |
No |