PUT /admin/communication/templates/{id}
更新指定模板的名称、内容、变量列表等字段。更新后自动递增模板版本号,旧版本保留在版本历史中。支持修改模板的激活状态。参考:ePrivacy Directive 2002/58/EC、CAN-SPAM Act。
通信服务 `bearerAuth` application/json
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
id |
path |
string |
Yes |
|
|
|
模板ID |
Request Body
Schema: dto.UpdateTemplateRequest
| Field | Type | Required | Example | Constraints | Description |
content |
string |
No |
您的验证码是{code},10分钟内有效 |
|
|
content_type |
string |
No |
text |
|
|
description |
string |
No |
更新版验证码模板 |
|
|
format |
string |
No |
go-template |
|
|
is_active |
boolean |
No |
True |
|
|
name |
string |
No |
验证码模板v2 |
|
|
subject |
string |
No |
验证码通知v2 |
|
|
text_content |
string |
No |
Your code is {code}, valid for 10 min |
|
|
variables |
array of
string |
No |
['["code"]'] |
|
|
Referenced Schemas
dto.MessageTemplateDetailResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
data |
dto.MessageTemplateResponse |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|
dto.MessageTemplateResponse
消息模板数据
| Field | Type | Required | Example | Constraints | Description |
channel |
string |
No |
sms |
|
|
code |
string |
No |
verify_code |
|
|
content |
string |
No |
您的验证码是{code},5分钟内有效 |
|
|
content_type |
string |
No |
text |
|
|
created_at |
string |
No |
2026-04-15T10:00:00Z |
|
|
description |
string |
No |
用于发送登录验证码 |
|
|
id |
string |
No |
tpl_abc123 |
|
|
is_active |
boolean |
No |
True |
|
|
name |
string |
No |
验证码模板 |
|
|
subject |
string |
No |
验证码通知 |
|
|
tenant_id |
string |
No |
tnt_xyz789 |
|
|
updated_at |
string |
No |
2026-04-15T10:00:00Z |
|
|
variables |
array of
string |
No |
['["code"]'] |
|
|
version |
integer |
No |
1 |
|
|
dto.SimpleResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|