message.proto 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. SELF = 0;
  8. DATA = 1;
  9. NOTIFY = 2;
  10. ROLEOPT = 3;
  11. REPORT = 4;
  12. }
  13. Type type = 1;
  14. message DataMessage {
  15. int32 code = 1;
  16. int32 result = 2;
  17. string data = 3;
  18. string msg = 4;
  19. }
  20. DataMessage dataMessage = 2;
  21. // Enum nType {1: 普通通知;2: 好友列表通知; 3: 艺人列表通知,4:用户家园建筑列表通知}
  22. message NotificationMessage {
  23. int32 nType = 1;
  24. }
  25. NotificationMessage notificationMessage = 3;
  26. // 即对 targetUid 做了什么操作 opt
  27. // e.g.: 向 targetUid 赎身; 向 targetUid 签约
  28. // Enum opt {1: 赎身; 2: 抢夺; 3: 签约; 4: 解雇; 5: 入驻;6: 召回;7: 驱赶;8: 举报;9:通过好友申请;10:成为好友}
  29. message RoleOptMessage {
  30. // 目标用户
  31. int64 targetUid = 1;
  32. // 赎身或者抢夺成功时,前任老板的uid
  33. int64 exBossUid = 2;
  34. // 操作类型
  35. int32 opt = 3;
  36. }
  37. RoleOptMessage roleOptMessage = 4;
  38. // 数据上报
  39. message ReportData {
  40. /**
  41. * 上报序号,每次重新获取时重置
  42. */
  43. int32 seq = 1;
  44. /**
  45. * 时间戳
  46. */
  47. int64 t = 2;
  48. /**
  49. * @see com.duowan.allstar.model.enumeration.Cmd
  50. */
  51. int32 cmd = 3;
  52. /**
  53. * grossIncome
  54. */
  55. int64 gi = 4;
  56. /**
  57. * @see com.duowan.allstar.model.home.UserExtra#stars
  58. */
  59. int64 s = 5;
  60. /**
  61. * @see BuildingInfoForm
  62. */
  63. repeated BuildingInfo b = 6;
  64. /**
  65. * 未解锁建筑
  66. */
  67. repeated BuildingInfo ub = 7;
  68. }
  69. ReportData reportData = 5;
  70. message BuildingInfo {
  71. // buildingId
  72. int64 id = 1;
  73. // 等级
  74. int32 l = 2;
  75. // coin count 金币存储次数
  76. int32 cc = 3;
  77. }
  78. string msg = 6;
  79. }