- Extract club information (clubId, clubName) from event page in `getEventInfo`.
- Update `getMatchDetail` to return both `detail` and `summary`.
- Introduce `MatchSummary` interface in `src/types/index.ts`.
- Update `EventPage` to display the club name and link to the club page.
- Adjust `EventSubscribeService` and loaders to handle the new return structure.
- Clean up test files and mock data loading logic.
- Add CascaderProvinceCity component to ClubSearchTable for selecting province/city.
- Update KaiqiuService.findClub to accept and append province/city parameters to the query URL.
- Update server-side API handler to extract province/city from query parameters.
- Improve date parsing logic in event processing to handle invalid start dates gracefully.
- Refactor uidScoreStore to use a loop instead of map for better performance/clarity.
- Add debug logging for profile caching in xcxApi.
The search functionality now supports filtering clubs by administrative division, providing users with more precise search results.
- Move `parseEventInfo` and `fetchEventContentHTML` logic into `KaiqiuService`.
- Implement differentiated caching strategies:
- For finished matches: Cache indefinitely (no TTL) to stop unnecessary HTTP requests since the result is final.
- For ongoing matches: Retain the 5-minute TTL to fetch live updates.
- Remove unused utility functions from `server.ts`.
- Update type imports to include `EventDetail` and `Player`.
This change reduces server load by avoiding repeated requests for matches with confirmed results, while ensuring live games remain up-to-date.
Introduce Redis caching logic to `getClubInfo` and `getMatchDetail` methods in `KaiqiuService` to improve performance and reduce network requests.
- Added optional `force` parameter to bypass cache when needed.
- Implemented cache fallback for connection timeouts.
- Updated cache expiration times (e.g., 24h for club info, 5m for match details).
- Propagated the `force` parameter from `EventSubscribeService` to ensure data freshness.
Update the `info` array generation logic to concatenate the `see` and `nums` values into a single string separated by a space, instead of keeping them as separate array elements.
This change standardizes the format of the information display for match events.
- Extract 'nums' (号码) and 'see' (查看次数) from event page content.
- Include extracted data in the `IEventInfo` structure for display.
- Implement Redis caching for event details (key: `my-kaiqiuwang:event-info:${eventId}`).
- Cache strategy: Store result for 60 seconds, or refresh if cached data shows timeout errors or force flag is set.
- Reduces redundant external requests and improves response reliability.
- Introduce Redis caching for event lists to reduce redundant fetches and handle timeouts gracefully. Added a `force` query parameter to bypass cache when needed.
- Added a check in `EventWatchSchedule` to skip processing if player list is empty, preventing errors from rate-limited or failed requests.
- Updated the `listClubEvents` signature to accept the new `force` parameter and modified API endpoints to propagate this flag.
- Introduce PermissionControlPanel in UserCenter for managing notification permissions.
- Update Service Worker (sw.ts) to handle background push notifications via Firebase Cloud Messaging.
- Implement EventSubscribeService logic to fetch active events, filter expired ones, and clean up subscriptions.
- Refactor KaiqiuService and parsing utilities to include eventId in event details.
- Remove deprecated ScheduleService and inline sendNotification logic.
- Update utility functions to support new types and notification checks.
- Add VAPI public key configuration and update Firebase exports.
Refactor the application to implement native browser push notifications and remove unnecessary Redis caching for performance optimization.
Key changes:
- Introduce a dedicated server topic 'SERVER_PUSH' to handle push notification messages via WebSocket.
- Implement a Service Worker (sw.ts) to capture push events and display system-level notifications, replacing the previous Ant Design toast usage for server messages.
- Add a "Notification Permission" button in the User Center to allow users to request push notification rights.
- Remove Redis caching logic from KaiqiuService (event lists, match details, and member details) to ensure real-time data accuracy, as the cache was causing latency in updates.
- Clean up WebSocket service subscription logic to focus on user-specific events.
This shift from UI-only notifications to system push notifications improves visibility for critical server events (like match updates) even when the user is not on the active tab. Additionally, removing the cache simplifies the codebase and ensures the latest match data is always fetched.
- Add `.catch(() => null)` in `ClubSummary.tsx` to gracefully handle failed API requests and prevent UI crashes.
- Return `null` from `ClubSummary` when the club data is `null` to skip rendering during errors.
- Extract `getMatchInfo` logic into a new static method `getMatchDetail` within `KaiqiuService` for better separation of concerns.
- Update `getClubLocation` and `getEventInfo` to accept an optional `force` parameter, allowing cache bypass when network errors (like '连接超时') occur.
- Remove the old `getMatchInfo` utility function from `server.ts` and update the `/api/match` route to use `KaiqiuService.getMatchDetail`.
- Add `UserBind` model to Prisma schema for linking Logto and Kaiqiu user IDs.
- Implement `/api/account/bind` endpoint (GET/PUT) to handle Kaiqiu account binding and retrieval.
- Refactor `KaiqiuService` to include a `login` method that performs browser automation-like login on kaiqiuwang.cc using `cheerio` and `fetch`.
- Update `UserCenter` page to include a new `BindKaiqiuAccount` component.
- Restructure `WebSocketService`:
- Change from a simple global connection map to a per-user client tracking system (`#userClients`).
- Update topic naming conventions (e.g., `ONLINE_MEMBER_CHANGE` -> `MEMBER_CHANGE`).
- Add client-side broadcast capabilities for user-specific events like `MY_CLIENT_ONLINE`.
- Add support for dynamic subscription handling (SUB/UNSUB) via WebSocket messages.
- Update `verifyLogtoToken` to accept either `Headers` or a raw token string for flexibility in WebSocket auth.
- Minor fixes: typo corrections in `WSTopic` enum and commented out debug logs.
BREAKING CHANGE: WebSocket payload structure has changed.
The `ws.data` property now contains a `WsPaylaod` object with a `user` field (previously it was a JSON string of the JWT payload).
The `WSTopic` names have been updated (e.g., `ONLINE_MEMBER_CHANGE` is now `MEMBER_CHANGE`), requiring updates to any client code subscribing to these topics.
- Refactor ClubEventList to support persistent page state in sessionStorage and dynamic toggle for finished events.
- Move pagination logic to useRunOnce hook for initialization, ensuring correct state restoration.
- Update ClubSearchTable to support "My Favorites" tab, using useRef to cache search results for different club types.
- Enhance EventCard with precise time formatting (HH:mm:ss) and dynamic countdown logic using dayjs timezone.
- Persist club selection in GameSelector using local storage and integrate ClubSummary component.
- Fix geo data handling in KaiqiuService, ensuring coordinates are correctly passed to iCalendar generator.
- Remove unused imports and simplify component structure across affected files.
- Refactor ClubEventList to subscribe to all club events instead of just the current page, removing pagination from the ICS URL.
- Enhance ICS generation for club subscriptions:
- Fetch all non-finished events across pages.
- Include geographic location (lat/lon) in the event metadata.
- Add 2-hour alarms (display and audio) to all subscribed events.
- Improve EventCard status display with logic for 'Finished', 'In Progress', and countdown formats.
- Update KaiqiuService to parse match status (isProcessing, isFinished) and location name accurately.
- Integrate dayjs timezone (Asia/Tokyo) and UTC plugins across index.tsx, services, and types.
- Update IEventInfo interface to include isProcessing and location fields.
- Add 'Club' vs 'Points Club' filter in `ClubSearchTable` using Radio buttons.
- Update `searchClub` request to accept and pass `clubType` parameter to the backend API.
- Refactor logic in `ClubEventList` to determine "Show All" button visibility based on whether all items are finished or not finished, rather than just a fixed count.
- Add custom CSS (styled-components) to limit the height of the game selector drawer for better UX.
- Update backend service `KaiqiuService` to handle the new query parameters for filtering clubs by type.
- Add 'ics' dependency to package.json and update lockfile.
- Introduce pagination support in `ClubEventList` component (Ant Design Pagination + Spin loading state).
- Refactor `GameSelector` to fetch paginated data (`page` query parameter) and manage page state.
- Update `KaiqiuService` to:
- Add Redis caching for event lists (1 hour TTL) and individual match details (10 hours TTL).
- Implement `listClubEvents` method with pagination support (fetching HTML, parsing titles/urls/status, extracting total count).
- Update `getEventInfo` to utilize cached data.
- Update server routes (`index.tsx`, `routes.tsx`) to handle query parameters and pass paginated responses to the frontend.
- Fix logic in `GroupingPrediction` to set group length when players <= 12.
This change improves performance by reducing initial load times through pagination and caching, preventing UI freezing with large event lists.
- **Frontend Refactoring**: Extracted EventCard logic and finished game filtering from GameSelector into a new ClubEventsList component. Removed direct routing logic (handleGameClick, navigate) from App.tsx in favor of router loaders.
- **New Feature - Club Detail Page**: Implemented /club/:id route with ClubEventsPage. Added server-side loader to fetch club info and events in parallel via new API endpoints (/api/club/find, /api/club/:id). Created KaiqiuService for direct data fetching.
- **API & Types**: Extended IEventInfo with isFinished flag; updated server-side parsing in utils/server.ts. Added ClubInfo type definition. Migrated club search and filtering logic to the server side.
- **Dependencies**: Updated antd from 6.2.1 to 6.3.2.