api.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. syntax = "proto3";
  2. package account.spy;
  3. option go_package = "v1";
  4. message ClearReliveTimesReply {
  5. }
  6. message ClearReliveTimesReq {
  7. ModelArgReset arg = 1;
  8. }
  9. message HandleEventReply {
  10. }
  11. message HandleEventReq {
  12. ModelEventMessage event_msg = 1;
  13. }
  14. message ModelArgReset {
  15. int64 mid = 1;
  16. bool re_live_time = 2;
  17. bool event_score = 3;
  18. bool base_score = 4;
  19. string operator = 5;
  20. }
  21. message ModelEventMessage {
  22. int64 time = 1;
  23. string ip = 2;
  24. string service = 3;
  25. string event = 4;
  26. int64 active_mid = 5;
  27. int64 target_mid = 6;
  28. int64 target_id = 7;
  29. //FIXME type model. args = 8;
  30. string result = 9;
  31. string effect = 10;
  32. int32 risk_level = 11;
  33. }
  34. message ModelStatistics {
  35. int64 quantity = 1;
  36. int64 event_id = 2;
  37. string event_name = 3;
  38. }
  39. message ModelUserInfo {
  40. int64 id = 1;
  41. int64 mid = 2;
  42. int32 score = 3;
  43. int32 base_score = 4;
  44. int32 event_score = 5;
  45. int32 state = 6;
  46. int32 relive_times = 7;
  47. int64 ctime = 8;
  48. int64 mtime = 9;
  49. }
  50. message PingReply {
  51. }
  52. message PingReq {
  53. }
  54. message PurgeUserReply {
  55. }
  56. message PurgeUserReq {
  57. int64 mid = 1;
  58. string action = 2;
  59. }
  60. message ReBuildPortraitReply {
  61. }
  62. message ReBuildPortraitReq {
  63. int64 mid = 1;
  64. string reason = 2;
  65. }
  66. message RefreshBaseScoreReply {
  67. }
  68. message RefreshBaseScoreReq {
  69. ModelArgReset arg = 1;
  70. }
  71. message StatByIDGroupEventReply {
  72. repeated ModelStatistics res = 1;
  73. }
  74. message StatByIDGroupEventReq {
  75. int64 mid = 1;
  76. int64 id = 2;
  77. }
  78. message StatByIDReply {
  79. repeated ModelStatistics stat = 1;
  80. }
  81. message StatByIDReq {
  82. int64 mid = 1;
  83. int64 id = 2;
  84. }
  85. message UpdateBaseScoreReply {
  86. }
  87. message UpdateBaseScoreReq {
  88. ModelArgReset arg = 1;
  89. }
  90. message UpdateEventScoreReply {
  91. }
  92. message UpdateEventScoreReq {
  93. ModelArgReset arg = 1;
  94. }
  95. message UpdateUserScoreReply {
  96. }
  97. message UpdateUserScoreReq {
  98. int64 mid = 1;
  99. string ip = 2;
  100. string effect = 3;
  101. }
  102. message UserInfoAsynReply {
  103. ModelUserInfo ui = 1;
  104. }
  105. message UserInfoAsynReq {
  106. int64 mid = 1;
  107. }
  108. message UserInfoReply {
  109. ModelUserInfo ui = 1;
  110. }
  111. message UserInfoReq {
  112. int64 mid = 1;
  113. string ip = 2;
  114. }
  115. message InfoReq {
  116. int64 mid = 1;
  117. }
  118. message InfoReply {
  119. ModelUserInfo ui = 1;
  120. }
  121. service Spy {
  122. // Ping check dao health.
  123. rpc Ping(PingReq) returns(PingReply);
  124. // Info get user info by mid.
  125. rpc Info(InfoReq) returns(InfoReply);
  126. // StatByID spy stat by id or mid.
  127. rpc StatByID(StatByIDReq) returns(StatByIDReply);
  128. // StatByIDGroupEvent spy stat by id or mid.
  129. rpc StatByIDGroupEvent(StatByIDGroupEventReq) returns(StatByIDGroupEventReply);
  130. // PurgeUser purge user info
  131. rpc PurgeUser(PurgeUserReq) returns(PurgeUserReply);
  132. // HandleEvent handle spy-event.
  133. rpc HandleEvent(HandleEventReq) returns(HandleEventReply);
  134. // UserInfo get UserInfo by mid , from cache or db or generate.
  135. rpc UserInfo(UserInfoReq) returns(UserInfoReply);
  136. // UserInfoAsyn get UserInfo by mid , from cache or db or asyn generate.
  137. rpc UserInfoAsyn(UserInfoAsynReq) returns(UserInfoAsynReply);
  138. // ReBuildPortrait reBuild user info.
  139. rpc ReBuildPortrait(ReBuildPortraitReq) returns(ReBuildPortraitReply);
  140. // UpdateUserScore update user score
  141. rpc UpdateUserScore(UpdateUserScoreReq) returns(UpdateUserScoreReply);
  142. // RefreshBaseScore refresh base score.
  143. rpc RefreshBaseScore(RefreshBaseScoreReq) returns(RefreshBaseScoreReply);
  144. // UpdateBaseScore update base score.
  145. rpc UpdateBaseScore(UpdateBaseScoreReq) returns(UpdateBaseScoreReply);
  146. // UpdateEventScore update event score.
  147. rpc UpdateEventScore(UpdateEventScoreReq) returns(UpdateEventScoreReply);
  148. // ClearReliveTimes clear times.
  149. rpc ClearReliveTimes(ClearReliveTimesReq) returns(ClearReliveTimesReply);
  150. }