feat: initialize Nuanji (Warm Notes) project
- Base platform from base.git (ERP base: auth, core, config, message, workflow, plugin) - Created erp-diary module skeleton (lib.rs, dto.rs, error.rs, event.rs, state.rs) - Integrated erp-diary into workspace and erp-server - Added DiaryModule registration in main.rs - Added DiaryState FromRef in state.rs - Diary routes mounted (empty routes, ready for implementation) - Product design spec v1.2 preserved in docs/ - Implementation plan preserved in plans/ Cargo check: OK Cargo test: OK (78+ base tests passing)
This commit is contained in:
61
crates/erp-diary/src/event.rs
Normal file
61
crates/erp-diary/src/event.rs
Normal file
@@ -0,0 +1,61 @@
|
||||
// erp-diary 事件定义
|
||||
|
||||
/// 日记模块领域事件
|
||||
pub enum DiaryEvent {
|
||||
/// 日记创建
|
||||
JournalCreated {
|
||||
journal_id: uuid::Uuid,
|
||||
author_id: uuid::Uuid,
|
||||
class_id: Option<uuid::Uuid>,
|
||||
},
|
||||
/// 日记更新
|
||||
JournalUpdated {
|
||||
journal_id: uuid::Uuid,
|
||||
author_id: uuid::Uuid,
|
||||
version: i32,
|
||||
},
|
||||
/// 日记删除
|
||||
JournalDeleted {
|
||||
journal_id: uuid::Uuid,
|
||||
author_id: uuid::Uuid,
|
||||
},
|
||||
/// 日记分享到班级
|
||||
JournalShared {
|
||||
journal_id: uuid::Uuid,
|
||||
author_id: uuid::Uuid,
|
||||
class_id: uuid::Uuid,
|
||||
},
|
||||
/// 班级创建
|
||||
ClassCreated {
|
||||
class_id: uuid::Uuid,
|
||||
teacher_id: uuid::Uuid,
|
||||
},
|
||||
/// 学生加入班级
|
||||
StudentJoinedClass {
|
||||
class_id: uuid::Uuid,
|
||||
student_id: uuid::Uuid,
|
||||
},
|
||||
/// 老师布置主题
|
||||
TopicAssigned {
|
||||
topic_id: uuid::Uuid,
|
||||
class_id: uuid::Uuid,
|
||||
teacher_id: uuid::Uuid,
|
||||
},
|
||||
/// 老师点评
|
||||
CommentCreated {
|
||||
comment_id: uuid::Uuid,
|
||||
journal_id: uuid::Uuid,
|
||||
teacher_id: uuid::Uuid,
|
||||
student_id: uuid::Uuid,
|
||||
},
|
||||
/// 家长绑定孩子
|
||||
ParentBound {
|
||||
parent_id: uuid::Uuid,
|
||||
child_id: uuid::Uuid,
|
||||
},
|
||||
/// 成就解锁
|
||||
AchievementUnlocked {
|
||||
user_id: uuid::Uuid,
|
||||
achievement_id: String,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user