message.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.25.0
  4. // protoc v3.15.1
  5. // source: message.proto
  6. package message
  7. import (
  8. context "context"
  9. proto "github.com/golang/protobuf/proto"
  10. grpc "google.golang.org/grpc"
  11. codes "google.golang.org/grpc/codes"
  12. status "google.golang.org/grpc/status"
  13. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  14. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  15. reflect "reflect"
  16. sync "sync"
  17. )
  18. const (
  19. // Verify that this generated code is sufficiently up-to-date.
  20. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  21. // Verify that runtime/protoimpl is sufficiently up-to-date.
  22. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  23. )
  24. // This is a compile-time assertion that a sufficiently up-to-date version
  25. // of the legacy proto package is being used.
  26. const _ = proto.ProtoPackageIsVersion4
  27. type Request struct {
  28. state protoimpl.MessageState
  29. sizeCache protoimpl.SizeCache
  30. unknownFields protoimpl.UnknownFields
  31. Ping string `protobuf:"bytes,1,opt,name=ping,proto3" json:"ping,omitempty"`
  32. }
  33. func (x *Request) Reset() {
  34. *x = Request{}
  35. if protoimpl.UnsafeEnabled {
  36. mi := &file_message_proto_msgTypes[0]
  37. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  38. ms.StoreMessageInfo(mi)
  39. }
  40. }
  41. func (x *Request) String() string {
  42. return protoimpl.X.MessageStringOf(x)
  43. }
  44. func (*Request) ProtoMessage() {}
  45. func (x *Request) ProtoReflect() protoreflect.Message {
  46. mi := &file_message_proto_msgTypes[0]
  47. if protoimpl.UnsafeEnabled && x != nil {
  48. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  49. if ms.LoadMessageInfo() == nil {
  50. ms.StoreMessageInfo(mi)
  51. }
  52. return ms
  53. }
  54. return mi.MessageOf(x)
  55. }
  56. // Deprecated: Use Request.ProtoReflect.Descriptor instead.
  57. func (*Request) Descriptor() ([]byte, []int) {
  58. return file_message_proto_rawDescGZIP(), []int{0}
  59. }
  60. func (x *Request) GetPing() string {
  61. if x != nil {
  62. return x.Ping
  63. }
  64. return ""
  65. }
  66. // 修改消息阅读状态
  67. type ChangeReadStatusRequest struct {
  68. state protoimpl.MessageState
  69. sizeCache protoimpl.SizeCache
  70. unknownFields protoimpl.UnknownFields
  71. Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 消息id
  72. ReadStatus int64 `protobuf:"varint,2,opt,name=readStatus,proto3" json:"readStatus,omitempty"` // 阅读状态 0-未读 1-已读
  73. }
  74. func (x *ChangeReadStatusRequest) Reset() {
  75. *x = ChangeReadStatusRequest{}
  76. if protoimpl.UnsafeEnabled {
  77. mi := &file_message_proto_msgTypes[1]
  78. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  79. ms.StoreMessageInfo(mi)
  80. }
  81. }
  82. func (x *ChangeReadStatusRequest) String() string {
  83. return protoimpl.X.MessageStringOf(x)
  84. }
  85. func (*ChangeReadStatusRequest) ProtoMessage() {}
  86. func (x *ChangeReadStatusRequest) ProtoReflect() protoreflect.Message {
  87. mi := &file_message_proto_msgTypes[1]
  88. if protoimpl.UnsafeEnabled && x != nil {
  89. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  90. if ms.LoadMessageInfo() == nil {
  91. ms.StoreMessageInfo(mi)
  92. }
  93. return ms
  94. }
  95. return mi.MessageOf(x)
  96. }
  97. // Deprecated: Use ChangeReadStatusRequest.ProtoReflect.Descriptor instead.
  98. func (*ChangeReadStatusRequest) Descriptor() ([]byte, []int) {
  99. return file_message_proto_rawDescGZIP(), []int{1}
  100. }
  101. func (x *ChangeReadStatusRequest) GetId() int64 {
  102. if x != nil {
  103. return x.Id
  104. }
  105. return 0
  106. }
  107. func (x *ChangeReadStatusRequest) GetReadStatus() int64 {
  108. if x != nil {
  109. return x.ReadStatus
  110. }
  111. return 0
  112. }
  113. type Response struct {
  114. state protoimpl.MessageState
  115. sizeCache protoimpl.SizeCache
  116. unknownFields protoimpl.UnknownFields
  117. Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` //状态码
  118. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` //响应消息
  119. }
  120. func (x *Response) Reset() {
  121. *x = Response{}
  122. if protoimpl.UnsafeEnabled {
  123. mi := &file_message_proto_msgTypes[2]
  124. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  125. ms.StoreMessageInfo(mi)
  126. }
  127. }
  128. func (x *Response) String() string {
  129. return protoimpl.X.MessageStringOf(x)
  130. }
  131. func (*Response) ProtoMessage() {}
  132. func (x *Response) ProtoReflect() protoreflect.Message {
  133. mi := &file_message_proto_msgTypes[2]
  134. if protoimpl.UnsafeEnabled && x != nil {
  135. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  136. if ms.LoadMessageInfo() == nil {
  137. ms.StoreMessageInfo(mi)
  138. }
  139. return ms
  140. }
  141. return mi.MessageOf(x)
  142. }
  143. // Deprecated: Use Response.ProtoReflect.Descriptor instead.
  144. func (*Response) Descriptor() ([]byte, []int) {
  145. return file_message_proto_rawDescGZIP(), []int{2}
  146. }
  147. func (x *Response) GetCode() int64 {
  148. if x != nil {
  149. return x.Code
  150. }
  151. return 0
  152. }
  153. func (x *Response) GetMessage() string {
  154. if x != nil {
  155. return x.Message
  156. }
  157. return ""
  158. }
  159. var File_message_proto protoreflect.FileDescriptor
  160. var file_message_proto_rawDesc = []byte{
  161. 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
  162. 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75,
  163. 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
  164. 0x09, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x49, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x6e, 0x67,
  165. 0x65, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
  166. 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,
  167. 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
  168. 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74,
  169. 0x75, 0x73, 0x22, 0x38, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12,
  170. 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f,
  171. 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20,
  172. 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x7f, 0x0a, 0x07,
  173. 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12,
  174. 0x10, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
  175. 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70,
  176. 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65,
  177. 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61,
  178. 0x67, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61,
  179. 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x65, 0x73,
  180. 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70,
  181. 0x72, 0x6f, 0x74, 0x6f, 0x33,
  182. }
  183. var (
  184. file_message_proto_rawDescOnce sync.Once
  185. file_message_proto_rawDescData = file_message_proto_rawDesc
  186. )
  187. func file_message_proto_rawDescGZIP() []byte {
  188. file_message_proto_rawDescOnce.Do(func() {
  189. file_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_proto_rawDescData)
  190. })
  191. return file_message_proto_rawDescData
  192. }
  193. var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
  194. var file_message_proto_goTypes = []interface{}{
  195. (*Request)(nil), // 0: message.Request
  196. (*ChangeReadStatusRequest)(nil), // 1: message.ChangeReadStatusRequest
  197. (*Response)(nil), // 2: message.Response
  198. }
  199. var file_message_proto_depIdxs = []int32{
  200. 0, // 0: message.Message.Ping:input_type -> message.Request
  201. 1, // 1: message.Message.ChangeReadStatus:input_type -> message.ChangeReadStatusRequest
  202. 2, // 2: message.Message.Ping:output_type -> message.Response
  203. 2, // 3: message.Message.ChangeReadStatus:output_type -> message.Response
  204. 2, // [2:4] is the sub-list for method output_type
  205. 0, // [0:2] is the sub-list for method input_type
  206. 0, // [0:0] is the sub-list for extension type_name
  207. 0, // [0:0] is the sub-list for extension extendee
  208. 0, // [0:0] is the sub-list for field type_name
  209. }
  210. func init() { file_message_proto_init() }
  211. func file_message_proto_init() {
  212. if File_message_proto != nil {
  213. return
  214. }
  215. if !protoimpl.UnsafeEnabled {
  216. file_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  217. switch v := v.(*Request); i {
  218. case 0:
  219. return &v.state
  220. case 1:
  221. return &v.sizeCache
  222. case 2:
  223. return &v.unknownFields
  224. default:
  225. return nil
  226. }
  227. }
  228. file_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  229. switch v := v.(*ChangeReadStatusRequest); i {
  230. case 0:
  231. return &v.state
  232. case 1:
  233. return &v.sizeCache
  234. case 2:
  235. return &v.unknownFields
  236. default:
  237. return nil
  238. }
  239. }
  240. file_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
  241. switch v := v.(*Response); i {
  242. case 0:
  243. return &v.state
  244. case 1:
  245. return &v.sizeCache
  246. case 2:
  247. return &v.unknownFields
  248. default:
  249. return nil
  250. }
  251. }
  252. }
  253. type x struct{}
  254. out := protoimpl.TypeBuilder{
  255. File: protoimpl.DescBuilder{
  256. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  257. RawDescriptor: file_message_proto_rawDesc,
  258. NumEnums: 0,
  259. NumMessages: 3,
  260. NumExtensions: 0,
  261. NumServices: 1,
  262. },
  263. GoTypes: file_message_proto_goTypes,
  264. DependencyIndexes: file_message_proto_depIdxs,
  265. MessageInfos: file_message_proto_msgTypes,
  266. }.Build()
  267. File_message_proto = out.File
  268. file_message_proto_rawDesc = nil
  269. file_message_proto_goTypes = nil
  270. file_message_proto_depIdxs = nil
  271. }
  272. // Reference imports to suppress errors if they are not otherwise used.
  273. var _ context.Context
  274. var _ grpc.ClientConnInterface
  275. // This is a compile-time assertion to ensure that this generated file
  276. // is compatible with the grpc package it is being compiled against.
  277. const _ = grpc.SupportPackageIsVersion6
  278. // MessageClient is the client API for Message service.
  279. //
  280. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  281. type MessageClient interface {
  282. Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
  283. ChangeReadStatus(ctx context.Context, in *ChangeReadStatusRequest, opts ...grpc.CallOption) (*Response, error)
  284. }
  285. type messageClient struct {
  286. cc grpc.ClientConnInterface
  287. }
  288. func NewMessageClient(cc grpc.ClientConnInterface) MessageClient {
  289. return &messageClient{cc}
  290. }
  291. func (c *messageClient) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
  292. out := new(Response)
  293. err := c.cc.Invoke(ctx, "/message.Message/Ping", in, out, opts...)
  294. if err != nil {
  295. return nil, err
  296. }
  297. return out, nil
  298. }
  299. func (c *messageClient) ChangeReadStatus(ctx context.Context, in *ChangeReadStatusRequest, opts ...grpc.CallOption) (*Response, error) {
  300. out := new(Response)
  301. err := c.cc.Invoke(ctx, "/message.Message/ChangeReadStatus", in, out, opts...)
  302. if err != nil {
  303. return nil, err
  304. }
  305. return out, nil
  306. }
  307. // MessageServer is the server API for Message service.
  308. type MessageServer interface {
  309. Ping(context.Context, *Request) (*Response, error)
  310. ChangeReadStatus(context.Context, *ChangeReadStatusRequest) (*Response, error)
  311. }
  312. // UnimplementedMessageServer can be embedded to have forward compatible implementations.
  313. type UnimplementedMessageServer struct {
  314. }
  315. func (*UnimplementedMessageServer) Ping(context.Context, *Request) (*Response, error) {
  316. return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
  317. }
  318. func (*UnimplementedMessageServer) ChangeReadStatus(context.Context, *ChangeReadStatusRequest) (*Response, error) {
  319. return nil, status.Errorf(codes.Unimplemented, "method ChangeReadStatus not implemented")
  320. }
  321. func RegisterMessageServer(s *grpc.Server, srv MessageServer) {
  322. s.RegisterService(&_Message_serviceDesc, srv)
  323. }
  324. func _Message_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  325. in := new(Request)
  326. if err := dec(in); err != nil {
  327. return nil, err
  328. }
  329. if interceptor == nil {
  330. return srv.(MessageServer).Ping(ctx, in)
  331. }
  332. info := &grpc.UnaryServerInfo{
  333. Server: srv,
  334. FullMethod: "/message.Message/Ping",
  335. }
  336. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  337. return srv.(MessageServer).Ping(ctx, req.(*Request))
  338. }
  339. return interceptor(ctx, in, info, handler)
  340. }
  341. func _Message_ChangeReadStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  342. in := new(ChangeReadStatusRequest)
  343. if err := dec(in); err != nil {
  344. return nil, err
  345. }
  346. if interceptor == nil {
  347. return srv.(MessageServer).ChangeReadStatus(ctx, in)
  348. }
  349. info := &grpc.UnaryServerInfo{
  350. Server: srv,
  351. FullMethod: "/message.Message/ChangeReadStatus",
  352. }
  353. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  354. return srv.(MessageServer).ChangeReadStatus(ctx, req.(*ChangeReadStatusRequest))
  355. }
  356. return interceptor(ctx, in, info, handler)
  357. }
  358. var _Message_serviceDesc = grpc.ServiceDesc{
  359. ServiceName: "message.Message",
  360. HandlerType: (*MessageServer)(nil),
  361. Methods: []grpc.MethodDesc{
  362. {
  363. MethodName: "Ping",
  364. Handler: _Message_Ping_Handler,
  365. },
  366. {
  367. MethodName: "ChangeReadStatus",
  368. Handler: _Message_ChangeReadStatus_Handler,
  369. },
  370. },
  371. Streams: []grpc.StreamDesc{},
  372. Metadata: "message.proto",
  373. }