like.proto 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. syntax = "proto3";
  2. import "public.proto";
  3. package pcds.like.v1;
  4. /*
  5. * 点赞/收藏/订阅(关注)
  6. *
  7. *
  8. */
  9. service Like{
  10. rpc GetLikeList (LikeListRequest) returns (LikeListReply){} //某资源的点赞人列表
  11. rpc GetLikeCount (LikeRequest) returns (LikeCountReply){} //某资源的点赞数量
  12. rpc DelLike (LikeRequest) returns (LikeReply){}
  13. }
  14. message LikeListRequest{
  15. string ResId = 1;
  16. EnumResType ResType = 2;
  17. string Search = 3;
  18. EnumAllowingSearch SearchCol = 4;
  19. int32 CurrentPage = 5;
  20. int32 PerPage = 6;
  21. EnumAllowingOrderby OrderBy = 7;
  22. bool Desc = 8;
  23. }
  24. enum EnumAllowingSearch{
  25. EAS_TITLE = 0;
  26. }
  27. enum EnumAllowingOrderby{
  28. EAO_CREATE_AT = 0;
  29. EAO_TITLE = 1;
  30. }
  31. enum EnumLikeType{
  32. ELT_LIKE = 0;
  33. ELT_FAVORITE = 1;
  34. ELT_WATCH = 2;
  35. }
  36. enum EnumResType{
  37. ERT_CHAPTER = 0;
  38. ERT_ARTICLE = 1;
  39. ERT_COURSE = 2;
  40. }
  41. message LikeRequest{
  42. string Id = 1;
  43. EnumLikeType Type = 2;
  44. string ResId = 3;
  45. EnumResType ResType = 4;
  46. string Context = 5;
  47. User User = 52;
  48. }
  49. message LikeCountReply{
  50. bool ok = 1;
  51. string message = 2;
  52. message data{
  53. LikeRequest Like = 1;
  54. int32 Count = 2;
  55. bool Taken = 3;
  56. }
  57. }
  58. message LikeReply{
  59. bool ok = 1;
  60. string message = 2;
  61. LikeRequest data = 3;
  62. }
  63. message LikeListReply{
  64. bool ok = 1;
  65. string message = 2;
  66. message data{
  67. repeated LikeRequest rows = 1;
  68. int32 Count = 2;
  69. int32 PageNo = 3;
  70. int32 PageSize = 4;
  71. }
  72. }