/admin/communication/templates/{id}/versions
根据模板ID获取该模板的所有历史版本记录。每次更新模板会递增版本号并保存快照,用于变更追溯和版本回退参考。参考:ePrivacy Directive 2002/58/EC、CAN-SPAM Act。
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
|---|---|---|---|---|---|---|---|
id |
path |
string |
Yes | 模板ID |
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | 查询成功,返回版本历史列表 | dto.TemplateVersionListResponse |
| 400 | 请求参数错误 | dto.SimpleResponse |
| 401 | 未认证或令牌无效 | dto.SimpleResponse |
| 403 | 无权访问该资源 | dto.SimpleResponse |
| 404 | 模板不存在 | dto.SimpleResponse |
| 500 | 服务内部错误 | dto.SimpleResponse |
Referenced Schemas
dto.PageInfo
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
has_next |
boolean |
No | HasNext indicates whether there is a next page | ||
has_prev |
boolean |
No | HasPrev indicates whether there is a previous page | ||
page |
integer |
No | Page is the current page number (1-based) | ||
page_size |
integer |
No | PageSize is the number of items per page | ||
total |
integer |
No | Total is the total number of items across all pages | ||
total_pages |
integer |
No | TotalPages is the total number of pages |
dto.SimpleResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
message |
string |
No | |||
timestamp |
string |
No |
dto.TemplateVersionListResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
items |
array of |
No | 统一使用 items | ||
message |
string |
No | |||
pagination |
object |
No | 分页信息(嵌套对象) | ||
timestamp |
string |
No | |||
total |
integer |
No | 总条数(平铺,便于直接读取) |
dto.TemplateVersionResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
changed_by |
string |
No | usr_abc123 |
||
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 |
||
id |
string |
No | tv_abc123 |
||
name |
string |
No | 验证码模板 |
||
subject |
string |
No | 验证码通知 |
||
template_id |
string |
No | tpl_abc123 |
||
text_content |
string |
No | |||
variables |
string |
No | ["code"] |
||
version |
integer |
No | 3 |