@@ -5,12 +5,8 @@ import "google/protobuf/wrappers.proto";
55
66// Service definition for CoursesService
77service CoursesService {
8- // Lookup Course entity by id
9- rpc LookupCourseById (LookupCourseByIdRequest ) returns (LookupCourseByIdResponse ) {}
108 // Lookup Employee entity by id
119 rpc LookupEmployeeById (LookupEmployeeByIdRequest ) returns (LookupEmployeeByIdResponse ) {}
12- // Lookup Lesson entity by id
13- rpc LookupLessonById (LookupLessonByIdRequest ) returns (LookupLessonByIdResponse ) {}
1410 rpc MutationAddCourse (MutationAddCourseRequest ) returns (MutationAddCourseResponse ) {}
1511 rpc MutationAddLesson (MutationAddLessonRequest ) returns (MutationAddLessonResponse ) {}
1612 rpc QueryCourse (QueryCourseRequest ) returns (QueryCourseResponse ) {}
@@ -20,74 +16,6 @@ service CoursesService {
2016 rpc QueryThrowErrorCourses (QueryThrowErrorCoursesRequest ) returns (QueryThrowErrorCoursesResponse ) {}
2117}
2218
23- // Key message for Course entity lookup
24- message LookupCourseByIdRequestKey {
25- // Key field for Course entity lookup.
26- string id = 1 ;
27- }
28-
29- // Request message for Course entity lookup.
30- message LookupCourseByIdRequest {
31- /*
32- * List of keys to look up Course entities.
33- * Order matters - each key maps to one entity in LookupCourseByIdResponse.
34- */
35- repeated LookupCourseByIdRequestKey keys = 1 ;
36- }
37-
38- // Response message for Course entity lookup.
39- message LookupCourseByIdResponse {
40- /*
41- * List of Course entities in the same order as the keys in LookupCourseByIdRequest.
42- * Always return the same number of entities as keys. Use null for entities that cannot be found.
43- *
44- * Example:
45- * LookupUserByIdRequest:
46- * keys:
47- * - id: 1
48- * - id: 2
49- * LookupUserByIdResponse:
50- * result:
51- * - id: 1 # User with id 1 found
52- * - null # User with id 2 not found
53- */
54- repeated Course result = 1 ;
55- }
56-
57- // Key message for Lesson entity lookup
58- message LookupLessonByIdRequestKey {
59- // Key field for Lesson entity lookup.
60- string id = 1 ;
61- }
62-
63- // Request message for Lesson entity lookup.
64- message LookupLessonByIdRequest {
65- /*
66- * List of keys to look up Lesson entities.
67- * Order matters - each key maps to one entity in LookupLessonByIdResponse.
68- */
69- repeated LookupLessonByIdRequestKey keys = 1 ;
70- }
71-
72- // Response message for Lesson entity lookup.
73- message LookupLessonByIdResponse {
74- /*
75- * List of Lesson entities in the same order as the keys in LookupLessonByIdRequest.
76- * Always return the same number of entities as keys. Use null for entities that cannot be found.
77- *
78- * Example:
79- * LookupUserByIdRequest:
80- * keys:
81- * - id: 1
82- * - id: 2
83- * LookupUserByIdResponse:
84- * result:
85- * - id: 1 # User with id 1 found
86- * - null # User with id 2 not found
87- */
88- repeated Lesson result = 1 ;
89- }
90-
9119// Key message for Employee entity lookup
9220message LookupEmployeeByIdRequestKey {
9321 // Key field for Employee entity lookup.
@@ -179,6 +107,11 @@ message MutationAddLessonResponse {
179107 Lesson add_lesson = 1 ;
180108}
181109
110+ message Employee {
111+ int32 id = 1 ;
112+ repeated Course taught_courses = 2 ;
113+ }
114+
182115message Course {
183116 string id = 1 ;
184117 string title = 2 ;
@@ -194,9 +127,4 @@ message Lesson {
194127 google.protobuf.StringValue description = 4 ;
195128 int32 order = 5 ;
196129 Course course = 6 ;
197- }
198-
199- message Employee {
200- int32 id = 1 ;
201- repeated Course taught_courses = 2 ;
202130}
0 commit comments