CourseService.proto 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. syntax = "proto3";
  2. option csharp_namespace = "TMDGrpc.CourseService";
  3. option java_package = "TMDGrpc.CourseService";
  4. package TMDGrpc;
  5. service CourseService {
  6. //查询课程
  7. rpc FindCourseByDict(Dict) returns(stream Course);
  8. //保存课程
  9. rpc SaveCourse(stream Course) returns(stream Course);
  10. //删除课程
  11. rpc DeleteCourse(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 BaseInfo {
  51. //课程编码
  52. string courseCode = 1;
  53. //课程名称
  54. string courseName = 2;
  55. //学段编码
  56. string periodCode = 3;
  57. //年级编码
  58. string gradeCode = 4;
  59. //学科编码
  60. string subjectCode = 5;
  61. //课程公告
  62. string notice = 6;
  63. }
  64. //课程
  65. message Course {
  66. //学校编码 如果是教师个人知识点 则为 personal(写死) 否则为学校编码
  67. string scopeCode = 1;
  68. //基础信息
  69. BaseInfo baseInfo = 2;
  70. //协同教师
  71. repeated string assistTeacher = 3;
  72. //上课时间表
  73. repeated CourseTime courseTime = 4;
  74. //课程“教室” Classroom
  75. repeated string classroom = 5;
  76. //关联课纲 SyllabusNode
  77. repeated string syllabus = 6;
  78. //id
  79. string id = 7;
  80. }
  81. //上课时间表
  82. message CourseTime {
  83. //上课频率 每日、每周、每月、临时课程
  84. string frequencyCode = 1;
  85. //课程开始时间
  86. string beginTime = 2;
  87. //课程结束时间
  88. string endTime = 3;
  89. //上课班级/教室
  90. string classroomCode = 4;
  91. //临时课程
  92. repeated string frequencyName = 5;
  93. }
  94. enum HttpStatusCode {
  95. option allow_alias = true;
  96. ZERO = 0; // proto3 requires a zero value as the first item (it can be named anything)
  97. Continue = 100;
  98. SwitchingProtocols = 101;
  99. Processing = 102;
  100. EarlyHints = 103;
  101. OK = 200;
  102. Created = 201;
  103. Accepted = 202;
  104. NonAuthoritativeInformation = 203;
  105. NoContent = 204;
  106. ResetContent = 205;
  107. PartialContent = 206;
  108. MultiStatus = 207;
  109. AlreadyReported = 208;
  110. IMUsed = 226;
  111. Ambiguous = 300;
  112. MultipleChoices = 300;
  113. MovedPermanently = 301;
  114. Moved = 301;
  115. Found = 302;
  116. Redirect = 302;
  117. SeeOther = 303;
  118. RedirectMethod = 303;
  119. NotModified = 304;
  120. UseProxy = 305;
  121. Unused = 306;
  122. TemporaryRedirect = 307;
  123. RedirectKeepVerb = 307;
  124. PermanentRedirect = 308;
  125. BadRequest = 400;
  126. Unauthorized = 401;
  127. PaymentRequired = 402;
  128. Forbidden = 403;
  129. NotFound = 404;
  130. MethodNotAllowed = 405;
  131. NotAcceptable = 406;
  132. ProxyAuthenticationRequired = 407;
  133. RequestTimeout = 408;
  134. Conflict = 409;
  135. Gone = 410;
  136. LengthRequired = 411;
  137. PreconditionFailed = 412;
  138. RequestEntityTooLarge = 413;
  139. RequestUriTooLong = 414;
  140. UnsupportedMediaType = 415;
  141. RequestedRangeNotSatisfiable = 416;
  142. ExpectationFailed = 417;
  143. MisdirectedRequest = 421;
  144. UnprocessableEntity = 422;
  145. Locked = 423;
  146. FailedDependency = 424;
  147. UpgradeRequired = 426;
  148. PreconditionRequired = 428;
  149. TooManyRequests = 429;
  150. RequestHeaderFieldsTooLarge = 431;
  151. UnavailableForLegalReasons = 451;
  152. InternalServerError = 500;
  153. NotImplemented = 501;
  154. BadGateway = 502;
  155. ServiceUnavailable = 503;
  156. GatewayTimeout = 504;
  157. HttpVersionNotSupported = 505;
  158. VariantAlsoNegotiates = 506;
  159. InsufficientStorage = 507;
  160. LoopDetected = 508;
  161. NotExtended = 510;
  162. NetworkAuthenticationRequired = 511;
  163. }
  164. message IdPk {
  165. string id = 1;
  166. string pk = 2;
  167. HttpStatusCode StatusCode = 3;
  168. }
  169. message ListPid {
  170. //list IdPk
  171. repeated IdPk idPks = 1;
  172. }