comment.proto 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. syntax = "proto3";
  2. import "public.proto";
  3. package pcds.comment.v1;
  4. /*
  5. * 评论(修改建议/问答/评论)
  6. *
  7. *
  8. */
  9. service Comment{
  10. rpc GetCommentList (CommentListRequest) returns (CommentListReply){}
  11. rpc GetComment (CommentRequest) returns (CommentReply){}
  12. rpc SetComment (CommentRequest) returns (CommentReply){}
  13. rpc AddComment (CommentRequest) returns (CommentReply){}
  14. rpc DelComment (CommentRequest) returns (CommentReply){}
  15. }
  16. message CommentListRequest{
  17. string ResId = 1;
  18. EnumResType ResType = 2;
  19. string Search = 3;
  20. EnumAllowingSearch SearchCol = 4;
  21. int32 CurrentPage = 5;
  22. int32 PerPage = 6;
  23. EnumAllowingOrderby OrderBy = 7;
  24. bool Desc = 8;
  25. }
  26. enum EnumAllowingSearch{
  27. EAS_CONTENT = 0;
  28. }
  29. enum EnumAllowingOrderby{
  30. EAO_UPDATED_AT = 0;
  31. }
  32. enum EnumCommentType{
  33. ECT_MODIFY = 0;
  34. ECT_QA = 1;
  35. ECT_COMMENT = 2;
  36. }
  37. enum EnumResType{
  38. ERT_CHAPTER = 0;
  39. ERT_ARTICLE = 1;
  40. ERT_COURSE = 2;
  41. }
  42. message CommentRequest{
  43. string Id = 1;
  44. EnumCommentType Type = 2;
  45. string ResId = 3;
  46. EnumResType ResType = 4;
  47. string ParentId = 5;
  48. string Content = 6;
  49. string Lang = 51;
  50. User Editor = 52;
  51. EnumPublicity Publicity = 53;
  52. string CreatedAt = 101;
  53. string UpdatedAt = 102;
  54. }
  55. message CommentReply{
  56. bool ok = 1;
  57. string message = 2;
  58. CommentRequest data = 3;
  59. }
  60. message CommentListReply{
  61. bool ok = 1;
  62. string message = 2;
  63. message data{
  64. repeated CommentRequest rows = 1;
  65. int32 Count = 2;
  66. int32 PageNo = 3;
  67. int32 PageSize = 4;
  68. }
  69. }