添加新的notify接口

This commit is contained in:
huangsimin@fusen.cn
2024-01-09 18:26:05 +08:00
parent 2ff371bbb9
commit 5093ca325c
2 changed files with 112 additions and 27 deletions

View File

@@ -37,3 +37,4 @@ message Meta {
int64 current_page=3; int64 current_page=3;
int64 per_page=4; int64 per_page=4;
} }

View File

@@ -8,68 +8,152 @@ import "google/api/annotations.proto";
import "service/basic.proto"; import "service/basic.proto";
import "google/protobuf/struct.proto"; import "google/protobuf/struct.proto";
import "google/protobuf/any.proto"; import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/api/httpbody.proto"; import "google/api/httpbody.proto";
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
//定义服务 //定义服务
service notify { service notify {
// 邮件注册确认
// 心跳
rpc Ping(basic.Request) returns (basic.Response) {}
// 邮件发送基础版本
rpc EmailSend(EmailSendReq) returns (EmailSendRes) {} rpc EmailSend(EmailSendReq) returns (EmailSendRes) {}
// 邮件注册确认 // 邮件注册确认
rpc EmailRegisterConfirm(stream EmailStreamReq) returns (stream EmailStreamResp) {} rpc EmailRegisterConfirm( EmailRegisterReq) returns ( EmailRegisterResp) {}
}
// 邮件重置密码的填写页面
rpc EmailResetPasswordHtml( EmailResetHtmlReq) returns (EmailResetHtmlResp) {}
// 邮件重置密码的确认
rpc EmailResetConfirm( EmailResetConfirmReq) returns (EmailResetConfirmResp) {}
// 订单 支付详情
rpc OrderPaymentDetails( OrderPaymentDetailsReq) returns (OrderPaymentDetailsResp) {}
// 订单 状态流转
rpc OrderStatusTransition( OrderStatusTransitionReq) returns (OrderStatusTransitionResp) {}
}
message Operator { message Operator {
// 操作类型 // 操作类型
enum Type { enum Type {
IMMEDIATE_RESEND = 0; // 马上重发 immediate_resend = 0; // 马上重发(覆盖当前的发送任务,等于重置)
NORMAL_SEND = 1; // 普通发送 normal_send = 1; // 标准发送(可以设置时间和重发的次数)
SCHEDULED_SEND = 2; // 计划发送 cancel_send = 2; // 取消发送(取消当前的发送)
CANCEL_SEND = 3; // 取消发送
} }
message Retry { message Retry {
int64 retry_count = 1; // 允许重发次数 int64 retry_count = 1; // 允许重发次数
google.protobuf.Timestamp interval_time = 2; // 执行的时间间隔 int64 interval_time = 2; // 执行的时间间隔 sec 用秒为单位
} }
Type type = 1; // 操作类型 Type type = 1; // 操作类型
optional Retry retry = 2; //重试 optional Retry retry = 2; //重试
optional google.protobuf.Timestamp start_time = 3; // 在这个时间开始执行 optional google.protobuf.Timestamp start_time = 3; // 在这个时间开始执行
optional google.protobuf.Timestamp last_send_time = 4; // 上次发送的时间
} }
message EmailNotifyBasic {
optional string notify_id = 1; // 用于处理唯一的任务,重发都会被利用到 256字节
string sender = 2; // 发送者
string target_email = 3; // 发送的目标email
}
// 默认是 type email // 默认是 type email
message EmailSendReq { message EmailSendReq {
EmailNotifyBasic basic_email = 1;
string notify_id = 1; // 用于处理唯一的任务,重发都会被利用到 256字节 string title = 2; // 邮件标题
string sender = 2; // 发送者 string content = 3; // 邮件内容
string title = 3; // 邮件标题 Operator operator = 4; // 操作类型
string content = 4; // 邮件内容
string target_email = 5; // 发送的目标email
Operator operator = 6; // 操作类型
// string company_name = 5; // fs公司名 // string company_name = 5; // fs公司名
// string confirmation_link = 6; // fs确认连接 // string confirmation_link = 6; // fs确认连接
// string sender_name = 7; // 发送人 // string sender_name = 7; // 发送人
optional google.protobuf.Struct metadata = 7; // 扩展参数 optional google.protobuf.Struct metadata = 5; // 扩展参数
} }
message EmailStreamReq { // 消息类型
string file_name = 1; enum NotifyType {
string file_content = 2; email = 0; // email
feishu = 1; // 飞书
wechat = 2; // 微信
} }
message EmailStreamResp {
string code = 1; // 操作类型
string ok = 2; enum EmailStatus {
ok = 0; // 成功
running = 1; // 进行中
error = 2; // 处理错误
cancel = 3; // 已经被取消
finish = 4; // 结束
} }
message EmailSendRes { message EmailSendRes {
string file_name = 1; EmailStatus status = 1;
string msg = 2;
}
message EmailRegisterReq {
EmailNotifyBasic basic_email = 1;
string confirmation_link = 2;
}
message EmailRegisterResp {
int64 code = 1; // 0成功 其他异常
string notify_id = 2; // 通知id
}
message EmailResetHtmlReq {
EmailNotifyBasic basic_email = 1;
string confirmation_link = 4;
}
message EmailResetHtmlResp {
int64 code = 1; // 0成功 其他异常
string notify_id = 2; // 通知id
}
message EmailResetConfirmReq {
string reset_password_link = 1;
string reset_token = 2;
}
message EmailResetConfirmResp {
int64 code = 1; // 0成功 其他异常
bytes content = 2; // 返回页面内容
}
message OrderPaymentDetailsReq {
EmailNotifyBasic basic_email = 1;
string payment_details_link = 2;
}
message OrderPaymentDetailsResp {
int64 code = 1; // 0成功 其他异常
string notify_id = 2; // 通知id
}
message OrderStatusTransitionReq {
EmailNotifyBasic basic_email = 1;
string last_status = 2; // 上个状态
string current_status = 3; // 当前状态
string check_status_link = 4; // 检查状态
}
message OrderStatusTransitionResp {
int64 code = 1; // 0成功 其他异常
string notify_id = 2; // 通知id
} }