P4 阶段交付物: - services/content: 内容资源服务(NestJS) - textbooks: 教材 CRUD + 知识图谱绑定 - config/neo4j.ts: Neo4j driver 单例 - textbooks.service.ts: MySQL CRUD + Neo4j 知识图谱(createKnowledgeGraph/getPrerequisites) - package.json: 补充 @opentelemetry/sdk-node + exporter-trace-otlp-http - services/data-ana: 数据分析服务(Python FastAPI) - main.py: FastAPI + /healthz + class_performance + student_weakness 骨架 - clickhouse_client.py: ClickHouse 客户端封装 - config.py: 环境变量配置 - packages/shared-proto/proto/content.proto: TextbookService + KnowledgeGraphService 契约 - packages/shared-proto/proto/analytics.proto: AnalyticsService 契约(class_performance/student_weakness)
48 lines
1.3 KiB
Protocol Buffer
48 lines
1.3 KiB
Protocol Buffer
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;
|
|
}
|