POST /internal/communication/send

提供给内部微服务调用的统一消息发送接口。支持短信、邮件、推送三种渠道,支持模板发送和内容直发两种模式。创建真实发送记录到数据库并异步尝试发送。使用 InternalAPIKeyAuth 认证。参考:ePrivacy Directive 2002/58/EC、CAN-SPAM Act。

通信服务 None application/json

请求体

Schema: service-communication/internal/handler/dto.InternalSendRequest

字段类型必填示例约束描述
channel string 是 email
to string 是 user@example.com
content string 否 您的验证码是123456
metadata object 否 extra keys: `string`
subject string 否 账户激活
template string 否 welcome
user_id string 否 usr_abc123
variables object 否 extra keys: `string`

响应

状态描述Schema
200消息已入队/发送,返回消息ID和状态service-communication/internal/handler/dto.InternalSendDetailResponse
400请求参数错误dto.SimpleResponse
500服务内部错误dto.SimpleResponse

引用的 Schema

dto.SimpleResponse

字段类型必填示例约束描述
code integer 否
message string 否
timestamp string 否

service-communication/internal/handler/dto.InternalSendDetailResponse

字段类型必填示例约束描述
code integer 否
data service-communication/internal/handler/dto.InternalSendResponse 否
message string 否
timestamp string 否

service-communication/internal/handler/dto.InternalSendResponse

内部统一发送接口的响应信息

字段类型必填示例约束描述
channel string 否 email
message_id string 否 internal-1234567890
status string 否 queued
to string 否 user@example.com