syntax = "proto3";

package next_edu_cloud.content.v1;

service TextbookService {
  rpc CreateTextbook(CreateTextbookRequest) returns (Textbook);
  rpc GetTextbook(GetTextbookRequest) returns (Textbook);
  rpc ListTextbooks(ListTextbooksRequest) returns (ListTextbooksResponse);
}

service KnowledgeGraphService {
  rpc GetPrerequisites(GetPrerequisitesRequest) returns (KnowledgePointsResponse);
  rpc GetLearningPath(GetLearningPathRequest) returns (LearningPath);
}

message Textbook {
  string id = 1;
  string title = 2;
  string subject_id = 3;
  string grade_id = 4;
  string version = 5;
}

message CreateTextbookRequest {
  string title = 1;
  string subject_id = 2;
  string grade_id = 3;
  string version = 4;
}

message GetTextbookRequest { string id = 1; }
message ListTextbooksRequest { string subject_id = 1; string grade_id = 2; }
message ListTextbooksResponse { repeated Textbook textbooks = 1; }

message KnowledgePoint {
  string id = 1;
  string title = 2;
}

message GetPrerequisitesRequest { string knowledge_point_id = 1; }
message KnowledgePointsResponse { repeated KnowledgePoint points = 1; }

message GetLearningPathRequest { string student_id = 1; string subject_id = 2; }
message LearningPath {
  repeated KnowledgePoint points = 1;
  repeated string recommended_order = 2;
}
