完成websocket对话演示和main方法的功能抽离

This commit is contained in:
Cold
2025-12-19 15:02:05 +08:00
committed by 张斌
parent 5bc580b3b8
commit 7381d57b77
5 changed files with 85 additions and 10 deletions

View File

@@ -502,6 +502,11 @@ func GetUserState(ctx context.Context, userId, platform string) (state *UserStat
state = &UserState{Stage: 5} // 默认状态5未选择方向
if result.IsEmpty() {
// Redis为空初始化默认状态
if initErr := SetUserStage(ctx, userId, platform, 5); initErr != nil {
err = initErr
return
}
return
}