Refactor API routes and controllers for improved structure and clarity

- 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.
This commit is contained in:
mlogclub
2026-04-25 10:27:43 +08:00
parent c1ab26ed71
commit 96168dc6fb
13 changed files with 98 additions and 132 deletions
+1 -1
View File
@@ -100,7 +100,7 @@
if (!baseUrl || !config.channelId || typeof fetch !== "function") {
return Promise.resolve(config);
}
var url = baseUrl + "/api/open/im/widget/config?channelId=" + encodeURIComponent(config.channelId);
var url = baseUrl + "/api/channel/config?channelId=" + encodeURIComponent(config.channelId);
return fetch(url, {
method: "GET",
cache: "no-store",