api.proto 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. syntax = "proto3";
  2. package community.service.history.v1;
  3. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  4. import "app/service/main/history/model/history.proto";
  5. option go_package = "v1";
  6. // AddHistoryReply reply
  7. message AddHistoryReply {
  8. }
  9. // AddHistoryReq req
  10. message AddHistoryReq {
  11. // mid
  12. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required\""];
  13. // business 业务
  14. string business = 2 [(gogoproto.moretags) = "form:\"business\" validate:\"required\""];
  15. // kid 业务中唯一id
  16. int64 kid = 3 [(gogoproto.moretags) = "form:\"kid\" validate:\"required\""];
  17. // aid
  18. int64 aid = 4 [(gogoproto.moretags) = "form:\"aid\""];
  19. // sid
  20. int64 sid = 5 [(gogoproto.moretags) = "form:\"sid\""];
  21. // epid
  22. int64 epid = 6 [(gogoproto.moretags) = "form:\"epid\""];
  23. // cid
  24. int64 cid = 7 [(gogoproto.moretags) = "form:\"cid\""];
  25. // sub_type 子类型
  26. int32 sub_type = 8 [(gogoproto.moretags) = "form:\"sub_type\""];
  27. // device 设备类型
  28. int32 device = 9 [(gogoproto.moretags) = "form:\"device\""];
  29. // progress 进度
  30. int32 progress = 10 [(gogoproto.moretags) = "form:\"progress\""];
  31. // 观看时间
  32. int64 view_at = 11 [(gogoproto.moretags) = "form:\"view_at\" validate:\"required\""];
  33. }
  34. // AddHistoriesReq 增加多条记录
  35. message AddHistoriesReq {
  36. repeated AddHistoryReq histories = 1;
  37. }
  38. // AddHistoriesReply .
  39. message AddHistoriesReply {
  40. }
  41. // DelHistoriesReq del histories request
  42. message DelHistoriesReq {
  43. // mid
  44. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  45. message Record {
  46. // business 业务
  47. string business = 1 [(gogoproto.moretags) = "form:\"business\" validate:\"required\""];
  48. // id
  49. int64 id = 2 [(gogoproto.moretags) = "form:\"id\" validate:\"required\"", (gogoproto.customname) = "ID"];
  50. }
  51. repeated Record records = 2 [(gogoproto.moretags) = "validate:\"required\""];
  52. }
  53. //DelHistoriesReply del histories reply
  54. message DelHistoriesReply {
  55. }
  56. // ClearHistoryReq clear histories request
  57. message ClearHistoryReq {
  58. // businesses 业务 为空为全部业务
  59. repeated string businesses = 1 [(gogoproto.moretags) = 'form:"businesses,split"'];
  60. // mid
  61. int64 mid = 2 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  62. }
  63. //ClearHistoryReply clear histories reply
  64. message ClearHistoryReply {
  65. }
  66. // UserHistoriesReq .
  67. message UserHistoriesReq {
  68. // mid
  69. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  70. // businesses 查询的业务范围 为空为全部业务
  71. repeated string businesses = 2 [(gogoproto.moretags) = 'form:"businesses,split"'];
  72. // business 上一条的业务类型
  73. string business = 3 [(gogoproto.moretags) = 'form:"business"'];
  74. // kid 上一条的id 业务中唯一id
  75. int64 kid = 4 [(gogoproto.moretags) = "form:\"kid\""];
  76. // 上一条的观看时间
  77. int64 view_at = 5 [(gogoproto.moretags) = 'form:"view_at" validate:"required"'];
  78. // 每页几条
  79. int64 Ps = 6[(gogoproto.moretags) = 'form:"ps" validate:"required,min=1,max=1000"'];
  80. }
  81. // UserHistoriesReply .
  82. message UserHistoriesReply {
  83. repeated History histories = 1[(gogoproto.jsontag) = "histories"];
  84. }
  85. // HistoriesReq .
  86. message HistoriesReq {
  87. // mid
  88. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  89. // business 业务
  90. string business = 2 [(gogoproto.moretags) = 'form:"business" validate:"required"'];
  91. // kids 业务id
  92. repeated int64 kids = 3 [(gogoproto.moretags) = 'form:"kids,split" validate:"required"'];
  93. }
  94. // AddHistoriesReply .
  95. message HistoriesReply {
  96. map<int64, History> histories = 1[(gogoproto.jsontag) = "histories"];
  97. }
  98. // UserHideReq req
  99. message UserHideReq {
  100. // mid
  101. int64 mid = 1 [(gogoproto.moretags) = "form:\"mid\" validate:\"required,min=1\""];
  102. }
  103. // UserHideReply reply
  104. message UserHideReply {
  105. bool hide = 1 [(gogoproto.jsontag) = "hide"];
  106. }
  107. // UpdateUserHideReq req
  108. message UpdateUserHideReq {
  109. // mid
  110. int64 mid = 1 [(gogoproto.moretags) = 'form:"mid" validate:"required,min=1"'];
  111. bool hide = 2 [(gogoproto.moretags) = 'form:"hide"'];
  112. }
  113. // UpdateUserHideReply reply
  114. message UpdateUserHideReply {
  115. }
  116. // History rpc
  117. service History {
  118. // AddHistory add history. 增加播放历史接口
  119. rpc AddHistory (AddHistoryReq) returns (AddHistoryReply);
  120. // AddHistories 增加多条播放历史记录
  121. rpc AddHistories (AddHistoriesReq) returns (AddHistoriesReply);
  122. // DelHistories delete histories. 批量删除播放历史接口
  123. rpc DelHistories (DelHistoriesReq) returns (DelHistoriesReply);
  124. // ClearHistory clear history 按照业务删除所有播放记录
  125. rpc ClearHistory (ClearHistoryReq) returns (ClearHistoryReply);
  126. // UserHistories 查询用户的播放历史列表
  127. rpc UserHistories (UserHistoriesReq) returns (UserHistoriesReply);
  128. // Histories 根据id查询播放历史
  129. rpc Histories (HistoriesReq) returns (HistoriesReply);
  130. // UserHide 查询是否记录播放历史
  131. rpc UserHide(UserHideReq) returns (UserHideReply);
  132. // UpdateUserHide 修改是否记录播放历史
  133. rpc UpdateUserHide(UpdateUserHideReq) returns (UpdateUserHideReply);
  134. }