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;
}
