chore(content): merge content full implementation into main

Merge feat/content-ai09 with complete content service
This commit is contained in:
SpecialX
2026-07-10 19:13:02 +08:00
74 changed files with 5256 additions and 355 deletions

View File

@@ -10,30 +10,14 @@ package next_edu_cloud.events.v1;
// edu.teaching.<aggregate>.<action>
//
// Event routing (TOPIC_MAP in outbox.publisher.ts):
// edu.teaching.exam.created <- ExamEvent.created
// edu.teaching.exam.updated <- ExamEvent.updated
// edu.teaching.exam.published <- ExamEvent.published
// edu.teaching.exam.submitted <- ExamEvent.submitted
// edu.teaching.exam.deleted <- ExamEvent.deleted
// edu.teaching.homework.assigned <- HomeworkEvent.assigned
// edu.teaching.homework.submitted <- HomeworkEvent.submitted
// edu.teaching.homework.graded <- HomeworkEvent.graded
// edu.teaching.grade.recorded <- GradeEvent.recorded
// edu.teaching.grade.updated <- GradeEvent.updated
// edu.teaching.attendance.recorded <- AttendanceEvent.recorded
// edu.teaching.class.transferred <- ClassEvent.transferred
//
// All events MUST include:
// - schema_version: event schema version (default "v1")
// - event_id: UUID for idempotent consumption
// - occurred_at: business timestamp (ms epoch)
// - metadata: { traceId, userId }
message EventMetadata {
string schema_version = 1;
string trace_id = 2;
string user_id = 3;
}
// edu.exam.events <- exam.created / exam.updated / exam.deleted
// edu.homework.events <- homework.assigned / homework.submitted / homework.graded
// edu.grade.events <- grade.recorded / grade.updated
// edu.class.events <- class.transferred
// edu.content.textbook.events <- textbook.created / textbook.updated / textbook.published / textbook.archived
// edu.content.chapter.events <- chapter.created / chapter.updated / chapter.deleted
// edu.content.knowledge_point.events <- knowledge_point.created / knowledge_point.updated / knowledge_point.prerequisite_added / knowledge_point.prerequisite_removed
// edu.content.question.events <- question.created / question.updated / question.published / question.deleted
message ClassEvent {
string event_id = 1;
@@ -144,3 +128,60 @@ message AuditEvent {
string trace_id = 13;
map<string, string> metadata = 14;
}
message TextbookEvent {
string event_id = 1;
string aggregate_id = 2;
string event_type = 3;
int64 occurred_at = 4;
string textbook_id = 5;
string title = 6;
string subject_id = 7;
string grade_id = 8;
string version = 9;
string action = 10;
map<string, string> metadata = 11;
}
message ChapterEvent {
string event_id = 1;
string aggregate_id = 2;
string event_type = 3;
int64 occurred_at = 4;
string chapter_id = 5;
string textbook_id = 6;
string title = 7;
int32 order = 8;
string action = 9;
map<string, string> metadata = 10;
}
message KnowledgePointEvent {
string event_id = 1;
string aggregate_id = 2;
string event_type = 3;
int64 occurred_at = 4;
string kp_id = 5;
string chapter_id = 6;
string title = 7;
int32 difficulty = 8;
string action = 9;
string prerequisite_id = 10;
map<string, string> metadata = 11;
}
message QuestionEvent {
string event_id = 1;
string aggregate_id = 2;
string event_type = 3;
int64 occurred_at = 4;
string question_id = 5;
string kp_id = 6;
string type = 7;
int32 difficulty = 8;
string status = 9;
string source = 10;
string created_by = 11;
string action = 12;
map<string, string> metadata = 13;
}