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:
iven
2026-05-31 20:52:19 +08:00
commit c539e6fd83
285 changed files with 59156 additions and 0 deletions

View 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,
},
}