完善 server-rs DDD 重构计划与骨架
This commit is contained in:
3
server-rs/crates/module-inventory/src/application.rs
Normal file
3
server-rs/crates/module-inventory/src/application.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
//! 背包应用编排过渡落位。
|
||||
//!
|
||||
//! 这里只返回背包变更结果和领域事件,不直接访问持久化。
|
||||
3
server-rs/crates/module-inventory/src/commands.rs
Normal file
3
server-rs/crates/module-inventory/src/commands.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
//! 背包写入命令过渡落位。
|
||||
//!
|
||||
//! 用于表达授予物品、装备、卸下、消耗和整理等输入。
|
||||
4
server-rs/crates/module-inventory/src/domain.rs
Normal file
4
server-rs/crates/module-inventory/src/domain.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
//! 背包领域模型过渡落位。
|
||||
//!
|
||||
//! 后续迁移背包槽、装备槽、堆叠和消耗规则时,只保留物品状态变化;
|
||||
//! SpacetimeDB 表查询写回由 adapter 处理。
|
||||
3
server-rs/crates/module-inventory/src/errors.rs
Normal file
3
server-rs/crates/module-inventory/src/errors.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
//! 背包领域错误过渡落位。
|
||||
//!
|
||||
//! 错误保持可测试的业务语义,例如数量不足、槽位冲突和物品不存在。
|
||||
3
server-rs/crates/module-inventory/src/events.rs
Normal file
3
server-rs/crates/module-inventory/src/events.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
//! 背包领域事件过渡落位。
|
||||
//!
|
||||
//! 用于表达物品获得、物品消耗、装备变化和槽位投影变化等事实。
|
||||
@@ -1,3 +1,9 @@
|
||||
mod application;
|
||||
mod commands;
|
||||
mod domain;
|
||||
mod errors;
|
||||
mod events;
|
||||
|
||||
use std::{error::Error, fmt};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
Reference in New Issue
Block a user