proto/service/notify.proto
huangsimin@fusen.cn decff6f2e6 update
2023-12-15 18:34:20 +08:00

76 lines
2.1 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3"; //版本声明使用v3版本
package notify;
option go_package = "gitlab.fusenpack.com/backend/notify;service";
// 导入google/api/annotations.proto 注释依赖
import "google/api/annotations.proto";
import "service/basic.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/any.proto";
import "google/api/httpbody.proto";
import "google/protobuf/timestamp.proto";
//定义服务
service notify {
// 邮件注册确认
rpc EmailSend(EmailSendReq) returns (EmailSendRes) {}
// 邮件注册确认
rpc EmailRegisterConfirm(stream EmailStreamReq) returns (stream EmailStreamResp) {}
}
message Operator {
// 操作类型
enum Type {
IMMEDIATE_RESEND = 0; // 马上重发
NORMAL_SEND = 1; // 普通发送
SCHEDULED_SEND = 2; // 计划发送
CANCEL_SEND = 3; // 取消发送
}
message Retry {
int64 retry_count = 1; // 允许重发次数
google.protobuf.Timestamp interval_time = 2; // 执行的时间间隔
}
Type type = 1; // 操作类型
optional Retry retry = 2; //重试
optional google.protobuf.Timestamp start_time = 3; // 在这个时间开始执行
}
// 默认是 type email
message EmailSendReq {
string notify_id = 1; // 用于处理唯一的任务,重发都会被利用到 256字节
string sender = 2; // 发送者
string title = 3; // 邮件标题
string content = 4; // 邮件内容
string target_email = 5; // 发送的目标email
Operator operator = 6; // 操作类型
// string company_name = 5; // fs公司名
// string confirmation_link = 6; // fs确认连接
// string sender_name = 7; // 发送人
optional google.protobuf.Struct metadata = 7; // 扩展参数
}
message EmailStreamReq {
string file_name = 1;
string file_content = 2;
}
message EmailStreamResp {
string code = 1;
string ok = 2;
}
message EmailSendRes {
string file_name = 1;
}