feat: add interface to get software basic info#289
Merged
womendoushihaoyin merged 2 commits intoSnapmaker:feature_wcp_softwareinfofrom Apr 30, 2026
Merged
Conversation
| m_res_data["version"] = std::string(Snapmaker_VERSION); | ||
|
|
||
| auto& server = wxGetApp().m_page_http_server; | ||
| m_res_data["http_host"] = std::string("127.0.0.1:") + std::to_string(server.get_port()); |
Collaborator
There was a problem hiding this comment.
Don't hardcode 127.0.0.1 directly; there is a macro named LOCALHOST_URL in the HTTP server module that you should use instead.
Collaborator
|
lgtm |
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.
概述
新增
sw_GetSoftwareInfo命令,供 Flutter Web 端获取软件基础信息。改动内容
SSWCP.hpp: 声明sw_GetSoftwareInfo()方法SSWCP.cpp: 在process()中添加命令分发,实现sw_GetSoftwareInfo()逻辑接口说明
sw_GetSoftwareInfoversion: 软件版本号http_host: 本地 HTTP 服务器地址测试计划
version.inc一致http_host端口与PAGE_HTTP_PORT一致Summary
Add
sw_GetSoftwareInfocommand to provide software basic information to the Flutter Web frontend.Changes
SSWCP.hpp: Declaresw_GetSoftwareInfo()methodSSWCP.cpp: Add command dispatch inprocess()and implementsw_GetSoftwareInfo()API
sw_GetSoftwareInfoversion: Software version stringhttp_host: Local HTTP server addressTest plan
version.inchttp_hostport matchesPAGE_HTTP_PORT