修复所有设计文档中ASCII图表右侧边框对齐问题

- 修复HLD-系统概要设计.md中所有ASCII图表的右侧边框对齐
- 修复LLD-签到模块详细设计.md中ASCII图表的右侧边框对齐
- 修复LLD-会员模块详细设计.md中ASCII图表的右侧边框对齐
- 修复LLD-预约模块详细设计.md中ASCII图表的右侧边框对齐
- 确保所有ASCII图表的右侧边框纵向靠右对齐
This commit is contained in:
张翔
2026-03-04 11:20:36 +08:00
parent 97c5c08513
commit c1d7660aac
4 changed files with 1257 additions and 1257 deletions
+213 -213
View File
@@ -44,28 +44,28 @@
│ 预约模块边界 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ 预约模块内部 │ │
│ ├─────────────────────────────────────────────────────────────────┤ │
│ │ • 课程管理 • 时段管理 • 预约管理 • 库存管理 │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────────────────────┐
│ │ 预约模块内部 │
│ ├─────────────────────────────────────────────────────────────────┤
│ │ • 课程管理 • 时段管理 • 预约管理 • 库存管理 │
│ └─────────────────────────────────────────────────────────────────┘
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ 外部依赖 │ │
│ ├─────────────────────────────────────────────────────────────────┤ │
│ │ • 会员模块 (查询会员权益、扣减权益) │ │
│ │ • 教练模块 (查询教练信息、排班) │ │
│ │ • 场地模块 (查询场地信息、可用性) │ │
│ │ • 消息模块 (发送预约通知) │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────────────────────┐
│ │ 外部依赖 │
│ ├─────────────────────────────────────────────────────────────────┤
│ │ • 会员模块 (查询会员权益、扣减权益) │
│ │ • 教练模块 (查询教练信息、排班) │
│ │ • 场地模块 (查询场地信息、可用性) │
│ │ • 消息模块 (发送预约通知) │
│ └─────────────────────────────────────────────────────────────────┘
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ 被依赖 │ │
│ ├─────────────────────────────────────────────────────────────────┤ │
│ │ • 签到模块 (查询预约信息、验证签到资格) │ │
│ │ • 财务模块 (查询预约消费记录) │ │
│ │ • 数据模块 (预约数据分析) │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────────────────────┐
│ │ 被依赖 │
│ ├─────────────────────────────────────────────────────────────────┤
│ │ • 签到模块 (查询预约信息、验证签到资格) │
│ │ • 财务模块 (查询预约消费记录) │
│ │ • 数据模块 (预约数据分析) │
│ └─────────────────────────────────────────────────────────────────┘
│ │
└─────────────────────────────────────────────────────────────────────────┘
```
@@ -81,25 +81,25 @@
│ 实体关系图 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ coach │ │ course │ │ venue │ │
│ │ (教练) │ │ (课程) │ │ (场地) │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ 1:N │ 1:N │ 1:N │
│ │ │ │ │
│ └──────────────┴──────────────┘ │
│ │ 1:N │
│ ▼ │
│ ┌──────────────────┐ │
│ │ booking_slot │ │
│ │ (预约时段) │ │
│ └────────┬─────────┘ │
│ │ 1:N │
│ ▼ │
│ ┌──────────────────┐ │
│ │ booking_record │ │
│ │ (预约记录) │ │
│ └──────────────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ │ coach │ │ course │ │ venue │
│ │ (教练) │ │ (课程) │ │ (场地) │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ 1:N │ 1:N │ 1:N
│ │ │ │
│ └──────────────┴──────────────┘
│ │ 1:N
│ ▼
│ ┌──────────────────┐
│ │ booking_slot │
│ │ (预约时段) │
│ └────────┬─────────┘
│ │ 1:N
│ ▼
│ ┌──────────────────┐
│ │ booking_record │
│ │ (预约记录) │
│ └──────────────────┘
│ │
│ 关系说明: │
│ • coach (1) ─── (N) booking_slot : 一个教练有多个时段 │
@@ -334,75 +334,75 @@ CREATE INDEX idx_schedule_date ON coach_schedule(schedule_date) WHERE deleted_at
│ 预约领域模型 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ <<Entity>> │ │
│ │ BookingSlot │ │
│ ├───────────────────────────────────────────────────────────────────┤ │
│ │ - id: Long │ │
│ │ - tenantId: Long │ │
│ │ - storeId: Long │ │
│ │ - resourceType: ResourceType │ │
│ │ - resourceId: Long │ │
│ │ - coachId: Long │ │
│ │ - venueId: Long │ │
│ │ - startTime: LocalDateTime │ │
│ │ - endTime: LocalDateTime │ │
│ │ - capacity: Integer │ │
│ │ - bookedCount: Integer │ │
│ │ - waitlistCount: Integer │ │
│ │ - status: SlotStatus │ │
│ │ - version: Integer │ │
│ ├───────────────────────────────────────────────────────────────────┤ │
│ │ + hasCapacity(): Boolean │ │
│ │ + getRemainCapacity(): Integer │ │
│ │ + canBook(): Boolean │ │
│ │ + book(): void │ │
│ │ + cancel(): void │ │
│ │ + isExpired(): Boolean │ │
│ │ + isFull(): Boolean │ │
│ │ + addToWaitlist(): void │ │
│ │ + removeFromWaitlist(): void │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │ │
│ │ 1:N │
│ ▼ │
│ ┌────────────────────────────┐ ┌────────────────────────────┐ │
│ │ <<Entity>> │ │ <<Entity>> │ │
│ │ BookingRecord │ │ BookingWaitlist │ │
│ ├────────────────────────────┤ ├────────────────────────────┤ │
│ │ - id: Long │ │ - id: Long │ │
│ │ - memberId: Long │ │ - memberId: Long │ │
│ │ - slotId: Long │ │ - slotId: Long │ │
│ │ - bookingNo: String │ │ - queueNo: Integer │ │
│ │ - status: BookingStatus │ │ - status: WaitlistStatus │ │
│ │ - priceType: PriceType │ │ - expireAt: LocalDateTime │ │
│ │ - priceValue: BigDecimal │ ├────────────────────────────┤ │
│ │ - checkinStatus: CheckinSt │ │ + isExpired(): Boolean │ │
│ ├────────────────────────────┤ │ + convert(): void │ │
│ │ + canCancel(): Boolean │ └────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────────────────────┐
│ │ <<Entity>> │
│ │ BookingSlot │
│ ├───────────────────────────────────────────────────────────────────┤
│ │ - id: Long │
│ │ - tenantId: Long │
│ │ - storeId: Long │
│ │ - resourceType: ResourceType │
│ │ - resourceId: Long │
│ │ - coachId: Long │
│ │ - venueId: Long │
│ │ - startTime: LocalDateTime │
│ │ - endTime: LocalDateTime │
│ │ - capacity: Integer │
│ │ - bookedCount: Integer │
│ │ - waitlistCount: Integer │
│ │ - status: SlotStatus │
│ │ - version: Integer │
│ ├───────────────────────────────────────────────────────────────────┤
│ │ + hasCapacity(): Boolean │
│ │ + getRemainCapacity(): Integer │
│ │ + canBook(): Boolean │
│ │ + book(): void │
│ │ + cancel(): void │
│ │ + isExpired(): Boolean │
│ │ + isFull(): Boolean │
│ │ + addToWaitlist(): void │
│ │ + removeFromWaitlist(): void │
│ └───────────────────────────────────────────────────────────────────┘
│ │
│ │ 1:N
│ ▼
│ ┌────────────────────────────┐ ┌────────────────────────────┐
│ │ <<Entity>> │ │ <<Entity>> │
│ │ BookingRecord │ │ BookingWaitlist │
│ ├────────────────────────────┤ ├────────────────────────────┤
│ │ - id: Long │ │ - id: Long │
│ │ - memberId: Long │ │ - memberId: Long │
│ │ - slotId: Long │ │ - slotId: Long │
│ │ - bookingNo: String │ │ - queueNo: Integer │
│ │ - status: BookingStatus │ │ - status: WaitlistStatus │
│ │ - priceType: PriceType │ │ - expireAt: LocalDateTime │
│ │ - priceValue: BigDecimal │ ├────────────────────────────┤
│ │ - checkinStatus: CheckinSt │ │ + isExpired(): Boolean │
│ ├────────────────────────────┤ │ + convert(): void │
│ │ + canCancel(): Boolean │ └────────────────────────────┘
│ │ + cancel(): void │ │
│ │ + checkin(): void │ │
│ │ + isCheckinable(): Boolean │ │
│ └────────────────────────────┘ │
│ │
│ ┌────────────────────────────┐ ┌────────────────────────────┐ │
│ │ <<ValueObject>> │ │ <<ValueObject>> │ │
│ │ ResourceType │ │ SlotStatus │ │
│ ├────────────────────────────┤ ├────────────────────────────┤ │
│ │ GROUP_CLASS(1, "团课") │ │ AVAILABLE(1, "可预约") │ │
│ │ PRIVATE(2, "私教") │ │ FULL(2, "已满") │ │
│ │ VENUE(3, "场地") │ │ CANCELLED(3, "已取消") │ │
│ │ ONLINE(4, "线上") │ │ ENDED(4, "已结束") │ │
│ └────────────────────────────┘ └────────────────────────────┘ │
│ ┌────────────────────────────┐ ┌────────────────────────────┐
│ │ <<ValueObject>> │ │ <<ValueObject>> │
│ │ ResourceType │ │ SlotStatus │
│ ├────────────────────────────┤ ├────────────────────────────┤
│ │ GROUP_CLASS(1, "团课") │ │ AVAILABLE(1, "可预约") │
│ │ PRIVATE(2, "私教") │ │ FULL(2, "已满") │
│ │ VENUE(3, "场地") │ │ CANCELLED(3, "已取消") │
│ │ ONLINE(4, "线上") │ │ ENDED(4, "已结束") │
│ └────────────────────────────┘ └────────────────────────────┘
│ │
│ ┌────────────────────────────┐ ┌────────────────────────────┐ │
│ │ <<ValueObject>> │ │ <<ValueObject>> │ │
│ │ BookingStatus │ │ PriceType │ │
│ ├────────────────────────────┤ ├────────────────────────────┤ │
│ │ BOOKED(1, "已预约") │ │ TIMES(1, "扣次") │ │
│ │ CANCELLED(2, "已取消") │ │ DURATION(2, "扣时长") │ │
│ │ COMPLETED(3, "已完成") │ │ AMOUNT(3, "扣金额") │ │
│ │ EXPIRED(4, "已过期") │ └────────────────────────────┘ │
│ ┌────────────────────────────┐ ┌────────────────────────────┐
│ │ <<ValueObject>> │ │ <<ValueObject>> │
│ │ BookingStatus │ │ PriceType │
│ ├────────────────────────────┤ ├────────────────────────────┤
│ │ BOOKED(1, "已预约") │ │ TIMES(1, "扣次") │
│ │ CANCELLED(2, "已取消") │ │ DURATION(2, "扣时长") │
│ │ COMPLETED(3, "已完成") │ │ AMOUNT(3, "扣金额") │
│ │ EXPIRED(4, "已过期") │ └────────────────────────────┘
│ └────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
@@ -415,40 +415,40 @@ CREATE INDEX idx_schedule_date ON coach_schedule(schedule_date) WHERE deleted_at
│ 领域服务设计 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ <<DomainService>> │ │
│ │ BookingDomainService │ │
│ ├───────────────────────────────────────────────────────────────────┤ │
│ │ + createBooking(command: CreateBookingCommand): BookingRecord │ │
│ │ + cancelBooking(bookingId: Long, reason: String): void │ │
│ │ + checkin(bookingId: Long): void │ │
│ │ + addToWaitlist(memberId: Long, slotId: Long): void │ │
│ │ + processWaitlist(slotId: Long): void │ │
│ │ + validateBooking(memberId: Long, slotId: Long): void │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────────────────────┐
│ │ <<DomainService>> │
│ │ BookingDomainService │
│ ├───────────────────────────────────────────────────────────────────┤
│ │ + createBooking(command: CreateBookingCommand): BookingRecord │
│ │ + cancelBooking(bookingId: Long, reason: String): void │
│ │ + checkin(bookingId: Long): void │
│ │ + addToWaitlist(memberId: Long, slotId: Long): void │
│ │ + processWaitlist(slotId: Long): void │
│ │ + validateBooking(memberId: Long, slotId: Long): void │
│ └───────────────────────────────────────────────────────────────────┘
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ <<DomainService>> │ │
│ │ SlotDomainService │ │
│ ├───────────────────────────────────────────────────────────────────┤ │
│ │ + createSlot(command: CreateSlotCommand): BookingSlot │ │
│ │ + batchCreateSlots(command: BatchSlotCommand): List<Slot> │ │
│ │ + updateSlot(slotId: Long, command: UpdateSlotCommand): void │ │
│ │ + cancelSlot(slotId: Long, reason: String): void │ │
│ │ + getAvailableSlots(query: SlotQuery): List<BookingSlot> │ │
│ │ + incrementBookedCount(slotId: Long): Boolean │ │
│ │ + decrementBookedCount(slotId: Long): void │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────────────────────┐
│ │ <<DomainService>> │
│ │ SlotDomainService │
│ ├───────────────────────────────────────────────────────────────────┤
│ │ + createSlot(command: CreateSlotCommand): BookingSlot │
│ │ + batchCreateSlots(command: BatchSlotCommand): List<Slot> │
│ │ + updateSlot(slotId: Long, command: UpdateSlotCommand): void │
│ │ + cancelSlot(slotId: Long, reason: String): void │
│ │ + getAvailableSlots(query: SlotQuery): List<BookingSlot> │
│ │ + incrementBookedCount(slotId: Long): Boolean │
│ │ + decrementBookedCount(slotId: Long): void │
│ └───────────────────────────────────────────────────────────────────┘
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ <<DomainService>> │ │
│ │ InventoryDomainService │ │
│ ├───────────────────────────────────────────────────────────────────┤ │
│ │ + checkInventory(slotId: Long): Boolean │ │
│ │ + reserveInventory(slotId: Long, count: Integer): Boolean │ │
│ │ + releaseInventory(slotId: Long, count: Integer): void │ │
│ │ + preloadInventory(slotIds: List<Long>): void │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────────────────────┐
│ │ <<DomainService>> │
│ │ InventoryDomainService │
│ ├───────────────────────────────────────────────────────────────────┤
│ │ + checkInventory(slotId: Long): Boolean │
│ │ + reserveInventory(slotId: Long, count: Integer): Boolean │
│ │ + releaseInventory(slotId: Long, count: Integer): void │
│ │ + preloadInventory(slotIds: List<Long>): void │
│ └───────────────────────────────────────────────────────────────────┘
│ │
└─────────────────────────────────────────────────────────────────────────┘
```
@@ -464,50 +464,50 @@ CREATE INDEX idx_schedule_date ON coach_schedule(schedule_date) WHERE deleted_at
│ 团课预约流程 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ 会员端 API层 BookingService BenefitService 数据层 │
│ │ │ │ │ │ │
│ │ 1.选择课程 │ │ │ │ │
│ │─────────▶│ │ │ │ │
│ │ │ 2.查询时段 │ │ │ │
│ │ │─────────────▶│ │ │ │
│ │ │ │ 3.查询可预约时段 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │◀───────────────────────────────│ │
│ │◀─────────│ 返回时段列表 │ │ │ │
│ │ │ │ │ │ │
│ │ 4.提交预约 │ │ │ │ │
│ │─────────▶│ │ │ │ │
│ │ │ 5.创建预约 │ │ │ │
│ │ │─────────────▶│ │ │ │
│ │ │ │ 6.校验时段 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │◀───────────────────────────────│ │
│ │ │ │ │ │ │
│ │ │ │ 7.校验会员状态 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │◀───────────────────────────────│ │
│ │ │ │ │ │ │
│ │ │ │ 8.检查库存(原子)│ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │◀───────────────────────────────│ │
│ │ │ │ │ │ │
│ │ │ │ 9.扣减权益 │ │ │
│ │ │ │────────────────▶│ │ │
│ │ │ │ │─────────────▶│ │
│ │ │ │ │◀─────────────│ │
│ │ │ │◀────────────────│ │ │
│ │ │ │ │ │ │
│ │ │ │ 10.创建预约记录 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │ │ │ │
│ │ │ │ 11.增加预约人数 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │◀───────────────────────────────│ │
│ │ │ │ │ │ │
│ │ │ │ 12.发送预约通知 │ │ │
│ │◀─────────│◀─────────────│ │ │ │
│ │ 返回预约成功│ │ │ │ │
│ │ │ │ │ │ │
│ 会员端 API层 BookingService BenefitService 数据层
│ │ │ │ │ │
│ │ 1.选择课程 │ │ │ │
│ │─────────▶│ │ │ │
│ │ │ 2.查询时段 │ │ │
│ │ │─────────────▶│ │ │
│ │ │ │ 3.查询可预约时段 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │◀───────────────────────────────│
│ │◀─────────│ 返回时段列表 │ │ │
│ │ │ │ │ │
│ │ 4.提交预约 │ │ │ │
│ │─────────▶│ │ │ │
│ │ │ 5.创建预约 │ │ │
│ │ │─────────────▶│ │ │
│ │ │ │ 6.校验时段 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │◀───────────────────────────────│
│ │ │ │ │ │
│ │ │ │ 7.校验会员状态 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │◀───────────────────────────────│
│ │ │ │ │ │
│ │ │ │ 8.检查库存(原子)│ │
│ │ │ │───────────────────────────────▶│
│ │ │ │◀───────────────────────────────│
│ │ │ │ │ │
│ │ │ │ 9.扣减权益 │ │
│ │ │ │────────────────▶│ │
│ │ │ │ │─────────────▶│
│ │ │ │ │◀─────────────│
│ │ │ │◀────────────────│ │
│ │ │ │ │ │
│ │ │ │ 10.创建预约记录 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │ │ │
│ │ │ │ 11.增加预约人数 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │◀───────────────────────────────│
│ │ │ │ │ │
│ │ │ │ 12.发送预约通知 │ │
│ │◀─────────│◀─────────────│ │ │
│ │ 返回预约成功│ │ │ │
│ │ │ │ │ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
```
@@ -519,41 +519,41 @@ CREATE INDEX idx_schedule_date ON coach_schedule(schedule_date) WHERE deleted_at
│ 取消预约流程 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ 会员端 API层 BookingService BenefitService 数据层 │
│ │ │ │ │ │ │
│ │ 1.请求取消 │ │ │ │ │
│ │─────────▶│ │ │ │ │
│ │ │ 2.查询预约 │ │ │ │
│ │ │─────────────▶│ │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │◀───────────────────────────────│ │
│ │ │ │ │ │ │
│ │ │ │ 3.校验可取消 │ │ │
│ │ │ │ - 状态检查 │ │ │
│ │ │ │ - 时间检查 │ │ │
│ │ │ │ │ │ │
│ │ │ │ 4.计算退款金额 │ │ │
│ │ │ │ │ │ │
│ │ │ │ 5.退还权益 │ │ │
│ │ │ │────────────────▶│ │ │
│ │ │ │ │─────────────▶│ │
│ │ │ │ │◀─────────────│ │
│ │ │ │◀────────────────│ │ │
│ │ │ │ │ │ │
│ │ │ │ 6.更新预约状态 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │ │ │ │
│ │ │ │ 7.减少预约人数 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │ │ │ │
│ │ │ │ 8.处理候补队列 │ │ │
│ │ │ │───────────────────────────────▶│ │
│ │ │ │◀───────────────────────────────│ │
│ │ │ │ │ │ │
│ │ │ │ 9.发送取消通知 │ │ │
│ │◀─────────│◀─────────────│ │ │ │
│ │ 返回取消成功│ │ │ │ │
│ │ │ │ │ │ │
│ 会员端 API层 BookingService BenefitService 数据层
│ │ │ │ │ │
│ │ 1.请求取消 │ │ │ │
│ │─────────▶│ │ │ │
│ │ │ 2.查询预约 │ │ │
│ │ │─────────────▶│ │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │◀───────────────────────────────│
│ │ │ │ │ │
│ │ │ │ 3.校验可取消 │ │
│ │ │ │ - 状态检查 │ │
│ │ │ │ - 时间检查 │ │
│ │ │ │ │ │
│ │ │ │ 4.计算退款金额 │ │
│ │ │ │ │ │
│ │ │ │ 5.退还权益 │ │
│ │ │ │────────────────▶│ │
│ │ │ │ │─────────────▶│
│ │ │ │ │◀─────────────│
│ │ │ │◀────────────────│ │
│ │ │ │ │ │
│ │ │ │ 6.更新预约状态 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │ │ │
│ │ │ │ 7.减少预约人数 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │ │ │
│ │ │ │ 8.处理候补队列 │ │
│ │ │ │───────────────────────────────▶│
│ │ │ │◀───────────────────────────────│
│ │ │ │ │ │
│ │ │ │ 9.发送取消通知 │ │
│ │◀─────────│◀─────────────│ │ │
│ │ 返回取消成功│ │ │ │
│ │ │ │ │ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
```