message.proto 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. syntax = "proto3";
  2. package tutorial;
  3. option java_package = "com.duowan.allstar.proto";
  4. option java_outer_classname = "MessageProtos";
  5. message Message {
  6. enum Type {
  7. COMMON = 0;
  8. CHAT = 1;
  9. DATA = 2;
  10. }
  11. Type type = 1;
  12. message ChatMessage {
  13. // 消息 id
  14. int64 id = 1;
  15. // 用户id
  16. int64 uid = 2;
  17. // 接收方的 uid
  18. int64 receiveUid = 3;
  19. // 业务类型
  20. int32 bType = 4;
  21. // 内容类型
  22. int32 contentType = 5;
  23. // 消息内容
  24. string msg = 6;
  25. // 内容长度
  26. int32 contentLen = 7;
  27. // 有无权限
  28. int32 hasAuth = 8;
  29. // 发送时间
  30. int64 sendTime = 9;
  31. int32 isRead = 10;
  32. // 发送者
  33. UserInfo sender = 11;
  34. }
  35. ChatMessage chatMessage = 2;
  36. message CommonMessage {
  37. string msg = 1;
  38. }
  39. CommonMessage commonMessage = 3;
  40. message DataMessage {
  41. int32 code = 1;
  42. int32 result = 2;
  43. string data = 3;
  44. string msg = 4;
  45. }
  46. DataMessage dataMessage = 4;
  47. message UserInfo {
  48. int64 uid = 1;
  49. string nick = 2;
  50. string head = 3;
  51. }
  52. }