api.proto 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. syntax = "proto3";
  2. package bbq.service.notice.v1;
  3. import "google/protobuf/empty.proto";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. //还记得那年大明湖畔的东起吗
  6. //还记得那年大明湖畔的东起吗
  7. //还记得那年大明湖畔的东起吗
  8. //还记得那年大明湖畔的东起吗
  9. //还记得那年大明湖畔的东起吗
  10. //还记得那年大明湖畔的东起吗
  11. //还记得那年大明湖畔的东起吗
  12. //还记得那年大明湖畔的东起吗
  13. option go_package = "v1";
  14. option (gogoproto.goproto_getters_all) = false;
  15. message GetUnreadInfoRequest {
  16. // 用户mid
  17. int64 mid = 1 [(gogoproto.jsontag) = "mid", (gogoproto.moretags)='form:"mid" validate:"required"'];
  18. }
  19. message UnreadInfo {
  20. // 用户mid
  21. repeated UnreadItem list = 1[(gogoproto.jsontag) = "list,omitempty"];
  22. }
  23. message UnreadItem {
  24. int32 notice_type = 1 [(gogoproto.jsontag) = "notice_type"];
  25. int64 unread_num = 2[(gogoproto.jsontag) = "unread_num"];
  26. }
  27. message ListNoticesReq {
  28. // 用户mid
  29. int64 mid = 1 [(gogoproto.jsontag) = "mid", (gogoproto.moretags)='form:"mid" validate:"required"'];
  30. int32 notice_type = 2 [(gogoproto.jsontag) = "notice_type", (gogoproto.moretags)='form:"notice_type" validate:"required"'];
  31. int64 cursor_id = 3 [(gogoproto.jsontag) = "cursor_id", (gogoproto.moretags)='form:"cursor_id"'];
  32. }
  33. message ListNoticesReply {
  34. // 用户mid
  35. int64 mid = 1 [(gogoproto.jsontag) = "mid"];
  36. repeated NoticeBase list = 2[(gogoproto.jsontag) = "list,omitempty"];
  37. }
  38. message NoticeBase {
  39. int64 id = 1 [(gogoproto.jsontag) = "id"];
  40. int64 mid = 2 [(gogoproto.jsontag) = "mid", (gogoproto.moretags)='form:"mid" validate:"required"'];
  41. int64 action_mid = 3 [(gogoproto.jsontag) = "action_mid", (gogoproto.moretags)='form:"action_mid"'];
  42. int64 sv_id = 4 [(gogoproto.jsontag) = "svid", (gogoproto.moretags)='form:"svid"'];
  43. string title = 5 [(gogoproto.jsontag) = "title", (gogoproto.moretags)='form:"title"'];
  44. string text = 6 [(gogoproto.jsontag) = "text", (gogoproto.moretags)='form:"text"'];
  45. string jump_url = 7 [(gogoproto.jsontag) = "jump_url", (gogoproto.moretags)='form:"jump_url"'];
  46. int32 notice_type = 8 [(gogoproto.jsontag) = "notice_type", (gogoproto.moretags)='form:"notice_type" validate:"required"'];
  47. int32 biz_type = 9 [(gogoproto.jsontag) = "biz_type", (gogoproto.moretags)='form:"biz_type"'];
  48. int64 biz_id = 10 [(gogoproto.jsontag) = "biz_id", (gogoproto.moretags)='form:"biz_id"'];
  49. int64 notice_time = 11 [(gogoproto.jsontag) = "notice_time", (gogoproto.casttype) = "go-common/library/time.Time"];
  50. string buvid = 12 [(gogoproto.jsontag) = "buvid", (gogoproto.moretags)='form:"buvid"'];
  51. }
  52. message CreateNoticesReq {
  53. repeated NoticeBase notices = 1 [(gogoproto.jsontag) = "notices", (gogoproto.moretags)='form:"notices" validate:"required"'];
  54. }
  55. message CreateNoticesReply {
  56. // 失败的列表
  57. repeated int64 fail_list = 2 [(gogoproto.jsontag) = "fail_list"];
  58. }
  59. message PushCallbackRequest {
  60. string tid = 1 [(gogoproto.jsontag) = "tid", (gogoproto.moretags)='form:"tid" validate:"required"'];
  61. string nid = 2 [(gogoproto.jsontag) = "nid", (gogoproto.moretags)='form:"nid" validate:"required"'];
  62. int64 mid = 3 [(gogoproto.jsontag) = "mid", (gogoproto.moretags)='form:"mid"'];
  63. string buvid = 4 [(gogoproto.jsontag) = "buvid", (gogoproto.moretags)='form:"buvid"'];
  64. }
  65. message UserPushDev {
  66. int64 id = 1 [(gogoproto.jsontag) = "id"];
  67. int64 mid = 2 [(gogoproto.jsontag) = "mid", (gogoproto.moretags)='form:"mid"'];
  68. string register_id = 3 [(gogoproto.jsontag) = "register_id", (gogoproto.moretags)='form:"register_id"'];
  69. string buvid = 4 [(gogoproto.jsontag) = "buvid", (gogoproto.moretags)='form:"buvid"'];
  70. int32 sdk = 5 [(gogoproto.jsontag) = "sdk", (gogoproto.moretags)='form:"sdk"', (gogoproto.casttype) = "int8"];
  71. int32 platform = 6 [(gogoproto.jsontag) = "platform", (gogoproto.moretags)='form:"platform"', (gogoproto.casttype) = "int8"];
  72. int32 state = 7 [(gogoproto.jsontag) = "state", (gogoproto.moretags)='form:"state"', (gogoproto.casttype) = "int8"];
  73. int64 last_login_time = 8 [(gogoproto.jsontag) = "last_login_time", (gogoproto.moretags)='form:"last_login_time"', (gogoproto.casttype) = "go-common/library/time.Time"];
  74. int64 ctime = 9 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
  75. int64 mtime = 10[(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
  76. }
  77. //还记得那年大明湖畔的东起吗
  78. //还记得那年大明湖畔的东起吗
  79. //还记得那年大明湖畔的东起吗
  80. //还记得那年大明湖畔的东起吗
  81. service Notice {
  82. // 获取所有通知类型的未读数
  83. rpc GetUnreadInfo(GetUnreadInfoRequest) returns (UnreadInfo);
  84. // 获取通知列表
  85. rpc ListNotices(ListNoticesReq) returns (ListNoticesReply);
  86. // 批量创建消息
  87. rpc CreateNotice(NoticeBase) returns (.google.protobuf.Empty);
  88. // 推送回调
  89. rpc PushCallback(PushCallbackRequest) returns (.google.protobuf.Empty);
  90. // Push的login接口
  91. rpc PushLogin(UserPushDev) returns (.google.protobuf.Empty);
  92. // Push的logout接口
  93. rpc PushLogout(UserPushDev) returns (.google.protobuf.Empty);
  94. }