Migrate XMOJ-Script backend endpoints to /v1/* routes - #968
Closed
PythonSmall-Q with Copilot wants to merge 1 commit into
Closed
Migrate XMOJ-Script backend endpoints to /v1/* routes#968PythonSmall-Q with Copilot wants to merge 1 commit into
/v1/* routes#968PythonSmall-Q with Copilot wants to merge 1 commit into
Conversation
Agent-Logs-Url: https://github.com/XMOJ-Script-dev/XMOJ-Script/sessions/f076c6b7-9c17-4102-bba3-850043d58906 Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
PythonSmall-Q
April 11, 2026 02:36
View session
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAligns all client-side HTTP, WebSocket, and asset/image requests with the new versioned backend contract by switching them from unversioned root paths to Sequence diagram for versioned API and WebSocket interactionssequenceDiagram
actor User
participant Browser
participant XMOJ_UserScript
participant Messages_UI
participant API_Server_v1
participant Asset_Server_v1
participant WS_Endpoint_v1
User->>Browser: Load forum page
Browser->>XMOJ_UserScript: Execute userscript
User->>XMOJ_UserScript: Trigger API action
XMOJ_UserScript->>API_Server_v1: POST /v1/Action
API_Server_v1-->>XMOJ_UserScript: JSON response
User->>XMOJ_UserScript: Upload image
XMOJ_UserScript->>API_Server_v1: POST /v1/UploadImage
API_Server_v1-->>XMOJ_UserScript: ImageID
XMOJ_UserScript->>Browser: Insert markdown 
Browser->>Asset_Server_v1: GET /v1/GetImage?ImageID=ImageID
Asset_Server_v1-->>Browser: Image bytes
User->>Messages_UI: Open messages.html
Browser->>Messages_UI: Run UI JS with API_BASE=https://api.xmoj-bbs.me/v1/
Messages_UI->>API_Server_v1: POST /v1/ListMessages
API_Server_v1-->>Messages_UI: Messages data
User->>XMOJ_UserScript: Enable notifications
XMOJ_UserScript->>WS_Endpoint_v1: CONNECT /v1/ws/notifications?SessionID=Session
WS_Endpoint_v1-->>XMOJ_UserScript: Push notifications
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
|
请向 |
Contributor
|
请向 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend routing now supports versioned endpoints under
/v1/*, and this change aligns client-side calls with that contract across the userscript and messages UI.HTTP API routing updates
/v1/:https://api.xmoj-bbs.me/v1/http://127.0.0.1:8787/v1/(SuperDebug)WebSocket notification routing updates
/v1/ws/notifications?SessionID=...Asset/image API routing updates
https://assets.xmoj-bbs.me/v1/GetImage?ImageID=...XMOJ.user.jsandmessages.html.Summary by Sourcery
Align client-side API, WebSocket, and image asset calls with the backend’s new versioned
/v1routing.Enhancements:
/v1endpoints in both production and SuperDebug environments./v1/ws/notificationspath./v1/GetImageasset URLs for uploaded images in both the userscript and messages UI.Summary by cubic
Migrates all client calls to versioned
/v1routes to match the new backend contract. Applies to HTTP, WebSocket, and asset image endpoints inXMOJ.user.jsand the messages UI.https://api.xmoj-bbs.me/v1/andhttp://127.0.0.1:8787/v1/(SuperDebug)./v1/ws/notifications?SessionID=....https://assets.xmoj-bbs.me/v1/GetImage?ImageID=....Written for commit bb42d55. Summary will update on new commits.