proto/service/notify.proto

76 lines
2.1 KiB
Protocol Buffer
Raw Normal View History

2023-11-30 03:05:42 +00:00
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";
2023-12-06 04:08:20 +00:00
import "google/api/httpbody.proto";
2023-12-15 10:34:20 +00:00
import "google/protobuf/timestamp.proto";
2023-11-30 03:05:42 +00:00
//定义服务
service notify {
2023-12-06 04:08:20 +00:00
// 邮件注册确认
2023-12-15 10:34:20 +00:00
rpc EmailSend(EmailSendReq) returns (EmailSendRes) {}
2023-12-01 10:01:03 +00:00
// 邮件注册确认
rpc EmailRegisterConfirm(stream EmailStreamReq) returns (stream EmailStreamResp) {}
2023-12-06 04:08:20 +00:00
}
2023-12-15 10:34:20 +00:00
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
2023-12-06 04:08:20 +00:00
message EmailSendReq {
2023-12-15 10:34:20 +00:00
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; // 扩展参数
2023-12-06 04:08:20 +00:00
}
message EmailStreamReq {
string file_name = 1;
string file_content = 2;
}
message EmailStreamResp {
string code = 1;
string ok = 2;
2023-12-06 04:08:20 +00:00
}
2023-12-06 09:13:51 +00:00
message EmailSendRes {
string file_name = 1;
}