message.proto 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. syntax = "proto3";
  2. import "base.proto";
  3. package com.ywt.gapi.message;
  4. //option java_generic_services = true;
  5. option java_multiple_files = true;
  6. option java_package = "com.ywt.gapi.message";
  7. option java_outer_classname = "MessageProto";
  8. // 发送短信相关功能埋点数据
  9. message SmsTrackingData {
  10. int32 terminal = 1; // 调用终端
  11. string serviceName = 2; // 调用服务名称
  12. string ip = 3; // IP
  13. string methodName = 4; // 方法名
  14. string authData = 5; // 网关鉴权信息
  15. string extData = 6; // 其他额外信息
  16. }
  17. message SendSmsCodeRequest {
  18. string mobile = 1;
  19. int32 type = 2;
  20. string code = 3;
  21. string smsSign = 4;// 短信签名,可选,默认是南方医务通
  22. SmsTrackingData smsTrackingData = 5;
  23. }
  24. //通知用户收到处方单请求
  25. message NotifyAfterCreatePrescriptionRequest {
  26. string hospitalName = 1;
  27. string doctorName = 2;
  28. string patientName = 3;
  29. string patientMobile = 4;
  30. int32 userId = 5;
  31. string bizNo = 6;
  32. int32 doctorId = 7;
  33. int32 terminal = 8;//终端
  34. int32 orderId = 9;//订单号
  35. int32 pharmacyId = 10;
  36. }
  37. message SendSmsCodeResponse {
  38. Result result = 1;
  39. }
  40. // 通用发送短信服务,使用内部定义短信模板编号
  41. // 通用发送短信请求
  42. message SendSmsRequest {
  43. string phoneNumbers = 1; //短信接收手机号,多个手机号为用半角 , 分开,如13899999999,13688888888
  44. string templateCode = 2; //短信模板编号,定义在sms_template表中
  45. string templateParam = 3; //短信模板参数
  46. string dstime = 4; //定时时间,为空时表示立即发送 格式:yyyy-MM-dd HH:mm:ss 例如:2016-09-10 09:00:00
  47. string smsSign = 5; //签名:南方医务通,不填默认:南方医务
  48. SmsTrackingData smsTrackingData = 6;
  49. }
  50. /**
  51. 发送短信响应
  52. returnContent 说明:
  53. >0 成功,系统生成的任务id或自定义的任务id
  54. 0 失败
  55. -1 用户名或者密码不正确
  56. -2 必填选项为空
  57. -3 短信内容0个字节
  58. -5 余额不够
  59. -10 用户被禁用
  60. -11 短信内容超过500字
  61. -12 无扩展权限(ext字段需填空)
  62. -13 IP校验错误
  63. -14 内容解析异常
  64. -990 未知错误
  65. **/
  66. message SendSmsResponse {
  67. int32 code = 1;
  68. string returnContent = 2;
  69. }
  70. // 通用微信公众号模板消息发送方法,使用内部定义的模板消息编号,需要指定发送的公众号
  71. // 发送微信模板消息请求
  72. // refer: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277
  73. message SendTemplateMessageRequest {
  74. message Keyword {
  75. string value = 1;
  76. string color = 2;
  77. }
  78. message MiniProgramParam {
  79. string appid = 1;
  80. string pagepath = 2;
  81. }
  82. string templateCode = 1; // 内部定义的模板消息编号,定义在template_msg_config表
  83. string toUser = 2; // 接受模板消息的用户openId
  84. string url = 3; // 模板跳转链接(可选)
  85. string miniProgram = 4; // 跳小程序所需数据(可选)包含参数:appid - 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏); pagepath - 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),暂不支持小游戏
  86. string data = 5; // 模板数据,json格式,参数内可以通过value设定值,通过color设置颜色(可选)
  87. int32 userId = 6;//用户id
  88. repeated Keyword keywords = 7;
  89. Keyword firstKeyword = 8;
  90. Keyword remarkKeyword = 9;
  91. MiniProgramParam mpParam = 10;
  92. }
  93. // 发送微信模板消息响应
  94. message SendTemplateMessageResponse {
  95. int32 code = 1;
  96. string info = 2;
  97. }
  98. //异步方法发送模板消息请求
  99. message SendTemplateMessageAsyncRequest {
  100. int32 logId = 1;//消息日志id
  101. }
  102. //异步方法发送模板消息响应
  103. message SendTemplateMessageAsyncResponse {
  104. int32 code = 1;
  105. string info = 2;
  106. }
  107. // 统一发送客服消息请求
  108. message SendCustomMessageRequest {
  109. int32 customMessageId = 1;// 客服消息id,定义在custom_message_config表
  110. string openId = 2;//接收用户openId
  111. string params = 3;//消息内容参数,JSON格式,可选,替换消息内容中指定的字段
  112. }
  113. // 统一发送客服消息响应
  114. message SendCustomMessageResponse {
  115. int32 code = 1;
  116. string msg = 2;
  117. }
  118. // 发送经销商邮件request
  119. message SendMerchantEmailRequest {
  120. int32 merchantId = 1; // 经销商id
  121. int32 applyId = 2; // 提交记录id
  122. string email = 3; // 接收邮箱地址
  123. int32 tplId = 4; // 邮件模板id:1-提交记录某月份的重点医生数据;2-上月重点医生数据
  124. }
  125. // 发送经销商邮件response
  126. message SendMerchantEmailResponse {
  127. int32 code = 1;
  128. string msg = 2;
  129. }
  130. //发送小程序模板消息请求结构体
  131. message SendMPTemplateMessageRequest{
  132. message Keyword {
  133. string value = 1;
  134. string color = 2;
  135. }
  136. int32 terminal = 1;
  137. string touser = 2; //接收者(用户)的 openid
  138. string templateId = 3; //所需下发的模板消息的id
  139. string page = 4; //点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转
  140. string formId = 5; //表单提交场景下,为 submit 事件带上的 formId;支付场景下,为本次支付的 prepay_id
  141. repeated Keyword keywords = 6;
  142. string emphasisKeyword = 7; //模板需要放大的关键词,不填则默认无放大
  143. }
  144. //发送小程序模板消息响应结构体
  145. message SendMPTemplateMessageResponse{
  146. int32 code = 1;
  147. string info = 2;
  148. }
  149. //根据日志表ID发送小程序模板消息请求结构体
  150. message SendMPTemplateMessageByLogIdRequest{
  151. int32 logId = 1;
  152. }
  153. //根据日志表ID发送小程序模板消息响应结构体
  154. message SendMPTemplateMessageByLogIdResponse{
  155. int32 code = 1;
  156. string info = 2;
  157. }
  158. //发送小程序订阅消息请求结构体
  159. message SendMPSubscribeMessageRequest{
  160. message Keyword {
  161. string key = 1;
  162. string value = 2;
  163. string color = 3;
  164. }
  165. int32 terminal = 1;
  166. string touser = 2; //接收者(用户)的 openid
  167. string templateId = 3; //所需下发的模板消息的id
  168. string page = 4; //点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转
  169. repeated Keyword keywords = 5;
  170. }
  171. //发送小程序订阅消息响应结构体
  172. message SendMPSubscribeMessageResponse{
  173. int32 code = 1;
  174. string info = 2;
  175. }
  176. //根据日志表ID发送小程序订阅消息请求结构体
  177. message SendMPSubscribeMessageByLogIdRequest{
  178. int32 logId = 1;
  179. }
  180. //根据日志表ID发送小程序订阅消息响应结构体
  181. message SendMPSubscribeMessageByLogIdResponse{
  182. int32 code = 1;
  183. string info = 2;
  184. }
  185. // 发送错误日志
  186. message SendErrorEmailRequest {
  187. message Header {
  188. string key = 1;
  189. string value = 2;
  190. }
  191. string url = 1; //rest服务url格式:rest://${serviceName}/${path},如:rest://com.ywt.MgDrugService/path1/path2
  192. bytes body = 2; //包体
  193. string method = 4; // get | post
  194. repeated Header headers = 5;
  195. int32 kind = 6; // kind = 1表示grpc方式(此时:url对应ExecuteGRPCRequest里面的method,body对应ExecuteGRPCRequest里面的data),kind = 2 表示rest方式
  196. int32 type = 7; // 类型,0-默认,1-mq
  197. }
  198. //消息中心服务 // 对应 rpc 项目的 MessageServiceImpl 类
  199. service MessageService {
  200. rpc sendSmsCode (SendSmsCodeRequest) returns (SendSmsCodeResponse); //发送短信验证码
  201. //通知用户收到处方单
  202. rpc notifyAfterCreatePrescription (NotifyAfterCreatePrescriptionRequest) returns (Result);
  203. }
  204. // 短信发送服务 // 对应 MsgService 项目的 SmsProvider 类
  205. service SmsMessageService {
  206. rpc sendSms (SendSmsRequest) returns (SendSmsResponse);
  207. }
  208. // 微信消息相关服务 // 对应 MsgService 项目的 WeChatMsgProvider 类
  209. service WeChatMessageService {
  210. // 发送微信模板消息
  211. //Edit on 2018-10-22 17:15:37 by Walker
  212. //修改内容:MessageService中模板消息记录入库和发送两个方法拆分,这个方法只做消息记录,真正的发送方法是sendTemplateMessageAsync
  213. rpc sendTemplateMessage (SendTemplateMessageRequest) returns (SendTemplateMessageResponse);
  214. // 统一发送客服消息
  215. rpc sendCustomMessage(SendCustomMessageRequest) returns (SendCustomMessageResponse);
  216. //异步方法发送模板消息。这个是真正发送模板消息的方法。
  217. rpc sendTemplateMessageAsynck (SendTemplateMessageAsyncRequest) returns (SendTemplateMessageAsyncResponse);
  218. //发送小程序模板消息(旧)
  219. rpc sendMPTemplateMessage (SendMPTemplateMessageRequest) returns (SendMPTemplateMessageResponse);
  220. //根据日志表ID发送小程序模板消息(旧)
  221. rpc sendMPTemplateMessageByLogId (SendMPTemplateMessageByLogIdRequest) returns (SendMPTemplateMessageByLogIdResponse);
  222. //发送小程序订阅消息(新)
  223. rpc sendMPSubscribeMessage (SendMPSubscribeMessageRequest) returns (SendMPSubscribeMessageResponse);
  224. //根据日志表ID发送小程序订阅消息(新)
  225. rpc sendMPSubscribeMessageByLogId (SendMPSubscribeMessageByLogIdRequest) returns (SendMPSubscribeMessageByLogIdResponse);
  226. }
  227. // 发送邮件服务 // 对应 MsgService 项目的 EmailProvider 类
  228. service EmailService {
  229. // 发送经销商邮件
  230. rpc sendMerchantEmail (SendMerchantEmailRequest) returns (SendMerchantEmailResponse);
  231. // 发送邮件,记录出错日志
  232. rpc sendErrorEmail (SendErrorEmailRequest) returns (Result);
  233. }