dictionary.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. syntax = "proto3";
  2. import "public.proto";
  3. package dictionary;
  4. /*
  5. * dictionary 服务
  6. * 逐词译数据推送到社区字典,当这个channel是公开channel的时候。以channel的名义公开。不是公开channel ,推送到该studio默认channel
  7. * 每个channel对应一个且仅一个用户字典
  8. * 协作用户使用公共channel干活。公开的社区词典数据进到这个channel ,以及自己的默认channel
  9. */
  10. service Dictionary{
  11. //词典管理
  12. rpc GetDictListForStudio (DictListRequest) returns (DictListReply){} //列出 studio 里面的全部字典
  13. rpc GetDictListForChannel (DictListRequest) returns (DictListReply){} //列出 channel 里面的全部字典
  14. rpc GetDict (DictRequest) returns (DictReply){}
  15. rpc SetDict (DictRequest) returns (DictReply){}
  16. rpc AddDict (DictRequest) returns (DictReply){}
  17. rpc DelDict (DictRequest) returns (DictReply){}
  18. //单词管理
  19. rpc GetWordListForStudio (WordListRequest) returns (WordListReply){}
  20. rpc GetWordListForDict (WordListRequest) returns (WordListReply){}
  21. rpc GetWordListForChannel (WordListRequest) returns (WordListReply){} //这个 channel 里面的全部术语
  22. rpc GetWord (WordRequest) returns (DictReply){}
  23. rpc SetWord (WordRequest) returns (DictReply){}
  24. rpc AddWord (WordRequest) returns (DictReply){}
  25. rpc DelWord (WordRequest) returns (DictReply){}
  26. }
  27. message DictListRequest{
  28. string Id = 1;
  29. string Search = 3;
  30. EnumAllowingSearch SearchCol = 4;
  31. int32 CurrentPage = 5;
  32. int32 PageSize = 6;
  33. EnumAllowingOrderby OrderBy = 7;
  34. bool Desc = 8;
  35. }
  36. enum EnumAllowingSearch{
  37. EAS_WORD = 0;
  38. EAS_NOTE = 1;
  39. }
  40. enum EnumAllowingOrderby{
  41. EAO_CREATED_AT = 0;
  42. EAO_UPDATED_AT = 0;
  43. EAO_WORD = 1;
  44. }
  45. message DictRequest{
  46. string Id = 1;
  47. string Word = 2;
  48. string Tag = 3;
  49. string Meaning = 4;
  50. string Meaning2 = 5;
  51. string Note = 6;
  52. string Channel = 7;
  53. string Studio = 8;
  54. string Lang = 51;
  55. string EditorId = 52;
  56. EnumPublicity Publicity = 53;
  57. string CreatedAt = 101;
  58. string UpdatedAt = 102;
  59. }
  60. message DictReply{
  61. bool ok = 1;
  62. string message = 2;
  63. DictRequest data = 3;
  64. }
  65. message DictListReply{
  66. bool ok = 1;
  67. string message = 2;
  68. message data{
  69. repeated DictRequest rows = 1;
  70. int32 Count = 2;
  71. int32 PageNo = 3;
  72. int32 PageSize = 4;
  73. }
  74. }
  75. message WordListRequest{
  76. string Id = 1;
  77. string Search = 3;
  78. EnumAllowingSearch SearchCol = 4;
  79. int32 CurrentPage = 5;
  80. int32 PageSize = 6;
  81. EnumAllowingOrderby OrderBy = 7;
  82. bool Desc = 8;
  83. }
  84. enum EnumWordAllowingSearch{
  85. EWAS_WORD = 0;
  86. EWAS_NOTE = 1;
  87. }
  88. enum EnumWordAllowingOrderby{
  89. EWAO_UPDATED_AT = 0;
  90. EWAO_CREATED_AT = 1;
  91. EWAO_WORD = 2;
  92. }
  93. message WordRequest{
  94. string Id = 1;
  95. string Word = 2;
  96. string Type = 3;
  97. string Grammar = 4;
  98. string Parent = 5;
  99. string Meaning = 6;
  100. string Note = 7;
  101. string Factors = 8;
  102. string FactorMeaning = 9;
  103. string Confidence = 10;
  104. string Meta = 11;
  105. string Channel = 12;
  106. string Studio = 13;
  107. string Lang = 51;
  108. string Editor = 52;
  109. EnumPublicity Publicity = 53;
  110. string CreatedAt = 101;
  111. string UpdatedAt = 102;
  112. }
  113. message WordReply{
  114. bool ok = 1;
  115. string message = 2;
  116. WordRequest data = 3;
  117. }
  118. message WordListReply{
  119. bool ok = 1;
  120. string message = 2;
  121. message data{
  122. repeated WordRequest rows = 1;
  123. int32 Count = 2;
  124. int32 PageNo = 3;
  125. int32 PageSize = 4;
  126. }
  127. }