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)
62 lines
1.2 KiB
Protocol Buffer
62 lines
1.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package next_edu_cloud.analytics.v1;
|
|
|
|
service AnalyticsService {
|
|
rpc GetClassPerformance(GetClassPerformanceRequest) returns (ClassPerformance);
|
|
rpc GetStudentWeakness(GetStudentWeaknessRequest) returns (StudentWeakness);
|
|
rpc GetLearningTrend(GetLearningTrendRequest) returns (LearningTrend);
|
|
}
|
|
|
|
message GetClassPerformanceRequest {
|
|
string class_id = 1;
|
|
string subject_id = 2;
|
|
int64 start_date = 3;
|
|
int64 end_date = 4;
|
|
}
|
|
|
|
message ClassPerformance {
|
|
string class_id = 1;
|
|
double average_score = 2;
|
|
double pass_rate = 3;
|
|
repeated StudentScore scores = 4;
|
|
}
|
|
|
|
message StudentScore {
|
|
string student_id = 1;
|
|
double score = 2;
|
|
string grade = 3;
|
|
}
|
|
|
|
message GetStudentWeaknessRequest {
|
|
string student_id = 1;
|
|
string subject_id = 2;
|
|
}
|
|
|
|
message StudentWeakness {
|
|
string student_id = 1;
|
|
repeated WeakPoint weak_points = 2;
|
|
}
|
|
|
|
message WeakPoint {
|
|
string knowledge_point_id = 1;
|
|
string title = 2;
|
|
double mastery = 3;
|
|
}
|
|
|
|
message GetLearningTrendRequest {
|
|
string student_id = 1;
|
|
int64 start_date = 2;
|
|
int64 end_date = 3;
|
|
}
|
|
|
|
message LearningTrend {
|
|
string student_id = 1;
|
|
repeated TrendPoint points = 2;
|
|
}
|
|
|
|
message TrendPoint {
|
|
int64 date = 1;
|
|
double score = 2;
|
|
}
|