KnowledgeService.proto 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. syntax = "proto3";
  2. option csharp_namespace = "TMDGrpc.KnowledgeService";
  3. option java_package = "TMDGrpc.KnowledgeService";
  4. package TMDGrpc;
  5. service KnowledgeService {
  6. //查询知识点
  7. rpc FinKnowledge(Dict) returns(stream Knowledge);
  8. //保存知识点
  9. rpc SaveKnowledge(stream Knowledge) returns(stream Knowledge);
  10. //删除知识点
  11. rpc DeleteKnowledge(ListPid) returns(ListPid);
  12. }
  13. //请求参数Dict
  14. message Dict {
  15. //数字Dict
  16. map<string,double> NMap = 1;
  17. //字符串Dict
  18. map<string,string> SMap = 2;
  19. //布尔Dict
  20. map<string,bool> BMap = 3;
  21. //字符串ListMap
  22. repeated LSMap LSMap = 4;
  23. //数字ListMap
  24. repeated LNMap LNMap = 5;
  25. //Byte ListMap
  26. repeated LBMap LBMap = 6;
  27. }
  28. //Byte[] Map
  29. message LBMap {
  30. //Key
  31. string Key = 1;
  32. //byte数组
  33. bytes Value = 2;
  34. }
  35. //数字ListMap
  36. message LNMap {
  37. //Key
  38. string Key = 1;
  39. //数字数组
  40. repeated double Value = 2 [packed = false];
  41. }
  42. //字符串ListMap
  43. message LSMap {
  44. //数字Dict
  45. string Key = 1;
  46. //字符串数组
  47. repeated string Value = 2;
  48. }
  49. //知识点
  50. message Knowledge {
  51. string id = 1;
  52. //标记为知识块,0=知识块 ,1 知识点
  53. int32 type = 2;
  54. //名称
  55. string name = 3;
  56. //描述
  57. string alias = 4;
  58. //学科
  59. string subjectCode = 5;
  60. //学校编码 如果是教师个人知识点为醍摩豆id 否则为学校编码
  61. string scopeCode = 6;
  62. int32 order = 7;
  63. //删除状态0 删除 1 有效
  64. int32 status = 8;
  65. //知识点 id
  66. repeated string points = 9;
  67. //来自于标准表 Rowkey
  68. string knowledgeId = 10;
  69. //0 标准,1自建,2.....
  70. int32 source = 11;
  71. //学段 私有的没有学段
  72. string period = 12;
  73. }
  74. enum HttpStatusCode {
  75. option allow_alias = true;
  76. ZERO = 0; // proto3 requires a zero value as the first item (it can be named anything)
  77. Continue = 100;
  78. SwitchingProtocols = 101;
  79. Processing = 102;
  80. EarlyHints = 103;
  81. OK = 200;
  82. Created = 201;
  83. Accepted = 202;
  84. NonAuthoritativeInformation = 203;
  85. NoContent = 204;
  86. ResetContent = 205;
  87. PartialContent = 206;
  88. MultiStatus = 207;
  89. AlreadyReported = 208;
  90. IMUsed = 226;
  91. Ambiguous = 300;
  92. MultipleChoices = 300;
  93. MovedPermanently = 301;
  94. Moved = 301;
  95. Found = 302;
  96. Redirect = 302;
  97. SeeOther = 303;
  98. RedirectMethod = 303;
  99. NotModified = 304;
  100. UseProxy = 305;
  101. Unused = 306;
  102. TemporaryRedirect = 307;
  103. RedirectKeepVerb = 307;
  104. PermanentRedirect = 308;
  105. BadRequest = 400;
  106. Unauthorized = 401;
  107. PaymentRequired = 402;
  108. Forbidden = 403;
  109. NotFound = 404;
  110. MethodNotAllowed = 405;
  111. NotAcceptable = 406;
  112. ProxyAuthenticationRequired = 407;
  113. RequestTimeout = 408;
  114. Conflict = 409;
  115. Gone = 410;
  116. LengthRequired = 411;
  117. PreconditionFailed = 412;
  118. RequestEntityTooLarge = 413;
  119. RequestUriTooLong = 414;
  120. UnsupportedMediaType = 415;
  121. RequestedRangeNotSatisfiable = 416;
  122. ExpectationFailed = 417;
  123. MisdirectedRequest = 421;
  124. UnprocessableEntity = 422;
  125. Locked = 423;
  126. FailedDependency = 424;
  127. UpgradeRequired = 426;
  128. PreconditionRequired = 428;
  129. TooManyRequests = 429;
  130. RequestHeaderFieldsTooLarge = 431;
  131. UnavailableForLegalReasons = 451;
  132. InternalServerError = 500;
  133. NotImplemented = 501;
  134. BadGateway = 502;
  135. ServiceUnavailable = 503;
  136. GatewayTimeout = 504;
  137. HttpVersionNotSupported = 505;
  138. VariantAlsoNegotiates = 506;
  139. InsufficientStorage = 507;
  140. LoopDetected = 508;
  141. NotExtended = 510;
  142. NetworkAuthenticationRequired = 511;
  143. }
  144. message IdPk {
  145. string id = 1;
  146. string pk = 2;
  147. HttpStatusCode StatusCode = 3;
  148. }
  149. message ListPid {
  150. //list IdPk
  151. repeated IdPk idPks = 1;
  152. }