refactor: separate API and SPA handling in server routes and add static file serving options
test: add tests for SPA handling and static file serving
feat: implement embedded SPA support for production and development environments
- Implement role management endpoints including listing, creating, updating, and deleting roles.
- Add session management endpoints for viewing and revoking sessions.
- Create skill definition management endpoints for CRUD operations and status updates.
- Introduce tag management endpoints for handling tags with sorting and status updates.
- Develop ticket management endpoints for viewing, creating, updating, and managing ticket progress.
- Implement user management endpoints for CRUD operations, role assignments, and password resets.
- Add WeChat callback handlers for verifying and processing messages.
- Updated TagController methods to use httpx.WriteJSON for consistent JSON response handling.
- Refactored TicketController to replace context-dependent methods with standalone functions using httpx.
- Modified UserController to utilize httpx for error handling and response formatting.
- Adjusted WechatController to remove context dependency and standardize response handling.
- Added new routing functions for API and dashboard endpoints in controller_routes.go.
- Replaced previous ginx.HandleController calls with explicit route registrations.
- Removed the ginx package as it is no longer needed for handling controllers.
- Improved organization and readability of route definitions.
- Updated multiple repository and service files to replace imports from "github.com/mlogclub/simple/web/params" with "cs-agent/internal/pkg/httpx/params".
- Adjusted context handling in auth_service and ws_service to use gin.Context instead of iris.Context.
- Ensured consistent usage of HTTP status responses across websocket handlers.
- Introduced RealtimeCustomerSessionRefreshPayload and RealtimeCustomerSessionRefreshEvent types for handling session refresh events.
- Updated ws_service to verify customer session and handle session refresh notifications.
- Enhanced API client to manage customer session tokens and expiration.
- Implemented customer session validation and storage in session storage.
- Added functions to exchange and ensure customer sessions.
- Updated IM real-time connection to include customer session tokens in WebSocket requests.
- Modified SDK and widget configurations to support external IDs and user tokens.
- Updated API route structure to remove versioning and consolidate endpoints.
- Refactored routing in `server.go` to use a unified `/api` prefix for all controllers.
- Added new `ChannelController`, `ConversationController`, and `MessageController` to handle specific API functionalities.
- Removed deprecated `OpenImContextMiddleware` and related logic.
- Enhanced channel validation logic in `ChannelService` and `ChannelRepository`.
- Updated frontend API calls to align with new endpoint structure.
- Updated all relevant API functions in agent.ts, company.ts, customer-contact.ts, customer.ts, dashboard.ts, ticket-config.ts, and ticket.ts to point to the new /api/dashboard paths.
- Ensured that all request methods and payload structures remain unchanged to maintain existing functionality.