refactor: auto-init guest chat quota on first read, clean up logs
- Remove unused `quotaWarningThreshold` and `warningThreshold` getter from `GuestChatQuota` DTO - Apply get-or-init pattern in `ChatStorage.getGuestDailyChatQuota` and `getGuestTotalQuota`: when no existing value, initialize with DTO defaults (`threshold` = max per day, `totalQuotaDefault`) and return the seeded data - Fall back to original `null` result if initialization write fails - Consolidate logging strategy: drop per-actor trace logs in `chat-machine.ts`, keep business-decision logs in 3 assign actions, move all actor ENTRY/API/DONE chains to `chat-machine.actors.ts` and helper load logs to `chat-machine.helpers.ts`
This commit is contained in:
@@ -29,8 +29,6 @@ export interface ChatState {
|
||||
*/
|
||||
wsConnected: boolean;
|
||||
/** 游客剩余配额(次/天)—— **仅**游客业务展示用
|
||||
* - default 0 = "未初始化" / "已耗尽"(同码,靠 `isGuest` 区分)
|
||||
* - 非游客:永不被赋值(业务事实"无消息限制")
|
||||
*/
|
||||
guestRemainingQuota: number;
|
||||
/** 游客总配额(仅游客展示用) */
|
||||
|
||||
Reference in New Issue
Block a user