123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- syntax = "proto3";
- import "base.proto";
- package com.ywt.gapi.message;
- //option java_generic_services = true;
- option java_multiple_files = true;
- option java_package = "com.ywt.gapi.message";
- option java_outer_classname = "MessageProto";
- // 发送短信相关功能埋点数据
- message SmsTrackingData {
- int32 terminal = 1; // 调用终端
- string serviceName = 2; // 调用服务名称
- string ip = 3; // IP
- string methodName = 4; // 方法名
- string authData = 5; // 网关鉴权信息
- string extData = 6; // 其他额外信息
- }
- message SendSmsCodeRequest {
- string mobile = 1;
- int32 type = 2;
- string code = 3;
- string smsSign = 4;// 短信签名,可选,默认是南方医务通
- SmsTrackingData smsTrackingData = 5;
- }
- //通知用户收到处方单请求
- message NotifyAfterCreatePrescriptionRequest {
- string hospitalName = 1;
- string doctorName = 2;
- string patientName = 3;
- string patientMobile = 4;
- int32 userId = 5;
- string bizNo = 6;
- int32 doctorId = 7;
- int32 terminal = 8;//终端
- int32 orderId = 9;//订单号
- int32 pharmacyId = 10;
- }
- message SendSmsCodeResponse {
- Result result = 1;
- }
- // 通用发送短信服务,使用内部定义短信模板编号
- // 通用发送短信请求
- message SendSmsRequest {
- string phoneNumbers = 1; //短信接收手机号,多个手机号为用半角 , 分开,如13899999999,13688888888
- string templateCode = 2; //短信模板编号,定义在sms_template表中
- string templateParam = 3; //短信模板参数
- string dstime = 4; //定时时间,为空时表示立即发送 格式:yyyy-MM-dd HH:mm:ss 例如:2016-09-10 09:00:00
- string smsSign = 5; //签名:南方医务通,不填默认:南方医务
- SmsTrackingData smsTrackingData = 6;
- }
- /**
- 发送短信响应
- returnContent 说明:
- >0 成功,系统生成的任务id或自定义的任务id
- 0 失败
- -1 用户名或者密码不正确
- -2 必填选项为空
- -3 短信内容0个字节
- -5 余额不够
- -10 用户被禁用
- -11 短信内容超过500字
- -12 无扩展权限(ext字段需填空)
- -13 IP校验错误
- -14 内容解析异常
- -990 未知错误
- **/
- message SendSmsResponse {
- int32 code = 1;
- string returnContent = 2;
- }
- // 通用微信公众号模板消息发送方法,使用内部定义的模板消息编号,需要指定发送的公众号
- // 发送微信模板消息请求
- // refer: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277
- message SendTemplateMessageRequest {
- message Keyword {
- string value = 1;
- string color = 2;
- }
- message MiniProgramParam {
- string appid = 1;
- string pagepath = 2;
- }
- string templateCode = 1; // 内部定义的模板消息编号,定义在template_msg_config表
- string toUser = 2; // 接受模板消息的用户openId
- string url = 3; // 模板跳转链接(可选)
- string miniProgram = 4; // 跳小程序所需数据(可选)包含参数:appid - 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏); pagepath - 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),暂不支持小游戏
- string data = 5; // 模板数据,json格式,参数内可以通过value设定值,通过color设置颜色(可选)
- int32 userId = 6;//用户id
- repeated Keyword keywords = 7;
- Keyword firstKeyword = 8;
- Keyword remarkKeyword = 9;
- MiniProgramParam mpParam = 10;
- }
- // 发送微信模板消息响应
- message SendTemplateMessageResponse {
- int32 code = 1;
- string info = 2;
- }
- //异步方法发送模板消息请求
- message SendTemplateMessageAsyncRequest {
- int32 logId = 1;//消息日志id
- }
- //异步方法发送模板消息响应
- message SendTemplateMessageAsyncResponse {
- int32 code = 1;
- string info = 2;
- }
- // 统一发送客服消息请求
- message SendCustomMessageRequest {
- int32 customMessageId = 1;// 客服消息id,定义在custom_message_config表
- string openId = 2;//接收用户openId
- string params = 3;//消息内容参数,JSON格式,可选,替换消息内容中指定的字段
- }
- // 统一发送客服消息响应
- message SendCustomMessageResponse {
- int32 code = 1;
- string msg = 2;
- }
- // 发送经销商邮件request
- message SendMerchantEmailRequest {
- int32 merchantId = 1; // 经销商id
- int32 applyId = 2; // 提交记录id
- string email = 3; // 接收邮箱地址
- int32 tplId = 4; // 邮件模板id:1-提交记录某月份的重点医生数据;2-上月重点医生数据
- }
- // 发送经销商邮件response
- message SendMerchantEmailResponse {
- int32 code = 1;
- string msg = 2;
- }
- //发送小程序模板消息请求结构体
- message SendMPTemplateMessageRequest{
- message Keyword {
- string value = 1;
- string color = 2;
- }
- int32 terminal = 1;
- string touser = 2; //接收者(用户)的 openid
- string templateId = 3; //所需下发的模板消息的id
- string page = 4; //点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转
- string formId = 5; //表单提交场景下,为 submit 事件带上的 formId;支付场景下,为本次支付的 prepay_id
- repeated Keyword keywords = 6;
- string emphasisKeyword = 7; //模板需要放大的关键词,不填则默认无放大
- }
- //发送小程序模板消息响应结构体
- message SendMPTemplateMessageResponse{
- int32 code = 1;
- string info = 2;
- }
- //根据日志表ID发送小程序模板消息请求结构体
- message SendMPTemplateMessageByLogIdRequest{
- int32 logId = 1;
- }
- //根据日志表ID发送小程序模板消息响应结构体
- message SendMPTemplateMessageByLogIdResponse{
- int32 code = 1;
- string info = 2;
- }
- //发送小程序订阅消息请求结构体
- message SendMPSubscribeMessageRequest{
- message Keyword {
- string key = 1;
- string value = 2;
- string color = 3;
- }
- int32 terminal = 1;
- string touser = 2; //接收者(用户)的 openid
- string templateId = 3; //所需下发的模板消息的id
- string page = 4; //点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转
- repeated Keyword keywords = 5;
- }
- //发送小程序订阅消息响应结构体
- message SendMPSubscribeMessageResponse{
- int32 code = 1;
- string info = 2;
- }
- //根据日志表ID发送小程序订阅消息请求结构体
- message SendMPSubscribeMessageByLogIdRequest{
- int32 logId = 1;
- }
- //根据日志表ID发送小程序订阅消息响应结构体
- message SendMPSubscribeMessageByLogIdResponse{
- int32 code = 1;
- string info = 2;
- }
- // 发送错误日志
- message SendErrorEmailRequest {
- message Header {
- string key = 1;
- string value = 2;
- }
- string url = 1; //rest服务url格式:rest://${serviceName}/${path},如:rest://com.ywt.MgDrugService/path1/path2
- bytes body = 2; //包体
- string method = 4; // get | post
- repeated Header headers = 5;
- int32 kind = 6; // kind = 1表示grpc方式(此时:url对应ExecuteGRPCRequest里面的method,body对应ExecuteGRPCRequest里面的data),kind = 2 表示rest方式
- int32 type = 7; // 类型,0-默认,1-mq
- }
- //消息中心服务 // 对应 rpc 项目的 MessageServiceImpl 类
- service MessageService {
- rpc sendSmsCode (SendSmsCodeRequest) returns (SendSmsCodeResponse); //发送短信验证码
- //通知用户收到处方单
- rpc notifyAfterCreatePrescription (NotifyAfterCreatePrescriptionRequest) returns (Result);
- }
- // 短信发送服务 // 对应 MsgService 项目的 SmsProvider 类
- service SmsMessageService {
- rpc sendSms (SendSmsRequest) returns (SendSmsResponse);
- }
- // 微信消息相关服务 // 对应 MsgService 项目的 WeChatMsgProvider 类
- service WeChatMessageService {
- // 发送微信模板消息
- //Edit on 2018-10-22 17:15:37 by Walker
- //修改内容:MessageService中模板消息记录入库和发送两个方法拆分,这个方法只做消息记录,真正的发送方法是sendTemplateMessageAsync
- rpc sendTemplateMessage (SendTemplateMessageRequest) returns (SendTemplateMessageResponse);
- // 统一发送客服消息
- rpc sendCustomMessage(SendCustomMessageRequest) returns (SendCustomMessageResponse);
- //异步方法发送模板消息。这个是真正发送模板消息的方法。
- rpc sendTemplateMessageAsynck (SendTemplateMessageAsyncRequest) returns (SendTemplateMessageAsyncResponse);
- //发送小程序模板消息(旧)
- rpc sendMPTemplateMessage (SendMPTemplateMessageRequest) returns (SendMPTemplateMessageResponse);
- //根据日志表ID发送小程序模板消息(旧)
- rpc sendMPTemplateMessageByLogId (SendMPTemplateMessageByLogIdRequest) returns (SendMPTemplateMessageByLogIdResponse);
- //发送小程序订阅消息(新)
- rpc sendMPSubscribeMessage (SendMPSubscribeMessageRequest) returns (SendMPSubscribeMessageResponse);
- //根据日志表ID发送小程序订阅消息(新)
- rpc sendMPSubscribeMessageByLogId (SendMPSubscribeMessageByLogIdRequest) returns (SendMPSubscribeMessageByLogIdResponse);
- }
- // 发送邮件服务 // 对应 MsgService 项目的 EmailProvider 类
- service EmailService {
- // 发送经销商邮件
- rpc sendMerchantEmail (SendMerchantEmailRequest) returns (SendMerchantEmailResponse);
- // 发送邮件,记录出错日志
- rpc sendErrorEmail (SendErrorEmailRequest) returns (Result);
- }
|